I have a battery backup (UPS) for my OpenBSD-6.4 server.
$ sysctl -a | grep hw.sensors.upd
Code:
hw.sensors.upd0.indicator0=On (BatteryPresent), OK
hw.sensors.upd0.indicator1=Off (Charging), OK
hw.sensors.upd0.indicator2=Off (Discharging), OK
hw.sensors.upd0.indicator3=Off (NeedReplacement), OK
hw.sensors.upd0.indicator4=Off (ShutdownImminent), OK
hw.sensors.upd0.indicator5=On (ACPresent), OK
hw.sensors.upd0.indicator6=Off (Overload), OK
hw.sensors.upd0.percent0=100.00% (RemainingCapacity), OK
hw.sensors.upd0.percent1=100.00% (FullChargeCapacity), OK
hw.sensors.upd0.timedelta0=2613.000000 secs (RunTimeToEmpty), OK
sensorsd(8) looks like it might be a lean alternative to
sysutils/apcupsd but I don't really understand the
sensorsd.conf(5) man page well enough to configure the thing. The first experiment didn't go well.
/etc/sensorsd.conf
Code:
hw.sensors.upd0.percent0:low=60%:command=/root/bin/poweroff
/root/bin/poweroff
Code:
#!/bin/sh
ssh hanzer@minerva sudo halt -p
halt -p
minerva is small, low-power FreeBSD machine that is also currently connected to the battery.
This setup results in both machines powering down almost immediately after
sensorsd starts.
Any ideas on how to proceed or any experiments that might shed some light on how this thing works?