Jim Klimov
2023-May-17 18:02 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Makes sense, and a PR is a way to solicit feedback :) I'd document this for ups.conf (man page and examples), including a note that for devices which do provide a healthy LB these values may be set to 0 safely. Wondering if non-zero defaults should be there anyway. @Community, WDYT? Also, this critical-state check should be done only when the UPS is on battery (and perhaps not calibrating), to avoid shutdowns as soon as we start after an outage :) (In a similar fashion, enterprise UPSes are known to raise an FSD to their subscribers, if manually powered on before criticality thresholds are cleared, since they can't guarantee a safe shutdown to keep data intact, if wall power gets lost again). Thanks, Jim On Wed, May 17, 2023, 10:50 Carsten Aulbert <carsten.aulbert at aei.mpg.de> wrote:> Hi all, > > On 5/16/23 20:08, Carsten Aulbert wrote: > > Idly browsing the client sources, I guess I could try to add our logic > > here[1] and use [2] to gather the battery stats from our UPS and then > > decide if this UPS is considered critical or not. But for this, I would > > need to dust off/excavate my ancient poor C knowledge ;-). > > > > I guess I will give this a try unless someone has a brilliant idea and > > could save my sanity. > > I've given it a try now and would like to get some feedback whether this > is something worth considering as a PR or if this is too niche for master: > > > https://github.com/networkupstools/nut/compare/master...carsten-AEI:nut:upsmon_low_bat_enhancement?expand=1 > > Cheers > > Carsten > > -- > Dr. Carsten Aulbert, Max Planck Institute for Gravitational Physics, > Callinstra?e 38, 30167 Hannover, Germany, Phone +49 511 762 17185 > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20230517/dedd4539/attachment.htm>
Carsten Aulbert
2023-May-19 04:57 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Hi Jim, (sorry for the late reply, public holiday here yesterday, day mostly off today), On 5/17/23 20:02, Jim Klimov wrote:> Makes sense, and a PR is a way to solicit feedback :)then, I will try to materialize that one next week and hopefully does not butcher the wanted style.> > I'd document this for ups.conf (man page and examples), including a note > that for devices which do provide a healthy LB these values may be set > to 0 safely. Wondering if non-zero defaults should be there anyway. > @Community, WDYT?At the moment I'm aiming for the clients, i.e. upsmon.conf. That way, each client class could be configured to react to different "critical" levels. But OTOH I would understand having this feature (also?) in the server to mitigate UPSes without LB. And yeah, defaults should be 0 to never trigger unless set by users.> > Also, this critical-state check should be done only when the UPS is on > battery (and perhaps not calibrating), to avoid shutdowns as soon as we > start after an outage :)I do fully agree. For upsmon.conf, shall this be something settable per UPS, e.g. something like this? UPS_CRITICAL_CHARGE 34 ups1 at localhost UPS_CRITICAL_RUNTIME 200 ups2 at remote What to you think? Cheers Carsten PS: I've never looked into the ups.conf/server code as for me the "natural" place to address my current problem was on the client side as we only wanted to have this for special clients and MINSUPPLIES was defined there. Shall I still look at the server part as well? -- Dr. Carsten Aulbert, Max Planck Institute for Gravitational Physics, Callinstra?e 38, 30167 Hannover, Germany, Phone +49 511 762 17185 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4827 bytes Desc: S/MIME Cryptographic Signature URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20230519/3ce133dc/attachment.bin>
Greg Troxel
2023-May-19 13:11 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
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.
Apparently Analagous Threads
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?
- Synthesize low batt (LB) fron SNMP UPS which does not support this?