Good morning,
[email protected] (Peter Fraser), 2022.11.13 (Sun) 19:56 (CET):
> My old UPS dies, it was very old I had been changing batteries on it
> for years. It was so old that it used a serial port for
> communications.
>
> I replace it with a new CyberPower cp1500PPFCLCD.
>
> I connected the USB cable and OpenBSD found
>
[...]
>
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.indicator0: Off, UNKNOWN
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.indicator1: Off, UNKNOWN
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.indicator2: On, UNKNOWN
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.indicator3: Off, UNKNOWN
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.percent0: 100.00%, UNKNOWN
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.percent0: marked invalid
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.percent1: 100.00%, UNKNOWN
> Nov 13 13:21:58 fw sensorsd[42763]: upd0.timedelta0: 11425.000000 secs,
> UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.indicator0: Off, UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.indicator1: Off, UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.indicator2: On, UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.indicator3: Off, UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.percent0: 100.00%, UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.percent0: marked invalid
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.percent1: 100.00%, UNKNOWN
> Nov 13 13:23:38 fw sensorsd[20386]: upd0.timedelta0: 11425.000000 secs,
> UNKNOWN
>
> My sensorsd.conf contains
>
> hw.sensors.upd0.percent0:low=99.00%:command=/etc/ups-shutdown %2
>
> The 99.00% was to allow me to test it easily
>
> As far as I could tell there is no way to ask sensorsd to only run a
> program when the UPS is not charging and the % left is less than a
> value.
>
> At this point one of two things happened. Either then upd0 values
> disappear from sysctl or the system dies with no messages, and I have
> to do a hard reset.
>
> Does anyone have any ideas of what is going on and how to fix it.
I have one of these CyberPower USV, it works for years already.
Unfortunately it's connected to a windows server where it shows up
as a laptop battery.
What I do with sensorsd(8) on OpenBSD for the upd(4) USVs:
$ cat /etc/sensorsd.conf
hw.sensors.upd0.percent0:low=80:high=100:command=/etc/sensorsd.upd.sh \
%l %n %s %x %t %2 %3 %4
$ cat /etc/sensorsd.upd.sh
#!/bin/sh -e
[[ X"${1}" == X"below" && $(sysctl -n hw.sensors.upd0.indicator5) != \
"On (ACPresent), OK" ]] && shutdown -hp +1
There were long threads on sensorsd(8) in the past.
Marcus