APCACCESS(8)

πŸ“¦
version 3.14.14 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

🌸 APCACCESS(8) 🌸

okay bestie, gather round β€” this is apcaccess, from the System Manager's Manual, and it's genuinely one of those little tools that just slays at one job. let's get into it πŸ’…


✨ NAME ✨

apcaccess β€” retrieve status information from apcupsd(8) 🫢


πŸŽ€ SYNOPSIS πŸŽ€

apcaccess [-f <config-file>] [-h <host>[:<port>]] [-p <parameter-name>]
          [-u] [<command>] [<host>[:<port>]]

πŸ’– DESCRIPTION πŸ’–

So like. apcaccess is a program that prints out the complete status of most American Power Conversion Corp. (APC) UPSes β€” but here's the catch, bestie: you gotta have the apcupsd(8) daemon installed, properly configured, and running. All three. No skipping steps πŸ™ˆ

Once that's sorted, it can pull status info from any APC UPS attached to the localhost, or attached to any computer on the network that's running apcuspd in NIS mode. network UPS? we love to see it 🌈

The command line options are:

  • -f β€” the 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. like, just the one thing. main character energy πŸ‘‘
  • -u β€” remove the units field, for easier parsing by scripts. lowkey a lifesaver when you're scripting 🧚
  • <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. πŸ’€ (yes, that's the only one. it's iconic, it doesn't need friends.)
  • <host> β€” an optional hostname, which may be a bare machine name, fully qualified domain name, or IP address.
  • :<port> β€” an optional port number, used 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.

so apcaccess uses apcupsd's inbuilt Network Information Server (NIS) β€” and no relation to Sun's NIS/YP service, fr fr, don't get it twisted β€” to obtain the current status information from the UPS on the local or remote computer. 🌸

Which means: 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. And bestie β€” firewall rules for appropriate network access may also be needed. don't forget the firewall, i'm begging 😭


⭐ STATUS REPORT FORMAT ⭐

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. so like β€” different UPS, different vibe check. that's just how it is πŸ’œ

✨ EXAMPLES ✨

Okay bestie, here's the good part β€” a whole buffet of sample status output that apcaccess might spit out for the different UPS models. Let's break it down by vibe (aka by hardware) πŸ’…


All models

Every UPS gets these, no matter what:

  • APC β€” the version, the number of records, and the number of bytes following it
  • DATE β€” date and time of the last update from the UPS
  • HOSTNAME β€” hostname of the computer running apcupsd
  • VERSION β€” the apcupsd version number, plus the date and operating system
  • UPSNAME β€” the UPS name, pulled from the configuration file (dumb) or from EEPROM (smart)
  • CABLE β€” cable type, as specified in the configuration file
  • MODEL β€” the UPS model, derived from the UPS information
  • UPSMODE β€” the mode the UPS is operating in
  • STARTTIME β€” date and time apcupsd was started
  • STATUS β€” the 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 the status information was written

Smart-UPS and Matrix-UPS (Smart Signalling)

The full-course meal, honestly πŸ”₯

  • LINEV β€” current input line voltage
  • LOADPCT β€” percentage of UPS load capacity used, as estimated by the 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 the system is shut down
  • 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 the UPS waits after power off when the power is restored
  • DSHUTD β€” delay before the UPS powers down after a command is received
  • DLOWBATT β€” low battery signal, sent when this much runtime remains
  • LOTRANS β€” input line voltage below which the UPS will switch to battery
  • HITRANS β€” input line voltage above which the 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 the UPS starts sounding the alarm
  • BATTV β€” current battery voltage
  • LINEFREQ β€” current line frequency in Hertz
  • LASTXFER β€” reason for the last transfer to battery since apcupsd startup
  • NUMXFERS β€” number of transfers to battery since apcupsd startup
  • XONBATT β€” date, time of the last transfer to battery since apcupsd startup
  • TONBATT β€” seconds currently on battery
  • CUMONBATT β€” cumulative seconds on battery since apcupsd startup
  • XOFFBAT β€” date, time of the last transfer off battery since apcupsd startup
  • SELFTEST β€” date and time of the 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 the battery was 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)

A lighter little lineup, still cute:

  • 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 the system is shut down
  • 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)

Look at all those lil stars, it's giving constellation ⭐ (the * means the field is presence dependant on the USB firmware version β€” more on that at the bottom of this section!)

  • 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 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 the system is shut down
  • *OUTPUTV β€” current UPS output voltage
  • *DWAKE β€” time the UPS waits after power off when the power is restored
  • *DSHUTD β€” delay before the UPS powers down after a command is received
  • LOTRANS β€” input line voltage below which the UPS will switch to battery
  • HITRANS β€” input line voltage above which the 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 the UPS starts sounding the alarm
  • BATTV β€” current battery voltage
  • *LINEFREQ β€” current line frequency in Hertz
  • *LASTXFER β€” reason for the last transfer to battery since apcupsd startup
  • NUMXFERS β€” number of transfers to battery since apcupsd startup
  • XONBATT β€” date, time of the last transfer to battery since apcupsd startup
  • TONBATT β€” seconds currently on battery
  • CUMONBATT β€” cumulative seconds on battery since apcupsd startup
  • XOFFBAT β€” date, time of the last transfer off battery since apcupsd startup
  • SELFTEST β€” date and time of the last self test since apcupsd startup
  • STATFLAG β€” UPS status flag in hex
  • MANDATE β€” UPS date of manufacture
  • SERIALNO β€” UPS serial number
  • BATTDATE β€” date the battery was last replaced (if set)
  • NOMBATTV β€” nominal battery voltage
  • FIRMWARE β€” UPS firmware version
  • APCMODEL β€” APC model information
* presence dependant on USB firmware version. (Yes, that's straight from the page β€” the stars are conditional, bestie 🫢)

Web/SNMP (AP9716) or PowerNet SNMP (AP9605) SmartSlot Card

Network card energy, honestly iconic 🌈

  • LINEV β€” current input line voltage
  • LOADPCT β€” percentage of UPS load capacity used, as estimated by the 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 the system is shut down
  • 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 the UPS waits after power off when the power is restored
  • DSHUTD β€” delay before the UPS powers down after a command is received
  • DLOWBATT β€” low battery signal, sent when this much runtime remains
  • LOTRANS β€” input line voltage below which the UPS will switch to battery
  • HITRANS β€” input line voltage above which the 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 the UPS starts sounding the 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 the 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 the battery was 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)

Basic port, basic babe β€” short and sweet πŸ“

  • 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 the system is shut down
  • 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 the last transfer off battery since apcupsd startup
  • STATFLAG β€” UPS status flag in hex

UPS Environmental Monitoring SmartSlot Card (AP9612TH)

Two fields. Yes, two. It's a whole vibe:

  • 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.

πŸ“ FILES πŸ“

  • /etc/apcupsd/apcupsd.conf

That's the one, bestie β€” the config file lives here πŸ’–


πŸ‘€ SEE ALSO πŸ‘€

And the HTML apcupsd manual β€” it's installed on your system, or you can find it online at http://www.apcupsd.org/ ✨


πŸ’– AUTHORS πŸ’–

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. 🫢 (Fr fr, that's the whole section. Respect the contributors, they ate.)


✨ and that's the whole page, bestie ✨

Signing off from apcaccess v3.14.6, dated March 28, 2014 β€” go check your UPS status, mwah πŸ’…πŸŽ€