UPS activities are not logged nor notified by TrueNAS Core

GLaDER

Dabbler
Joined
Dec 1, 2017
Messages
14
SYSTEM INFO
UPS:
APC Back-UPS Pro 650 VA
Motherboard: SuperMicro A2SDI-4C-HLN4F-O
OS: TrueNAS-12.0-U4
---
I recently bought a UPS and I have configured it using the web interface per the documentation instructions.

truenas_ups_settings.png


Using driver usbhid-ups$Back-UPS Pro USB, I can successfully run upsc ups@localhost and get status information from the UPS (see verbatim output in the spoiler below).

battery.charge: 67
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2020/10/21
battery.runtime: 1626
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
device.mfr: American Power Conversion
device.model: Back-UPS RS 650MI
device.serial: 4B2043P05318
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.2
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: 288
input.transfer.low: 176
input.voltage: 234.0
input.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 939.g3 .I
ups.firmware.aux: g3
ups.load: 12
ups.mfr: American Power Conversion
ups.mfr.date: 2020/10/21
ups.model: Back-UPS RS 650MI
ups.productid: 0002
ups.realpower.nominal: 390
ups.serial: 4B2043P05318
ups.status: OL CHRG
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

In order to verify the functionality of the UPS, I double checked that I did not have any critical operations running on the server; then I pulled the plug on the UPS. The UPS started beeping (as expected) and went into battery mode. The server remained on and I was still able to reach it.

I then checked my email - nothing.
I checked ups.log - nothing.
I checked messages - nothing.

I went to plug the cord back into the UPS, at which time the server did turn off. It is not clear to me whether the server shutdown when I plugged the UPS back in or if the shutdown occurred about the same time. According to my configuration, the /sbin/shutdown -p now command should be issued -- by the UPS service -- if the server has been running of UPS Battery for 10 minutes; but I was not close to this time limit. All in all, the server was running of the UPS battery for maybe a minute or two.

After a couple of seconds the server booted again (UPS now plugged in). I got an email from the System-email, notifying me about an unscheduled system reboot, but no info from the UPS Service.

QUESTIONS
  1. Does anyone have any idea why the email status updates does not seem to work? I'm not sure how they are intended to work, but I would expect at least one email when the UPS kicks in and start providing the server with battery power; and then another email once the UPS can feed "wall power" to the server again.

  2. Any ideas why the server decided to shut down during the test?

  3. If the UPS issued the shutdown command, should I still expect to get the unscheduled reboot email?
 

GLaDER

Dabbler
Joined
Dec 1, 2017
Messages
14
UPDATE
I had a super minor power outage yesterday and did indeed receive an email.
New alerts:
* UPS ups is on battery power.

and soon thereafter
The following alert has been cleared:
* UPS ups is on battery power.

I still don't understand why I did not receive such an alert when I tried the UPS manually.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Not sure if you changed anything there, but under System | Alert Settings, you will find these in the bottom section:
1627554147194.png


If System | Alert Services isn't set up properly for email, maybe that's it?
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
  1. Any ideas why the server decided to shut down during the test?

  2. If the UPS issued the shutdown command, should I still expect to get the unscheduled reboot email?

It sounds as though the UPS produced a power glitch on plugging the power back on that your server power supply didn't like. It is a shame that TrueNAS does not appear to log the shutdown process anywhere. And, perhaps, you did not get the email about battery power because it got lost during the power loss reboot.
I'd repeat the test of briefly unplugging the UPS and if the server reboots again I'd conclude that your server needs a more expensive UPS with a permanently running inverter. The UPS makers have a catchy name for them, which I forget.
 
Top