Hello all NUT users and developers! Have some questions about nut suite: 1. Does upscmd provide only device-specific commands? Or commands like shutdown.stayoff are general and good for all ups models? When i see output of 'upscmd -l' - is this general commands that supported by given device or this is unique commands of this device? For example, i have APC SmartUPS-750 and it shows me that it have command shutdown.stayoff. Is this APC command or NUT one? 2. Same question about UPS properties shown by upsc 3. Question about ACP SmartUPS-750: what does shutdown.reset command does? resets UPS itself? resets power? something else? I need to reset device, connected to ups - is this possible? I tried to reset computer, connected to UPS with this command and it seem to work, but i have another problem here: ups.status which i get from upsc(usb driver) always returns me OK. There is a timeout, which is big enough and UPS is fast enough to reboot during this timeout. So i push command to UPS from script, wait for fail status(ups is off or reset) and this event never happens. Is it possible to control timeout someway? I wanted to use this UPS as a STONITH device, but in this case it does not have required 'reset' action. 4. I was able to test 2 APC UPSes and found that they are slowly responding to commands: one of them needs about 100 seconds to turn off. At first i thought that upsc just didn`t work. Other is faster - about 25 seconds to respond. Do have any information about mean times to respond for such UPSes? Is this UPS itself problem or maybe my USB connection/PC problems? P.S. I used NUT 2.2.1 in all my tests and Debian 4.0. Thank you!
> 1. Does upscmd provide only device-specific commands?Usually, yes. See also 'man 8 upscmd'.> Or commands > like shutdown.stayoff are general and good for all ups models?No.> When i see output of 'upscmd -l' - is this general commands > that supported by given device or this is unique commands of this device?Usually drivers attempt to determine if a command is valid, before registering it.> For example, i have APC SmartUPS-750 and it shows me that it have > command shutdown.stayoff. > Is this APC command or NUT one?This is a NUT command.> 2. Same question about UPS properties shown by upscSee 'man 8 upsc'.> 3. Question about ACP SmartUPS-750: what does shutdown.reset command does? > resets UPS itself? resets power? something else? > I need to reset device, connected to ups - is this possible?This command doesn't exist, at least not in the trunk. Could it be you made a typo?> I tried to reset computer, connected to UPS with this command > and it seem to work, but i have another problem here: ups.status > which i get from upsc(usb driver) always returns me OK.OK is not a valid status, so upsc should never report this.> There > is a timeout, which is big enough and UPS is fast enough to reboot during > this timeout. So i push command to UPS from script, wait for fail > status(ups is off or reset) > and this event never happens. Is it possible to control timeout someway? > I wanted to use this UPS as a STONITH device, but in this case it does not > have required 'reset' action.I'm not sure what you're trying to do here. Please explain. Chances are, that calling 'upsmon -c fsd' is what you need (if you want to reboot the UPS).> 4. I was able to test 2 APC UPSes and found that they are slowly > responding to commands: one of them needs about 100 seconds to turn off. > At first i thought that upsc just didn`t work. Other is faster - about > 25 seconds to respond.The timers in UPS'es are notoriously unreliable. There may be nothing we can do about this.> Do have any information about mean times to respond for such UPSes?No. This depends on the UPS. You'd have to ask the manufacturer for this.> Is this UPS itself problem or maybe my USB connection/PC problems?Most probably, the UPS. Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
>> 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.