TrojanC

Development and Guides

Linux

Guide: Network UPS Tools commands

In this guide we’ll look at some of the commands you can use when you have a NUT server configured. If you do not have the server configured yet, have a look at these guides

This guide assumes your UPS name is “mecer” and that you are running the commands from a master node (hence using 127.0.0.1)

Useful Commands

The following command you can use to view the status of your ups

Keep in mind that depending on the server you are on, you will either use 127.0.0.1 if you are on the master or the IP of the server if you are on the slave

View UPS Variables

If you have a master slave setup, running these commands from your slave will also confirm that your slave is able to talk to the master

upsc mecer@127.0.0.1
battery.charge: 100
battery.voltage: 81.72
battery.voltage.high: 78.00
battery.voltage.low: 62.40
battery.voltage.nominal: 72.0
device.mfr:
device.model: WPHVT3K0
device.type: ups
driver.name: blazer_usb
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.productid: 5161
driver.parameter.vendorid: 0665
driver.version: 2.7.2
driver.version.internal: 0.11
input.current.nominal: 13.0
input.frequency: 50.0
input.frequency.nominal: 50
input.voltage: 241.3
input.voltage.fault: 241.6
input.voltage.nominal: 230
output.voltage: 229.6
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware: 01832.00
ups.load: 8
ups.mfr:
ups.model: WPHVT3K0
ups.productid: 5161
ups.status: OL
ups.temperature: 19.1
ups.type: online
ups.vendorid: 0665

View available UPS commands

https://networkupstools.org/docs/man/upscmd.html

Your UPS might support commands that might be sent to it, example turning off the beeper, starting a battery test,  turning off the output, etc. Run the following command to see what commands your ups supports

upscmd -l mecer@127.0.0.1
Instant commands supported on UPS [mecer]:

beeper.toggle - Toggle the UPS beeper
load.off - Turn off the load immediately
load.on - Turn on the load immediately
shutdown.return - Turn off the load and return when power is back
shutdown.stayoff - Turn off the load and remain off
shutdown.stop - Stop a shutdown in progress
test.battery.start - Start a battery test
test.battery.start.deep - Start a deep battery test
test.battery.start.quick - Start a quick battery test
test.battery.stop - Stop the battery test

Execute command on UPS

Now that you know what commands are available for your UPS (section above), you can execute them using upscmd command

upscmd -u local_mon -p secretpass mecer test.battery.start

Check NUT client service status

sudo systemctl status nut-client.service

It should print that it’s active state is active (running)

If you see any errors, you can use that for your google search.

Check NUT monitor service status

sudo systemctl status nut-monitor.service

It should print that it’s active state is active (running)

If you see any errors, you can use that for your google search.

Check NUT driver service status

sudo systemctl status nut-driver.service

It should print that it’s active state is active (running)

If you see any errors, you can use that for your google search.

Check NUT server service status

sudo systemctl status nut-server.service

It should print that it’s active state is active (running)

If you see any errors, you can use that for your google search.

References

One thought on “Guide: Network UPS Tools commands

Leave a Reply

Your email address will not be published. Required fields are marked *