Apcaccess is a program (normally found in /sbin/apcaccess) that permits you to print out the complete status of your UPS. Although there are a number of command line arguments ( eprom, reconfig, status, slave, shutdown), all except eprom and status are under development and hence do not work.

If you have built apcupsd with pthreads enabled, apcaccess will use the Network Information Server to obtain the necessary information for the status and eeprom commands. This is because in the pthreaded version, there is no IPC shared memory. In this case (pthreads enabled), you can specify a second optional argument to apcaccess in the form of host:port, where the :port is optional. The default is localhost:7000. In the current version (3.8.2) specifying host:port works only if the host specified is running the NIS server and an apcupsd identical (version, architecture, ...) to the localhost (i.e. this code is apcupsd version dependent as well as machine dependent).

apcaccess status

The status command line option of apcaccess will produce a full printout of all the STATUS variables used by apcupsd. This can be very helpful for checking the condition of your UPS and to know whether or not apcupsd is properly connected to it. For a complete description of the variables and their meanings, please read the Apcupsd STATUS document.

Please note that if you invoke apcaccess within the first 30 seconds of launching apcupsd, you will likely get an error message such as:

APCACCESS FATAL ERROR in apcipc.c at line 325
attach_shmarea: shared memory version mismatch

This is because apcupsd is still in the process of initializing the shared memory segment used to communicate between the two processes. There is also a small window of time after which the memory segment is properly initialized but before the UPS has been completely polled. If you invoke apcaccess during this period, you will get the STATUS output, but with many of the values zero. The solution is to wait at least 30 seconds after starting apcupsd before launching apcaccess.

To invoke apcaccess, enter:

apcaccess status

and for a SmartUPS 1000 apcaccess prints the following output:

DATE : Fri Dec 03 12:34:26 CET 1999 HOSTNAME : matou RELEASE : 3.7.0-beta-1 CABLE : Custom Cable Smart MODEL : SMART-UPS 1000 UPSMODE : Stand Alone UPSNAME : UPS_IDEN LINEV : 232.7 Volts MAXLINEV : 236.6 Volts MINLINEV : 231.4 Volts LINEFREQ : 50.0 Hz OUTPUTV : 232.7 Volts LOADPCT : 11.4 Percent Load Capacity BATTV : 27.7 Volts BCHARGE : 100.0 Percent MBATTCHG : 5 Percent TIMELEFT : 112.0 Minutes MINTIMEL : 3 Minutes SENSE : Low DWAKE : 060 Seconds DSHUTD : 180 Seconds LOTRANS : 204.0 Volts HITRANS : 253.0 Volts RETPCT : 050.0 Percent STATFLAG : 0x08 Status Flag STATUS : ONLINE ITEMP : 29.2 C Internal ALARMDEL : Low Battery LASTXFER : U command or Self Test SELFTEST : NO STESTI : 336 DLOWBATT : 02 Minutes DIPSW : 0x00 Dip Switch REG1 : 0x00 Register 1 REG2 : 0x00 Register 2 REG3 : 0x00 Register 3 MANDATE : 01/05/99 SERIALNO : GS9902009459 BATTDATE : 01/05/99 NOMOUTV : 230.0 NOMBATTV : 24.0 HUMIDITY : N/A AMBTEMP : N/A EXTBATTS : 0 BADBATTS : N/A FIRMWARE : 60.11.I APCMODEL : IWI END APC : Fri Dec 03 12:34:33 CET 1999

apcaccess eprom

The eprom command line option for apcaccess allows you to examine the current values of your UPS' EPROM as well as to know the permitted values that can be set in the EPROM. For information about changing these values, see the section on Apcupsd EEPROM Configuration.

A typical output from apcaccess eprom is:

Valid EPROM values for the SMART-UPS 1000

                         Config        Current  Permitted
Description              Directive     Value    Values
Upper transfer voltage   HITRANSFER    253      253 264 271 280 
Lower transfer voltage   LOTRANSFER    208      196 188 208 204 
Return threshold         RETURNCHARGE  15       00 15 50 90 
Output voltage on batts  OUTPUTVOLTS   230      230 240 220 225 
Sensitivity              SENSITIVITY   H        H M L L 
Low battery warning      LOWBATT       2        02 05 07 10 
Shutdown grace delay     SLEEP         180      020 180 300 600 
Alarm delay              BEEPSTATE     T        0 T L N 
Wakeup delay             WAKEUP        60       000 060 180 300 
Self test interval       SELFTEST      336      336 168 ON  OFF