APCACCESS(8)
πΈ 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 ofapcupsd(default is usually/etc/apcupsd/apcupsd.conf)-hβ hostname and port ofapcupsdto 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 isstatusβ shorthand forstatus 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 is3551, the official port number assigned by IANA for theapcupsdNIS 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 itDATEβ date and time of the last update from the UPSHOSTNAMEβ hostname of the computer runningapcupsdVERSIONβ theapcupsdversion number, plus the date and operating systemUPSNAMEβ the UPS name, pulled from the configuration file (dumb) or from EEPROM (smart)CABLEβ cable type, as specified in the configuration fileMODELβ the UPS model, derived from the UPS informationUPSMODEβ the mode the UPS is operating inSTARTTIMEβ date and timeapcupsdwas startedSTATUSβ 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 slaveENDAPCβ date and time the status information was written
Smart-UPS and Matrix-UPS (Smart Signalling)
The full-course meal, honestly π₯
LINEVβ current input line voltageLOADPCTβ percentage of UPS load capacity used, as estimated by the UPSBCHARGEβ current battery capacity charge percentageTIMELEFTβ remaining runtime left on battery, as estimated by the UPSMBATTCHGβ min battery charge % (BCHARGE) required for system shutdownMINTIMELβ min battery runtime (MINUTES) required for system shutdownMAXTIMEβ max battery runtime (TIMEOUT) after which the system is shut downMAXLINEVβ maximum input line voltage sinceapcupsdstartedMINLINEVβ min (observed) input line voltage sinceapcupsdstartedOUTPUTVβ current UPS output voltageSENSEβ current UPS sensitivity setting for voltage fluctuationsDWAKEβ time the UPS waits after power off when the power is restoredDSHUTDβ delay before the UPS powers down after a command is receivedDLOWBATTβ low battery signal, sent when this much runtime remainsLOTRANSβ input line voltage below which the UPS will switch to batteryHITRANSβ input line voltage above which the UPS will switch to batteryRETPCTβ battery charge % required after power off to restore powerITEMPβ UPS internal temperature in degrees CelciusALARMDELβ delay period before the UPS starts sounding the alarmBATTVβ current battery voltageLINEFREQβ current line frequency in HertzLASTXFERβ reason for the last transfer to battery sinceapcupsdstartupNUMXFERSβ number of transfers to battery sinceapcupsdstartupXONBATTβ date, time of the last transfer to battery sinceapcupsdstartupTONBATTβ seconds currently on batteryCUMONBATTβ cumulative seconds on battery sinceapcupsdstartupXOFFBATβ date, time of the last transfer off battery sinceapcupsdstartupSELFTESTβ date and time of the last self test sinceapcupsdstartupSTESTIβ self-test intervalSTATFLAGβ UPS status flag in hexDIPSWβ current UPS DIP switch settingsREG1β fault register 1 in hexREG2β fault register 2 in hexREG3β fault register 3 in hexMANDATEβ UPS date of manufactureSERIALNOβ UPS serial numberBATTDATEβ date the battery was last replaced (if set)NOMOUTVβ nominal output voltage to supply when on battery powerNOMBATTVβ nominal battery voltageEXTBATTSβ number of external batteries (for XL models)BADBATTSβ number of bad external battery packs (for XL models)FIRMWAREβ UPS firmware versionAPCMODELβ APC model information
Newer Back-UPS Pro (Smart Signalling)
A lighter little lineup, still cute:
LINEVβ current input line voltageLOADPCTβ percentage of UPS load capacity usedMBATTCHGβ min battery charge % (BCHARGE) required for system shutdownMINTIMELβ min battery runtime (MINUTES) required for system shutdownMAXTIMEβ max battery runtime (TIMEOUT) after which the system is shut downMAXLINEVβ maximum input line voltage sinceapcupsdstartupMINLINEVβ minimum input line voltage sinceapcupsdstartupOUTPUTVβ current UPS output voltageBATTVβ current battery charge voltageSTATFLAGβ 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 voltageLOADPCTβ percentage of UPS load capacity usedBCHARGEβ current battery capacity charge percentageTIMELEFTβ remaining runtime left on battery, as estimated by the UPSMBATTCHGβ min battery charge % (BCHARGE) required for system shutdownMINTIMELβ min battery runtime (MINUTES) required for system shutdownMAXTIMEβ 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 receivedLOTRANSβ input line voltage below which the UPS will switch to batteryHITRANSβ 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 CelciusALARMDELβ delay period before the UPS starts sounding the alarmBATTVβ current battery voltage*LINEFREQβ current line frequency in Hertz*LASTXFERβ reason for the last transfer to battery sinceapcupsdstartupNUMXFERSβ number of transfers to battery sinceapcupsdstartupXONBATTβ date, time of the last transfer to battery sinceapcupsdstartupTONBATTβ seconds currently on batteryCUMONBATTβ cumulative seconds on battery sinceapcupsdstartupXOFFBATβ date, time of the last transfer off battery sinceapcupsdstartupSELFTESTβ date and time of the last self test sinceapcupsdstartupSTATFLAGβ UPS status flag in hexMANDATEβ UPS date of manufactureSERIALNOβ UPS serial numberBATTDATEβ date the battery was last replaced (if set)NOMBATTVβ nominal battery voltageFIRMWAREβ UPS firmware versionAPCMODELβ 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 voltageLOADPCTβ percentage of UPS load capacity used, as estimated by the UPSBCHARGEβ current battery capacity charge percentageTIMELEFTβ remaining runtime left on battery, as estimated by the UPSMBATTCHGβ min battery charge % (BCHARGE) required for system shutdownMINTIMELβ min battery runtime (MINUTES) required for system shutdownMAXTIMEβ max battery runtime (TIMEOUT) after which the system is shut downMAXLINEVβ maximum input line voltage sinceapcupsdstartupMINLINEVβ minimum input line voltage sinceapcupsdstartupOUTPUTVβ UPS output voltageSENSEβ current UPS sensitivity setting for voltage fluctuationsDWAKEβ time the UPS waits after power off when the power is restoredDSHUTDβ delay before the UPS powers down after a command is receivedDLOWBATTβ low battery signal, sent when this much runtime remainsLOTRANSβ input line voltage below which the UPS will switch to batteryHITRANSβ input line voltage above which the UPS will switch to batteryRETPCTβ battery charge % required after power off to restore powerITEMPβ UPS internal temperature in degrees CelciusALARMDELβ delay period before the UPS starts sounding the alarmLINEFREQβ current line frequency in HertzNUMXFERSβ number of transfers to battery sinceapcupsdstartupTONBATTβ seconds currently on batteryCUMONBATTβ cumulative seconds on battery sinceapcupsdstartupXOFFBATTβ date, time of the last transfer off battery sinceapcupsdstartupSTESTIβ self-test intervalSTATFLAGβ UPS status flag in hexDIPSWβ current UPS DIP switch settingsMANDATEβ UPS date of manufactureSERIALNOβ UPS serial numberBATTDATEβ date the battery was last replaced (if set)NOMOUTVβ nominal output voltage to supply when on battery powerNOMPOWERβ nominal power output in wattsEXTBATTSβ number of external batteries (for XL models)BADBATTSβ number of bad external battery packs (for XL models)FIRMWAREβ UPS firmware versionAPCMODELβ APC model information
Share-UPS (AP9270) (Basic port)
Basic port, basic babe β short and sweet π
MBATTCHGβ min battery charge % (BCHARGE) required for system shutdownMINTIMELβ min battery runtime (MINUTES) required for system shutdownMAXTIMEβ max battery runtime (TIMEOUT) after which the system is shut downNUMXFERSβ number of transfers to battery sinceapcupsdstartupTONBATTβ seconds currently on batteryCUMONBATTβ cumulative seconds on battery sinceapcupsdstartupXOFFBATTβ date, time of the last transfer off battery sinceapcupsdstartupSTATFLAGβ UPS status flag in hex
UPS Environmental Monitoring SmartSlot Card (AP9612TH)
Two fields. Yes, two. It's a whole vibe:
HUMIDITYβ ambient humidityAMBTEMPβ 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 π
π
π¦ where this page comes from
- alpine 3.22: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- alpine 3.23: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- alpine 3.24: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- arch rolling: apcupsd 3.14.14-9 Β· GPL
- epel 10: apcupsd 3.14.14-36.el10_1 Β· GPL-2.0-only
- epel 9: apcupsd 3.14.14-35.el9 Β· GPL-2.0-only
- fedora 43: apcupsd 3.14.14-39.fc43 Β· GPL-2.0-only
- fedora 44: apcupsd 3.14.14-41.fc44 Β· GPL-2.0-only
- nixos 26.05: apcupsd 3.14.14
- nixpkgs unstable: apcupsd 3.14.14
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms