[Nut-upsuser] Can this be done with NUT? (ordered shutdown, revisited)

Dave Williams dave at opensourcesolutions.co.uk
Fri Nov 18 10:25:59 UTC 2016

Reference the repeater mode of the dummy-ups driver used in the way
described by Steffen there is a characteristic which needs to be defined
better.  I could not find any notes on what the driver does in terms of

If as a result of LB you issue a upsdrvctl shutdown from a secondary
server acting as a master for the repeated driver (which is pretending
to run out of battery early) you DONT want it forwarding this command
back to the real driver and turning that off.

I looked at the driver src and it fortunately appears to be safe - but
only because upsdrv_shutdown is not supported when called from the
init.d scripts during poweroff. If that was ever to change then the
result would depend on what was actually implemented.

I suspect there might be instcmds that might be risky to forward too
when the driver is used in this mode.  These are OK at present as
forwarding is marked as FIXME but there is an implication this will not
always be the case.

I am arranging a phased shutdown and currently have a topology with

Server conntected to real UPS:
MONITOR=realups at localhost 1 upsmon secret master

Server connected to repeated UPS:
MONITOR repeated at localhost 0 upsmon secret master
MONITOR realups at server 1 upsmon secret slave

Clients connect to either the primary or secondary server as netclients
as per their status (critical or not).

The 0 above in the MONITOR line is to provide protection for this
situation and fortunaely I want the secondary server to stay up until the
bitter end anyway. If that wasnt the case and I wanted to shut down this
server early then I would remove the second MONITOR line and have the
usual 1 setting. In that case the above concerns apply.

Is there any better way of arranging the configuration?

Incidentally as part of this project I have been developing a series of
python scripts that can be called to iterate over a VMWare ESXi/VCenter and
instigate a controlled shutdown of the VM's being manage and then shut
down the ESXi itself. This uses VMWare's SDK and avoids having to add
something to VMWare itself.

If this is of interest I am happy to publish it here once complete for
the convenience of other NUT users.

More information about the Nut-upsuser mailing list