Chris Adams
2008-Jun-13 19:11 UTC
[Nut-upsdev] Best Ferrups reporting uptime in minutes, not seconds
I had a power hiccup yesterday and a server connected to a Best Ferrups 18KVA shutdown. The problem is that the UPS is reporting remaining runtime in minutes but nut treats it as seconds (so nut thought it only had 46 seconds left). Simple patch: diff -urN nut-2.2.1-dist/drivers/bestfcom.c nut-2.2.1/drivers/bestfcom.c --- nut-2.2.1-dist/drivers/bestfcom.c 2008-06-13 14:04:07.000000000 -0500 +++ nut-2.2.1/drivers/bestfcom.c 2008-06-13 14:05:00.000000000 -0500 @@ -277,8 +277,8 @@ /* AC line frequency */ acfreq = ((double)bcd2i(&fstring[54], 4) / 100.0); - /* Runtime remaining */ - btimeleft = bcd2i(&fstring[58], 4); + /* Runtime remaining (UPS reports minutes) */ + btimeleft = bcd2i(&fstring[58], 4) * 60; if (fc.model != FDxxxx) { /* Iout. int times 10 */ -- Chris Adams <cmadams at hiwaay.net> Systems and Network Administrator - HiWAAY Internet Services I don't speak for anybody but myself - that's enough trouble.
Charles Lepple
2008-Jun-13 19:28 UTC
[Nut-upsdev] Best Ferrups reporting uptime in minutes, not seconds
On Fri, Jun 13, 2008 at 3:11 PM, Chris Adams <cmadams at hiwaay.net> wrote:> I had a power hiccup yesterday and a server connected to a Best Ferrups > 18KVA shutdown. The problem is that the UPS is reporting remaining > runtime in minutes but nut treats it as seconds (so nut thought it only > had 46 seconds left).The patch looks good at first glance, but by default, NUT should not use the runtime estimate to initiate a shutdown. Are you using upssched? Any special parameters to the driver? Otherwise, NUT will shut down when the UPS signals LB (low battery), which is a unit-less boolean value. -- - Charles Lepple
Charles Lepple
2008-Jun-19 02:40 UTC
[Nut-upsdev] Best Ferrups reporting uptime in minutes, not seconds
On Fri, Jun 13, 2008 at 3:11 PM, Chris Adams <cmadams at hiwaay.net> wrote:> I had a power hiccup yesterday and a server connected to a Best Ferrups > 18KVA shutdown. The problem is that the UPS is reporting remaining > runtime in minutes but nut treats it as seconds (so nut thought it only > had 46 seconds left). > > Simple patch:Committed to the trunk as r1498. -- - Charles Lepple