[Nut-upsuser] Some questions

Arjen de Korte nut+users at de-korte.org
Fri Feb 8 13:51:07 UTC 2008


>> Usually drivers attempt to determine if a command is valid, before
>> registering it.
> So, there is a big set of NUT commands, like shutdown.stayoff and others,
> and driver for specific device supports some subset of them and this
> subset i can see in 'upsmcd -l output' ?

Yes. See 'data/cmdvartab' and/or 'docs/new-names.txt' to get an idea what
kind of variables and commands NUT uses.

>> This command doesn't exist, at least not in the trunk. Could it be you
>> made a typo?
> yes, i made a typo. This was 'shutdown.reboot'.

This reboots the UPS.

>>>I'm not sure what you're trying to do here. Please explain.
> I wan to reset computer, connected to UPS. I want to make in such way
> that i will be sure it was rebooted.

Are the driver (and server) of this UPS fed by it?

YES: issue 'upsmon -c fsd' in a console (as root). You can monitor the
state of the UPS from another system by an appropriate MONITOR line. See
'man 5 upsmon.conf'. This is much nicer on your system, since it will
cleanly shutdown, instead of just interrupting power.

NO : switch off the load of the UPS by sending it a "load.off" command. If
you're using the usbhid-ups driver you can then query for the
"output.voltage". If it is zero, the output is switched off. After sending
a "load.on" command, it will be restored once again.

> i send 'shutdown.reboot' command to UPS. After this
> i start to query ups.status. I expect:
> OL...OL...error...error....OL...OL
> where error means i can`t get status and OL - any valid status of UPS.
> What i want? I want to be sure that UPS rebooted (and so rebooted
> connected computer - this is the primary goal)

It depends on the above. Most USB connected UPS'es will still respond to
queries if they are switched off and/or are in the process of rebooting,
so the above may not work for you if the UPS is controlled from another
system. The connection will never be lost.

> But it looks like UPS reboots fast enough and timeouts in driver are
> such, that i`m loosing
> those 'error...error' time interval.

Euhm, no. The connection isn't lost. The only thing that cuts the
connection from an USB connected UPS, is pulling the USB cable. This will
result in a data stale warning within seconds.

> I just see OL...OL...OL. And can`t be sure that UPS did something.

This is something that is still on my todo list. Ie, the upsd (server)
should echo back the command it receives and add a result code. This will
probably be part of nut-2.4.0, since I have other priorities now.

> As i understand, there is no way to get response from UPS like 'i
> completed your given command OK, i really DID what you say'.
> When upscmd return 0 to the shell it means only that command was
> successfully send to UPS.
> Am i right?

Yes. It means that a connection to the server could be established,
nothing more. Even if the server has no idea what to do with the command.
See above, this will be fixed in future versions.

Regards, Arjen

PS  Please keep traffic on the mailinglist. I won't respond to off-list
messages, unless a consultancy fee is involved.




More information about the Nut-upsuser mailing list