[Nut-upsuser] [Nut-upsdev] Setting up charge/voltage based shutdowns

Greg Troxel gdt at lexort.com
Mon Aug 7 14:18:21 BST 2023


Jim Klimov via Nut-upsdev <nut-upsdev at alioth-lists.debian.net> writes:

>   While looking at https://github.com/networkupstools/nut/issues/2014
> I understood that I am not sure if currently NUT has a standard way of
> triggering a shutdown based on remaining charge or runtime, if a
> device/driver lacks a `battery.charge.low` setting but has readings
> for the values themselves.

I am unaware of such a facility, but I think we should have it, and it
should be integrated enough that people don't need to use upssched.

My sketch:

  Accept that "LB" is baked into nut pretty hard.  Redefine LB as
  "driver says that it's time to shutdown", which is not necessarily the
  same as "hardware says battery is almost empty".

  Allow some generic config, to say:

    should LB be triggered on hardware LB (default yes)
    trigger LB if battery% < X (default not)
    trigger LB if battery voltage < Y (default not)
    trigger LB if battery runtime < Z (default not)
    trigger LB if time on battery > W (default not)
  
  except that a driver can set defaults to trigger LB differently if it
  doesn't have a hardware LB indication.   Those defaults should be the
  traditional "maximize runtime".

  Admins that don't like this (and I don't like it either) should be
  able to easily configure a variable in upsd.conf to make things
  shutdown faster, for those that want more margin, or for those who
  think the point is to protect the equipment, not provide availability
  (the "if power is not back in 2 minutes, it's going to be longer than
  my runtime, so just shutdown" crowd -- and I'm very sympathetic to
  that use case).

  Or perhaps this involves renaming the flag passed around to be
  something other than LB, but it's basically "battery status is such
  that the sysadmin has said that in this condition, it's time to shut
  down".  But it does involve decoupling a hardware battery-is-critical
  indication from the nut-it's-time-to-shutdown LB flag.



More information about the Nut-upsuser mailing list