Monitoring a UPS with nut on Debian

This is geared toward Debian Jessie.

INSTALL:

sudo apt-get install nut

EDIT:

To /etc/nut/ups.conf add

   [belkin]  
    driver = usbhid-ups
    port = auto

A Belkin UPS is used connected via a USB cable. The label in brackets can be any unique identifier. It will be useful later. Some configurations call for ‘port’ to be /dev/ttyS0. This was tried but didn’t seem to just work so the USB option was used w/ the ‘port’ set to ‘auto’

Verify nut properly detects the UPS:

sudo upsdrvctl start

OUTPUT:

Network UPS Tools – UPS driver controller 2.7.4
Network UPS Tools – Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: Belkin/Liebert HID 0.17

EDIT:

To /etc/nut/upsd.users add:

     [local_mon]
      password = <a password unique to this process>
      allowfrom = localhost
      upsmon master

EDIT:

To sudo vim /etc/nut/upsmon.conf add:

MONITOR belkin@localhost 1 local_mon <a password unique to this process> master
POWERDOWNFLAG /etc/killpower
SHUTDOWNCMD "/sbin/shutdown -h now"

Change file permissions:

sudo chown root:nut /etc/nut/*
sudo chmod 640 /etc/nut/*

EDIT:

To sudo vim /etc/default/nut add:

START_UPSD=yes
START_UPSMON=yes

Start the nut client and server:

 sudo /etc/init.d/nut-client start
 [ ok ] Starting nut-client (via systemctl): nut-client.service.
 sudo /etc/init.d/nut-server start
 [ ok ] Starting nut-server (via systemctl): nut-server.service.

Test operation and fetch parameters:

upsc belkin

OUTPUT:

Init SSL without certificate database
battery.charge: 100
battery.charge.low: 30
battery.charge.warning: 30
battery.runtime: 120
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24
device.mfr: Belkin
device.model: Belkin UPS
device.serial:
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: Belkin/Liebert HID 0.17
driver.version.internal: 0.41
input.frequency: 59.9
input.frequency.nominal: 60
input.transfer.high: 140
input.transfer.high.max: 144
input.transfer.high.min: 140
input.transfer.low: 88
input.transfer.low.max: 88
input.transfer.low.min: 84
input.voltage: 119.2
input.voltage.nominal: 120
output.frequency: 59.9
output.voltage: 119.7
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 1
ups.load: 23
ups.mfr: Belkin
ups.model: Belkin UPS
ups.power.nominal: 1500
ups.productid: 0751
ups.serial:
ups.status: OL CHRG
ups.test.result: No test initiated
ups.timer.shutdown: 0
ups.timer.start: 0
ups.type: offline
ups.vendorid: 050d