[Nut-upsdev] REGRESSION: New "megatec" driver does't work for UPS that was managed by old fentonups driver

Michel Bouissou michel-nut at bouissou.net
Tue May 20 09:16:35 UTC 2008


Hi Arjen,

Arjen de Korte a écrit :
> 
> It may appear to be working for you, but only now. As soon as load,
> temperature and/or battery age (!) change, the calculation will be off
> (and more often than not by a landslide). The only way to accurately
> measure the amount of charge in battery [...]

I get the point, but actually don't care about measuring anything
"accurately" but I'm interested in measuring something "roughly" (even
"very roughly"). Let me explain :

- Not everybody uses nut for "big" smart UPSes with several machines
behind them.

- In my case, I use nut for a small UPS powering a single server, which
has about 3-4 minutes on-battery duration maximum. This is far enough
for the 2 only goals that I assign to this UPS :

- Allow server to keep living over a very short power failure (let's
say, less than 10 seconds, and most of the times less than 2 seconds,
which represents more than 95% of the power failures that I have
observed in the big city where I live over the 10 past years). Most of
the times I notice a power failure only because I hear the UPS "CLAC...
CLAC !" and often the room lights barely flash off, but experience tells
that the server *would* crash without an UPS...

- Allow server to shutdown properly for any lasting power failure that
would last longer than the UPS battery. For this, I only basically need
a battery duration that is somewhat longer than the time it takes for
the server to shutdown properly.

For those reasons, I went for a low-cost, small UPS - but clever enough
to report something.

Unfortunately, my UPS (as many low-cost ones, I'm sure I'm not the only
one) is only able to report AC voltage, battery voltage and "low bat"
condition.

Unfortunately again, when the UPS says "low bat", it doesn't give a
remaining time sufficient to shutdown the server. The UPS will cut load
long before the server got time to shutdown.

So I have to find a way to shutdown the system *before* the UPS says
"low bat", or the server will be powerkilled while shutting down - which
is even worse than losing power while on more or less idle normal operation.

This leaves little choice :

- Either start the shutdown sequence as soon as the UPS notifies AC
power loss - which is stupid because it would shut my server down when
unnecessary, let's says 50 of the times (very short power losses have
good chances to remain unnoticed between 2 nut UPS polls... but can also
be accidentally seen and trigger shutdown)

- Or find some way to approximate the remaining battery charge, and for
this I don't really care if I can't really tell between "25%" and "40%",
the only really relevant information is "OK, now the battery has been
drained low enough so we should shutdown anyway while we still have
enough time to".

For this reason I had patched the "fentonups" driver to add the
"lowbattvolt" trigger : Be able not to shutdown when unnecessary, and
shutdown when necessary while still possible.

Of course at work for 19" server racks we use big clever UPSes with
extensive reporting capabilities and settable "low bat" condition
trigger, and the situation is totally different - and those don't use
the "megatec" nor "fenton" drivers anyway.

But not all UPSes are big clever ones, so nut has to be able to manage
smartly "dumber, cheaper" models otherwise it's useless for these.

I use nut at home only because it allowed me to properly manage my small
UPS and get "proper clean shutdown when needed". But it if becomes
unable to do this, I will simply quit using it and choose to use the UPS
without supervision, and think that it will protect my machine for all
AC losses shorter than a couple minutes and kill power to a living
server let's say once every 5 years (in my city environment) which I can
probably live with and is better than losing power in the middle of a
shutdown process with a lot of databases closing and disks writes and
syncs going on...

That's why I don't give a damn about "accurate calculation" but
definitely need "rough estimation" no matter how rough it is... Of
course if we can have "precise estimations" for UPSes that can give it,
it's perfect, but when impossible rough estimations is much better than
nothing at all...

And I suggested "2 scale voltages" because I both need to get a rough
estimate when on battery and a rough estimate when on AC - because we
all love nice graphs in the nut CGI interface (or in cacti as I also
interface upsc with cacti to get a graphics record of the UPS status
over time) ;-)

Kind regards.

Michel.



More information about the Nut-upsdev mailing list