[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?

Willcox David dwillcoxster at gmail.com
Mon May 22 03:44:37 BST 2023


Interesting. I’ve been thinking along what sounds like similar lines myself.

I have a very simple setup, one UPS that powers a NAS plus all of the boxes that provide Internet and WiFi to the house. The NAS is the largest power user, and the least critical. I have a RPI with NUT connected to the UPS’s USB and the NAS gets status from the RPI.

When the NAS sees LB it quiesces itself until the UPS reports OL, but the UPS doesn’t report LB until the battery is down to 10%. I want the NAS to quiesce at more like 50%.

So, I’d been thinking of adding a check in the server: When a client requests status and the UPS reports OB, the NUT server optionally check the battery level from UPS and returns LB if it’s below a configured threshold.

I’d started to look where to do that but got sidetracked by other tasks. If someone’s already considering this I’d love to see what the plan is.

Pull request someone?

In other news, I was surprised to find that the NUT build (maybe not the actual build, but maintenance?) uses a tool that I wrote in 1976. Many fingers have touched it since then, but the core logic is still there.


> On May 19, 2023, at 8:11 AM, Greg Troxel <gdt at lexort.com> wrote:
> 
> My $0.02:
> 
> LB is baked in to nut behavior.   So if a UPS doesn't report LB, then
> it makes sense to synthesize it.  Synthetic LB is the cleanest fix at
> the earlier processing point.
> 
> One could have a config that is basically
>   synthetic-lowbatt-percent
> that generates LB if (as Jim says) on battery, not calibrating, and
> batt% <= that.
> 
> One could have a similar config
>   synthetic-lowbatt-voltage
> same thing except voltage.   The mapping from voltage and current (and
> history) to % is difficult, but this lets people have another option
> and is easy to implement.
> 
> I think it makes sense to allow this even when the UPS will report LB.
> I want to shut down earlier than max runtime to be nicer to the
> battery.  Once the outage is over an hour it's usually 4, for me.
> 
> It might make sense to also be able to ignore UPS-provided LB via
>   ignore-hardware-lb: true
> but probably there is little need as most UPS units seem to throw LB
> later than wanted vs early.  But again easy.
> 
> Yes, this could be in upsmon, but that's not synthetic LB, it's
> choosing to shutdown if battery is below X.
> 
> We should be clear on "critical" vs "LB" and clean up the language to
> be consistent.
> 
> Beware that I'm a bit fuzzy on details beyond my comments and even
> some on things I commented on, so take them as such.
> 
> 
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser




More information about the Nut-upsuser mailing list