Sources
- http://techbotch.org/blog/ups-setup/index.html
- https://raspberrypi.stackexchange.com/questions/66611/nut-cyberpower-data-stale
How to manage an EATON UPS via USB on Linux
# lsusb
...
Bus 001 Device 004: ID 0463:ffff MGE UPS Systems UPS
...
apt install nut
Define Eaton USV with a poll frequency of 15.
Change the vendorid based on lsusb
.
vim /etc/nut/ups.conf
...
[Eaton]
driver = usbhid-ups
port = auto
vendorid = 0463
pollfreq = 15
Standalone mode: This mode address a local only configuration, with 1 UPS protecting the local system. This implies to start the 3 NUT layers (driver, upsd and upsmon) and the matching configuration files. This mode can also address UPS redundancy.
vim /etc/nut/nut.conf
...
MODE=standalone
systemctl restart udev
chown nut /etc/nut/*
upsdrvctl start
# upsc -l
Init SSL without certificate database
Eaton
upsc Eaton
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 20
battery.runtime: 4800
battery.type: PbAc
device.mfr: EATON
device.model: Eaton 3S 700
device.serial: Blank
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.parameter.vendorid: 0463
driver.version: 2.7.4
driver.version.data: MGE HID 1.40
driver.version.internal: 0.41
input.transfer.high: 264
input.transfer.low: 184
outlet.1.desc: PowerShare Outlet 1
outlet.1.id: 1
outlet.1.status: on
outlet.1.switchable: no
outlet.desc: Main Outlet
outlet.id: 0
outlet.switchable: yes
output.frequency.nominal: 50
output.voltage: 230.0
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 02.08.0010
ups.load: 0
ups.mfr: EATON
ups.model: Eaton 3S 700
ups.power.nominal: 700
ups.productid: ffff
ups.serial: Blank
ups.status: OL
ups.timer.shutdown: 0
ups.timer.start: 0
ups.type: offline / line interactive
ups.vendorid: 0463
upsc Eaton
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 20
battery.runtime: 4800
battery.type: PbAc
device.mfr: EATON
device.model: Eaton 3S 700
device.serial: Blank
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.parameter.vendorid: 0463
driver.version: 2.7.4
driver.version.data: MGE HID 1.40
driver.version.internal: 0.41
input.transfer.high: 264
input.transfer.low: 184
outlet.1.desc: PowerShare Outlet 1
outlet.1.id: 1
outlet.1.status: on
outlet.1.switchable: no
outlet.desc: Main Outlet
outlet.id: 0
outlet.switchable: yes
output.frequency.nominal: 50
output.voltage: 230.0
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 02.08.0010
ups.load: 0
ups.mfr: EATON
ups.model: Eaton 3S 700
ups.power.nominal: 700
ups.productid: ffff
ups.serial: Blank
ups.status: OB
ups.timer.shutdown: 0
ups.timer.start: 0
ups.type: offline / line interactive
ups.vendorid: 0463
vim /etc/nut/upsd.users
...
[upsmon]
password = <Password>
actions = SET
instcmds = ALL
...
MONITOR Eaton@localhost 1 upsmon <Password> slave
...
systemctl restart nut-server.service
systemctl restart nut-monitor.service
upsrw -s battery.charge.low=35 -u upsmon -p <Password> eaton
upsc eaton battery.runtime
e.g. command for monitoring
/usr/bin/upsc eaton battery.runtime 2>&1 | /usr/bin/sed 's/Init SSL without certificate database//g' | xargs