Shutdown apcupsd if it is running.
Make sure your /etc/apcupsd/apcupsd.conf file
has UPSTYPE backups and UPSCABLE simple
Normally apctest will have been built and installed
by default, otherwise, you can explicitly build it on
Unix with:
cd <apcupsd-source-directory>
make apctest
./apctest
on Win32 systems, use:
make apctestwin32
./apctest
2001-02-07 04:08:26 apctest 3.8.5 (3 January 2002) redhat Checking configuration ... sharenet.type = DISABLE cable.type = CUSTOM_SIMPLE mode.type = BK Setting up serial port ... Creating serial port lock file ... Doing prep_serial() ... Hello, this is the apcupsd Cable Test program. This part of apctest is for testing dumb UPSes (ones that uses signaling rather than commands. Most tests enter a loop polling every second for 10 seconds.Then it will present you with the following list of choices:
1) Test 1 - normal mode 2) Test 2 - no cable 3) Test 3 - no power 4) Test 4 - low battery (requires test 3 first) 5) Test 5 - battery exhausted 6) Test 6 - kill UPS power 7) Test 7 - run tests 1 through 5 8) Guess which is the appropriate cable 9) quit Select test number:Run tests 1, 2, and 3. Note, none of the currently supported cables will indicate a change for test 2. You can then run test 8 to see what cable it thinks you should be using. Finally run test 4.
apctest can also be run for Smart UPSes.
The print out of your testing will be written to the file apctest.output. If you are unable to solve your problem, you can try posting that file to the development mailing list, and perhaps we can help you. In this case, please also include information on your operating system, which version of apcupsd you are using, your UPS model, and also your apcupsd.conf file.UPSTYPE backups UPSCABLE APC_940_0119A or APC_940_0127A or APC_940_0128A or APC_940_0020B or APC_940_0020Chere are typical signals you would expect to see in the output from the various tests of apctest:
Test 1 normal: RTS for cables (0119A 0127A 0128A) Test 2 no serial cable: not important Test 3 no AC power: CTS for all cables Test 4 batteries exhausted: CTS and CD for all cablesNote: RTS if set in Test 1 will probably also be set in all the other tests. This is not important, what counts is the appearance of CTS when the power fails and additionally CD when the batteries are low.
UPSTYPE backupspro UPSCABLE APC_940_0095A or APC_940_0095Chere are the typical signals you would expect to see in the output from the various tests of apctest:
Test 1 normal: RTS not set Test 2 no serial cable: not important Test 3 no AC power: RNG Test 4 batteries exhausted: RNG and CDNote: RTS should never be set in any of the tests as it is the killpower signal. What is important is the appearance of RNG when the power fails and additionally CD when the batteries are low.
Shutdown apcupsd if it is running.
Make sure your /etc/apcupsd/apcupsd.conf file
has UPSTYPE smart and UPSCABLE has one
of the smart cables that are supported.
Normally apctest will have been built but not
installed, so you must execute it from
the <bacula-source>/src directory.
You can explicitly build it on
Unix with:
cd <apcupsd-source-directory>
make apctest
./apctest
on Win32 systems, use:
make apctestwin32
./apctest
2003-07-07 11:19:21 apctest 3.10.6 (07 July 2003) redhat Checking configuration ... Attached to driver: apcsmart sharenet.type = DISABLE cable.type = CUSTOM_SMART You are using a SMART cable type, so I'm entering SMART test mode mode.type = SMART Setting up serial port ... Creating serial port lock file ... Hello, this is the apcupsd Cable Test program. This part of apctest is for testing Smart UPSes. Please select the function you want to perform. 1) Query the UPS for all known values 2) Perform a Battery Runtime Calibration 3) Abort Battery Calibration 4) Monitor Battery Calibration progress 5) Program EEPROM 6) Enter TTY mode communicating with UPS 7) Quit Select function number: 1
Item 1 will probe the UPS for all values known to apcupsd and present them in rather raw format. This output can be useful for providing technical support if you are having problems with your UPS.
Item 2 will perform a Battery Runtime Calibration. This test will only be performed if your battery is 100% charged. Running the test will cause the batteries to be discharged to approximately 30% of capacity. The exact number depends on the UPS model. In any case, apctest will abort the test if it detects that the battery charge is 20% or less.
The advantage of doing this test is that the UPS will be able to recalibrate the remaining runtime counter that it maintains in its firmware. As your batteries age, they tend to hold less of a charge, so the runtime calibration may not be accurate after several years.
We recommend that perform a Battery Calibration about once a year. You should not perform this calibration too often since discharging the batteries tends to shorten their lifespan.
Item 3 can be used to abort a Battery Calibration in progress, if you some how became disconnected.
Item 4 can be used to restart the monitoring of a Battery Calibration if you should some how become disconnected during the test.
Item 5 is used to program the EEPROM. Please see the EEPROM programming chapter of this manual for the details.
Item 6 will initiate a direct communication between your terminal and the UPS at which point, you can enter raw UPS commands. Please be aware that you should be careful what commands you enter because you can cause your UPS to suddenly shutdown, or you can modify the EEPROM in a way to disable your UPS. The details of the raw Smart mode UPS commands can be found in the UPS Programming Bible chapter of this manual.
Item 7 will terminate apctest.