Carsten Aulbert
2023-May-22 09:48 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Hi all, On 5/19/23 15:11, Greg Troxel wrote:> 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.I fully agree and thus this ought to be done in/near uspd IMHO. I glanced over the server/ directory and was not sure where even to begin hooking this in. Should this be directly in upsd (upsd.c) or rather in/near the driver level (driver/main.c)?> > Yes, this could be in upsmon, but that's not synthetic LB, it's > choosing to shutdown if battery is below X.Yeah, this should be independent and fully on the client side (and thus upsmon) where each client can choose how to react to a UPS on battery.> We should be clear on "critical" vs "LB" and clean up the language to > be consistent.For upsmon, I would stay with critical as this is already mentioned in upsmon(8) and I guess "LB" could stay for the server part as each user could decide whether she wants to rely on LB from the UPS itself or on the self-defined override.> 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.Same here, quite at a loss what is handled where on the server and always low on time due to other projects/tasks. Cheers and any pointers appreciated! Carsten -- 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/20230522/d77291d4/attachment.bin>
Greg Troxel
2023-May-22 11:12 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Carsten Aulbert <carsten.aulbert at aei.mpg.de> writes:> Hi all, > > On 5/19/23 15:11, Greg Troxel wrote: >> 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. > > I fully agree and thus this ought to be done in/near uspd IMHO. I > glanced over the server/ directory and was not sure where even to > begin hooking this in. Should this be directly in upsd (upsd.c) or > rather in/near the driver level (driver/main.c)?I think it belongs in upsd someplace, as what I want is a way to make LB appear based on a rule instead of (or in addition) to the LB reported by the device. The 50% vs 10% example captures the need for %-LB on devices that actually do report LB perfectly, and I think it's a desire many will have.>> Yes, this could be in upsmon, but that's not synthetic LB, it's >> choosing to shutdown if battery is below X. > > Yeah, this should be independent and fully on the client side (and > thus upsmon) where each client can choose how to react to a UPS on > battery.It could also make sense to make upsmon smarter, but if we are really talking about defining "this UPS's battery is now low", that's what LB is supposed to mean and we should make it work that way.>> We should be clear on "critical" vs "LB" and clean up the language to >> be consistent. > > For upsmon, I would stay with critical as this is already mentioned in > upsmon(8) and I guess "LB" could stay for the server part as each user > could decide whether she wants to rely on LB from the UPS itself or on > the self-defined override.I think the difference is: LB is a state reported by a UPS (perhaps synthetic in upsd) that says that the battery is nearing empty and remaining runtime is limited critical is an opinion by upsmon that the UPS has reached a state where it is prudent to do an immediate shutdown. Typically LB implies critical but it could be more complicated.>> 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. > > Same here, quite at a loss what is handled where on the server and > always low on time due to other projects/tasks. > > Cheers and any pointers appreciated!I would look where input from drivers is processed, and basically add if (battery% <= 50 && ! set?(LB)) { log that we are doing synthetic LB set!(LB) } to mix C and scheme :) Then of course make it configurable. But it probably is that easy to just make it hard-coded 50.
Reasonably Related 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?