apcaccess --- retrieve status information from apcupsd(8)
apcaccess [-f <config-file>] [-h <host>[:<port>]] [-p <parameter-name>] [-u] [<command>] [<host>[:<port>]]
apcaccess is a program which prints out the complete status of most American Power Conversion Corp. (APC) UPSes provided you have the apcupsd(8) daemon installed, properly configured and running. It can access status information from any APC UPS attached to the localhost or attached to any computer on the network which is running apcuspd in NIS mode. The command line options are: -f configuration file of apcupsd (default is usually /etc/apcupsd/apcupsd.conf) -h hostname and port of apcupsd to communicate with. The default hostname and port are obtained from the configuration file. -p Report only the value of the named parameter instead of all parameters and values. -u Remove units field for easier parsing by scripts. <command> An optional command, unless a hostname is also being specified. The only implemented command is status Shorthand for status localhost:3551. This produces a full printout of the available status information for the associated UPS. <host> An optional hostname which may be a bare machine name, fully qualified domain name or IP address. :<port> An optional port number where a hostname argument has been specified. The default is 3551, the official port number assigned by IANA for the apcupsd NIS server. The default hostname and port are obtained from the configuration file. apcaccess uses apcupsd's inbuilt Network Information Server (NIS) -- no relation to Sun's NIS/YP service -- to obtain the current status information from the UPS on the local or remote computer. It is therefore necessary to have the following configuration directives: NETSERVER on NISPORT 3551 in the /etc/apcupsd/apcupsd.conf configuration file so that the Network Information Server will be accessible. Firewall rules for appropriate network access may also be needed.
The status report output format is simple ASCII. Generally there is a single piece of information on each line of output. The content varies based on the model of UPS being used and, in some cases, the firmware version.
Set out below is a sample of the status output which may be generated for the specified UPS models. All models APC : version, number of records and number of bytes following DATE : Date and time of last update from UPS HOSTNAME : hostname of computer running apcupsd VERSION : apcupsd version number, date and operating system UPSNAME : UPS name from configuration file (dumb) or EEPROM (smart) CABLE : Cable type specified in the configuration file MODEL : UPS model derived from UPS information UPSMODE : Mode in which UPS is operating STARTTIME : Date and time apcupsd was started STATUS : UPS status. One or more of the following (space- separated): CAL TRIM BOOST ONLINE ONBATT OVERLOAD LOWBATT REPLACEBATT NOBATT SLAVE SLAVEDOWN or COMMLOST or SHUTTING DOWN MASTERUPD : Last time the master sent an update to the slave ENDAPC : Date and time of status information was written Smart-UPS and Matrix-UPS (Smart Signalling) LINEV : Current input line voltage LOADPCT : Percentage of UPS load capacity used as estimated by UPS BCHARGE : Current battery capacity charge percentage TIMELEFT : Remaining runtime left on battery as estimated by the UPS MBATTCHG : Min battery charge % (BCHARGE) required for system shutdown MINTIMEL : Min battery runtime (MINUTES) required for system shutdown MAXTIME : Max battery runtime (TIMEOUT) after which system is shutdown MAXLINEV : Maximum input line voltage since apcupsd started MINLINEV : Min (observed) input line voltage since apcupsd started OUTPUTV : Current UPS output voltage SENSE : Current UPS sensitivity setting for voltage fluctuations DWAKE : Time UPS waits after power off when the power is restored DSHUTD : Delay before UPS powers down after command received DLOWBATT : Low battery signal sent when this much runtime remains LOTRANS : Input line voltage below which UPS will switch to battery HITRANS : Input line voltage above which UPS will switch to battery RETPCT : Battery charge % required after power off to restore power ITEMP : UPS internal temperature in degrees Celcius ALARMDEL : Delay period before UPS starts sounding alarm BATTV : Current battery voltage LINEFREQ : Current line frequency in Hertz LASTXFER : Reason for last transfer to battery since apcupsd startup NUMXFERS : Number of transfers to battery since apcupsd startup XONBATT : Date, time of last transfer to battery since apcupsd startup TONBATT : Seconds currently on battery CUMONBATT : Cumulative seconds on battery since apcupsd startup XOFFBAT : Date, time of last transfer off battery since apcupsd startup SELFTEST : Date and time of last self test since apcupsd startup STESTI : Self-test interval STATFLAG : UPS status flag in hex DIPSW : Current UPS DIP switch settings REG1 : Fault register 1 in hex REG2 : Fault register 2 in hex REG3 : Fault register 3 in hex MANDATE : UPS date of manufacture SERIALNO : UPS serial number BATTDATE : Date battery last replaced (if set) NOMOUTV : Nominal output voltage to supply when on battery power NOMBATTV : Nominal battery voltage EXTBATTS : Number of external batteries (for XL models) BADBATTS : Number of bad external battery packs (for XL models) FIRMWARE : UPS firmware version APCMODEL : APC model information Newer Back-UPS Pro (Smart Signalling) LINEV : Current input line voltage LOADPCT : Percentage of UPS load capacity used MBATTCHG : Min battery charge % (BCHARGE) required for system shutdown MINTIMEL : Min battery runtime (MINUTES) required for system shutdown MAXTIME : Max battery runtime (TIMEOUT) after which system is shutdown MAXLINEV : Maximum input line voltage since apcupsd startup MINLINEV : Minimum input line voltage since apcupsd startup OUTPUTV : Current UPS output voltage BATTV : Current battery charge voltage STATFLAG : UPS status flag in hex Back-UPS RS 1500 (USB) LINEV : Current input line voltage LOADPCT : Percentage of UPS load capacity used BCHARGE : Current battery capacity charge percentage TIMELEFT : Remaining runtime left on battery as estimated by UPS MBATTCHG : Min battery charge % (BCHARGE) required for system shutdown MINTIMEL : Min battery runtime (MINUTES) required for system shutdown MAXTIME : Max battery runtime (TIMEOUT) after which system is shutdown *OUTPUTV : Current UPS output voltage *DWAKE : Time UPS waits after power off when the power is restored *DSHUTD : Delay before UPS powers down after command received LOTRANS : Input line voltage below which UPS will switch to battery HITRANS : Input line voltage above which UPS will switch to battery *RETPCT : Battery charge % required after power off to restore power *ITEMP : UPS internal temperature in degrees Celcius ALARMDEL : Delay period before UPS starts sounding alarm BATTV : Current battery voltage *LINEFREQ : Current line frequency in Hertz *LASTXFER : Reason for last transfer to battery since apcupsd startup NUMXFERS : Number of transfers to battery since apcupsd startup XONBATT : Date, time of last transfer to battery since apcupsd startup TONBATT : Seconds currently on battery CUMONBATT : Cumulative seconds on battery since apcupsd startup XOFFBAT : Date, time of last transfer off battery since apcupsd startup SELFTEST : Date and time of last self test since apcupsd startup STATFLAG : UPS status flag in hex MANDATE : UPS date of manufacture SERIALNO : UPS serial number BATTDATE : Date battery last replaced (if set) NOMBATTV : Nominal battery voltage FIRMWARE : UPS firmware version APCMODEL : APC model information * presence dependant on USB firmware version. Web/SNMP (AP9716) or PowerNet SNMP (AP9605) SmartSlot Card LINEV : Current input line voltage LOADPCT : Percentage of UPS load capacity used as estimated by UPS BCHARGE : Current battery capacity charge percentage TIMELEFT : Remaining runtime left on battery as estimated by UPS MBATTCHG : Min battery charge % (BCHARGE) required for system shutdown MINTIMEL : Min battery runtime (MINUTES) required for system shutdown MAXTIME : Max battery runtime (TIMEOUT) after which system is shutdown MAXLINEV : Maximum input line voltage since apcupsd startup MINLINEV : Minimum input line voltage since apcupsd startup OUTPUTV : UPS output voltage SENSE : Current UPS sensitivity setting for voltage fluctuations DWAKE : Time UPS waits after power off when the power is restored DSHUTD : Delay before UPS powers down after command received DLOWBATT : Low battery signal sent when this much runtime remains LOTRANS : Input line voltage below which UPS will switch to battery HITRANS : Input line voltage above which UPS will switch to battery RETPCT : Battery charge % required after power off to restore power ITEMP : UPS internal temperature in degrees Celcius ALARMDEL : Delay period before UPS starts sounding alarm LINEFREQ : Current line frequency in Hertz NUMXFERS : Number of transfers to battery since apcupsd startup TONBATT : Seconds currently on battery CUMONBATT : Cumulative seconds on battery since apcupsd startup XOFFBATT : Date, time of last transfer off battery since apcupsd startup STESTI : Self-test interval STATFLAG : UPS status flag in hex DIPSW : Current UPS DIP switch settings MANDATE : UPS date of manufacture SERIALNO : UPS serial number BATTDATE : Date battery last replaced (if set) NOMOUTV : Nominal output voltage to supply when on battery power NOMPOWER : Nominal power output in watts EXTBATTS : Number of external batteries (for XL models) BADBATTS : Number of bad external battery packs (for XL models) FIRMWARE : UPS firmware version APCMODEL : APC model information Share-UPS (AP9270) (Basic port) MBATTCHG : Min battery charge % (BCHARGE) required for system shutdown MINTIMEL : Min battery runtime (MINUTES) required for system shutdown MAXTIME : Max battery runtime (TIMEOUT) after which system is shutdown NUMXFERS : Number of transfers to battery since apcupsd startup TONBATT : Seconds currently on battery CUMONBATT : Cumulative seconds on battery since apcupsd startup XOFFBATT : Date, time of last transfer off battery since apcupsd startup STATFLAG : UPS status flag in hex UPS Environmental Monitoring SmartSlot Card (AP9612TH) HUMIDITY : Ambient humidity AMBTEMP : Ambient temperature Back-UPS Pro and Smart-UPS v/s (Smart Signalling) LINEFAIL : Input line voltage status. BATTSTAT : Battery status. LASTXFER : Last (observed) transfer to battery. Back-UPS and Net-UPS (Simple Signalling) LINEFAIL : Input line voltage status. BATTSTAT : Battery status. STATFLAG : UPS status flag in hex.
/etc/apcupsd/apcupsd.conf
apcupsd.conf(5), apcupsd(8). The HTML apcupsd manual installed on your system or available online at http://www.apcupsd.org/
This page Trevor Roydhouse Software Adam Kropelin (current Project Manager and Code Maintainer) Kern Sibbald (former Project Manager and Code Maintainer) Riccardo Facchetti (former Project Manager and Code Maintainer) Andre M. Hedrick (Project Founder and former Code Maintainer) Contributors An enormous number of users who have devoted their time and energy to this project -- thanks.
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.