keboose
Explorer
- Joined
- Mar 5, 2016
- Messages
- 92
My system is running on an APC Back-UPS RS1300 LCD battery backup. It's not the newest piece of hardware, but I can still connect via USB, and I have the UPS service set up to shut down the server if the battery-remaining time falls below 2 minutes.
The problem is that I recently had to replace the batteries, because one failed. It straight up would not hold a charge, and that was when I realized that the UPS doesn't seem to perform automatic self tests aside from initial power-on. At the least, there is no indication that a test has been run by polling the UPS via the shell. Looking through the manual on the APC site only describes how to manually initiate a self-test via the front panel, but I want to do that automatically.
Before I go and put the work in, I just want to make sure: is there already a way to check the battery status of the UPS that is baked into the service? If not, I would have to set up a cron job to do it for me.
Below is all the status flags I can pull from the UPS. There are no variables for test interval or date of last passed test like many other UPS's.
If there is no functionality in the system already, this would be my plan of attack.
First, I would initiate a test by running the command:
and then continually poll the ups with the command:
Looking for a result "Done and passed". A slight hangup is that the test result variable resets to "No test initiated" after a few minutes, which explains why I can't tell if this thing actually does automatic tests. At any rate, I would have this script run every few days and email me if the test result differs from either "Done and passed" or "no test initiated". I would probably also want to run the "test.battery.start.deep" test every month or so, as well.
So am I crazy, and there is already something in the UPS service that does this? Or does this sound like a good idea?
The problem is that I recently had to replace the batteries, because one failed. It straight up would not hold a charge, and that was when I realized that the UPS doesn't seem to perform automatic self tests aside from initial power-on. At the least, there is no indication that a test has been run by polling the UPS via the shell. Looking through the manual on the APC site only describes how to manually initiate a self-test via the front panel, but I want to do that automatically.
Before I go and put the work in, I just want to make sure: is there already a way to check the battery status of the UPS that is baked into the service? If not, I would have to set up a cron job to do it for me.
Below is all the status flags I can pull from the UPS. There are no variables for test interval or date of last passed test like many other UPS's.
Code:
battery.charge: 100 battery.charge.low: 10 battery.charge.warning: 50 battery.date: 2010/00/39 battery.mfr.date: 2008/08/10 battery.runtime: 4188 battery.runtime.low: 120 battery.type: PbAc battery.voltage: 26.7 battery.voltage.nominal: 24.0 device.mfr: American Power Conversion device.model: Back-UPS RS 1300 LCD device.serial: [redacted] device.type: ups driver.name: usbhid-ups driver.parameter.pollfreq: 30 driver.parameter.pollinterval: 2 driver.parameter.port: /dev/ugen0.3 driver.parameter.synchronous: no driver.version: 2.7.4 driver.version.data: APC HID 0.96 driver.version.internal: 0.41 input.sensitivity: medium input.transfer.high: 139 input.transfer.low: 88 input.transfer.reason: input voltage out of range input.voltage: 121.0 input.voltage.nominal: 120 ups.beeper.status: enabled ups.delay.shutdown: 20 ups.firmware: 838.H7 .D ups.firmware.aux: H7 ups.load: 9 ups.mfr: American Power Conversion ups.mfr.date: 2008/08/10 ups.model: Back-UPS RS 1300 LCD ups.productid: 0002 ups.realpower.nominal: 780 ups.serial: [redacted] ups.status: OL ups.test.result: No test initiated ups.timer.reboot: 0 ups.timer.shutdown: -1 ups.vendorid: 051d
If there is no functionality in the system already, this would be my plan of attack.
First, I would initiate a test by running the command:
Code:
upscmd upsnam@localhost test.battery.start.quick
and then continually poll the ups with the command:
Code:
upsc upsnam@localhost ups.test.result
Looking for a result "Done and passed". A slight hangup is that the test result variable resets to "No test initiated" after a few minutes, which explains why I can't tell if this thing actually does automatic tests. At any rate, I would have this script run every few days and email me if the test result differs from either "Done and passed" or "no test initiated". I would probably also want to run the "test.battery.start.deep" test every month or so, as well.
So am I crazy, and there is already something in the UPS service that does this? Or does this sound like a good idea?