Carsten Aulbert
2023-May-16 12:59 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
Hi, after ignoring this for too long (see [1]), I'm still struggling how to shut down servers fed by two independent UPS systems. Both are connected to NUT via the snmp-ups driver with mibs "huawei" and "netvision". However, I fear both do not feature the LB warning via ups.status. We can shut down all less important servers (conencted to a single UPS) via upssched and a 30s timer after OB, but I still struggle hard to arrive at a working schema how to shut down more important servers based on remaining battery charge/projected run time and/or low batt warning. Looking at clients/upsmon.c I think, without the flag ST_LOWBATT set for ups->status, MINSUPPLY will never truly be considered a usable threshold and thus I'm left with a machine which would not shutdown. Thus, what would e the best way forward here? * Try to patch the server to synthesize LB there? If so, any suggestion how to do this? * Try to patch upsmon.c's is_ups_critical method to also include extra criteria, e.g. remaining run time/battery charge? * Keep nut unpatched but use our own NOTIFYCMD or CMDSCRIPT to pull the values from the server and implement our logic there? * Another way, I've overlooked? Cheers and thanks a ton in advance for suggestions. Carsten [1] Message-ID: <f794644f-e3b8-3557-da63-bd19d88a7c03 at aei.mpg.de> from 2022-12-05 -- 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/20230516/fcfe4215/attachment.bin>
Roger Price
2023-May-16 15:00 UTC
[Nut-upsuser] Synthesize low batt (LB) fron SNMP UPS which does not support this?
On Tue, 16 May 2023, Carsten Aulbert wrote:> ... I'm still struggling how to shut down servers fed by two independent UPS > systems.> * Keep nut unpatched but use our own NOTIFYCMD or CMDSCRIPT to pull the values > from the server and implement our logic there?Hello Carsten, That's what I did but for a much simpler setup. I live in an area with a lot of lightning, and my shutdown criteria is to be able to shut down repeatedly during an electrical storm. The NOTIFY and CMDSCRIPT and the upssched-cmd logic are written up in detail in chapter 7 of https://rogerprice.org/NUT/ConfigExamples.A5.pdf . Chapter 8 contains a detailed description of a hypothetical installation fed by multiple UPSs. Roger