<div dir="ltr"><div>Cheers all,</div><div><br></div><div>  I feel a bit late to the party, so would respond to some points from different mails:</div><div><br></div><div>* Indeed, such an early shutdown is not too healthy. Debug-logging in daemons would expose more about how/when/why it decided to go down, e.g. if the UPS raised the "OB+LB" flags practically simultaneously (because battery is old, or assumed weak based on some calibration info, etc.) and the NUT driver forwarded it to the data server (upsd), and the monitoring client (upsmon) decided to raise the FSD flag and scuttle the ship. Other alternatives may involve upssched as upsmon's NOTIFYCMD and a timer setup there to "go down if we are on battery longer than X", which is a custom but not too uncommon way of setting up NUT.</div><div>See <a href="https://github.com/networkupstools/nut/wiki/Changing-NUT-daemon-debug-verbosity">https://github.com/networkupstools/nut/wiki/Changing-NUT-daemon-debug-verbosity</a> for some ideas about bumping debug verbosity with modern NUT versions without changing init/systemd scripts etc.</div><div></div><div>
<div><br></div><div>* >
<span class="gmail-im">> I would look in the logs and see if you can find that nut logged something about "low battery" or "forced shutdown".<br>> </span>Well, that's what I'm asking. Where do I find these logs. I poked around with journalctl, and found just startup and shutdown messages.<span class="gmail-im"><br></span>

</div><div><br></div><div>It depends :)  For a wholesale picture of everything happening on your system in more or less timely order, go as root to run `journalctl -xl`.</div><div>For individual NUT-related units, probably use `systemctl -a | egrep -i 'nut|ups'` to see what is relevant on your system, and `journalctl -lu unitname` to check its logs specifically. You would probably be after `nut-driver@nutdev1.service`, `nut-server` and `nut-monitor` units.</div>

<br></div><div>* > 
write a script that does (this is pseudocode ...)</div><div>For logging of different data points (e.g. ups.status, battery.charge) over time, consider <a href="https://networkupstools.org/docs/man/upslog.html">https://networkupstools.org/docs/man/upslog.html</a> - in recent releases it also has a systemd service based on <a href="https://github.com/networkupstools/nut/blob/master/scripts/systemd/nut-logger.service.in">https://github.com/networkupstools/nut/blob/master/scripts/systemd/nut-logger.service.in</a> that you can configure with UPSLOG_ARGS saved in a file. It should `fflush()` after every write, so hopefully most of the info up to power loss would be saved.</div><div><br></div><div>*  > <span class="gmail-im">> driver.flag.allow_killpower: 0<br>> </span>This seems off; the OS should be able to stop the inverter.<span class="gmail-im"><br></span>

</div><div><br></div><div>Not quite, this flag is a failsafe to not allow a running driver daemon to call INSTCMD's that kill power by default - normally during shutdowns, services die and later a separate driver instance starts with `-k` option just to tell the UPS to kill power. This flag allows one to flip the safety switch and try to do this (via socket protocol) on a running system. Not really tested much though, but opens ways to different administration approaches than was possible in preceding years.</div><div><br></div><div>* Re: Older NUT: custom-building a drop-in replacement for whatever is installed should be more or less streamlined nowadays, see <a href="https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests">https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests</a></div><div><br></div><div>Hope this helps,</div><div>Jim Klimov</div><div><br></div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, Oct 4, 2025 at 2:20 PM Sam Varshavchik <<a href="mailto:mrsam@courier-mta.com">mrsam@courier-mta.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I lost power for about 40 seconds. From what I can see NUT quickly shut down  <br>
the system and boot it back up when power was restored. That also worked.  <br>
Everything worked as designed, except I would expect such a brief shutdown  <br>
to be survivable.<br>
<br>
The only question mark in my mind is that the battery should've been enough  <br>
to last those measly 40 seconds. Output of upsc is below. This is about an  <br>
hour after the power was restored, and I see that battery.charge is only 29,  <br>
and it is slowly increasing.<br>
<br>
So, I think is that my batteries are due for a replacement. I would've  <br>
wanted to see what was logged during the outage, but I can't find anything  <br>
in journalctl for nut-monitor or nut-server. This is Ubuntu 24. Should there  <br>
be something logged, somewhere?<br>
<br>
battery.charge: 29<br>
battery.charge.low: 10<br>
battery.charge.warning: 20<br>
battery.mfr.date: CPS<br>
battery.runtime: 2939<br>
battery.runtime.low: 300<br>
battery.type: PbAcid<br>
battery.voltage: 27.3<br>
battery.voltage.nominal: 24<br>
device.mfr: CPS<br>
device.model: CP1500AVRLCDa<br>
device.serial: BHQLW7002402<br>
device.type: ups<br>
driver.debug: 0<br>
driver.flag.allow_killpower: 0<br>
<a href="http://driver.name" rel="noreferrer" target="_blank">driver.name</a>: usbhid-ups<br>
driver.parameter.pollfreq: 30<br>
driver.parameter.pollinterval: 10<br>
driver.parameter.port: auto<br>
driver.parameter.synchronous: auto<br>
driver.state: quiet<br>
driver.version: 2.8.1<br>
driver.version.data: CyberPower HID 0.8<br>
driver.version.internal: 0.52<br>
driver.version.usb: libusb-1.0.27 (API: 0x100010a)<br>
input.voltage: 120.0<br>
input.voltage.nominal: 120<br>
output.voltage: 120.0<br>
ups.beeper.status: enabled<br>
ups.delay.shutdown: 20<br>
ups.delay.start: 30<br>
ups.load: 6<br>
ups.mfr: CPS<br>
ups.model: CP1500AVRLCDa<br>
ups.productid: 0501<br>
ups.realpower.nominal: 900<br>
ups.serial: BHQLW7002402<br>
ups.status: OL CHRG<br>
ups.test.result: No test initiated<br>
ups.timer.shutdown: -60<br>
ups.timer.start: -60<br>
ups.vendorid: 0764<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>