[Nut-upsuser] Is it all set up?

Ben Short ben at benshort.co.uk
Tue Feb 11 13:17:10 GMT 2025


Hi,

On my FreeBSD box which is connected to the UPS I have the following 
configuration (config not shown is left as default):

ups.conf

[apc]
         driver = "usbhid-ups"   # alternately:
         port = "auto"
         vendorid = "051D"
         productid = "0003"
         product = "Smart-UPS X 2200 FW:UPS 07.4 / ID=01003"
         serial = "AS2039254737"
         vendor = "American Power Conversion"
         # bus = "000"
         # device = "002"
         # busport = "013"

upsd.conf

LISTEN 192.168.123.4 3493

upsd.users

[upsprimary]
  password = *****
  upsmon primary

[upssecondary]
  password *****
  upsmon secondary


upsmon.conf

MONITOR apc at 192.168.123.4 1 upsprimary ***** primary

And I can see all the processes running:

# ps -xa | grep -e ups -e nut
66945  -  Is       0:00.00 /usr/local/bin/upslog -s myups at localhost -l 
/var/log/nut/ups.log -i 300
66960  -  Is       0:00.00 /usr/local/sbin/upsmon localhost
66961  -  S        0:00.03 /usr/local/sbin/upsmon localhost
67166  -  Ss       0:00.09 /usr/local/libexec/nut/usbhid-ups -a apc
67168  -  Ss       0:00.06 /usr/local/sbin/upsd

And I can query the ups (Oddly with no need to use a username and password):

# upsc apc at 192.168.123.4
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.runtime: 5655
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 132.0
battery.voltage.nominal: 120.0
device.mfr: American Power Conversion
device.model: Smart-UPS X 2200
device.serial: AS2039254737
device.type: ups
driver.debug: 0
driver.flag.allow_killpower: 0
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.product: Smart-UPS X 2200 FW:UPS 07.4 / ID=01003
driver.parameter.productid: 0003
driver.parameter.serial: AS2039254737
driver.parameter.synchronous: auto
driver.parameter.vendor: American Power Conversion
driver.parameter.vendorid: 051D
driver.state: quiet
driver.version: 2.8.2
driver.version.data: APC HID 0.100
driver.version.internal: 0.53
driver.version.usb: libusb-1.0.0 (API: 0x1000102)
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: UPS 07.4 / ID=01003
ups.mfr: American Power Conversion
ups.mfr.date: 2020/09/27
ups.model: Smart-UPS X 2200
ups.productid: 0003
ups.serial: AS2039254737
ups.status: OL
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.vendorid: 051d

On a linux box I have:

upsmon.conf

MONITOR apc at 192.168.123.4 1 upssecondary ***** slave

And can query the ups (Again with no need to supply the username and 
password):

# upsc apc at 192.168.123.4 ups.status
OL

When I start upsmon I see the following logging:

Feb 11 12:57:42 buildsever01 upsmon[17519]: Startup successful
Feb 11 12:57:42 buildsever01 upsmon[17520]: Login on UPS 
[apc at 192.168.123.4] failed - got [ERR ACCESS-DENIED]
Feb 11 13:05:28 buildsever01 upsmon[17520]: Poll UPS [apc at 192.168.123.4] 
failed - Server disconnected
Feb 11 13:05:28 buildsever01 upsmon[17520]: Communications with UPS 
apc at 192.168.123.4 lost
Feb 11 13:05:33 buildsever01 upsmon[17520]: Communications with UPS 
apc at 192.168.123.4 established


On a OpenBSD box I have:

upsmon.conf

MONITOR apc at 192.168.123.4 1 upssecondary ***** secondary

And when I start upsmon I see the following:

# upsmon -F
Network UPS Tools upsmon 2.8.2
kill: No such process
UPS: apc at 192.168.123.4 (secondary) (power value 1)
Using power down flag file /etc/killpower
upsnotify: failed to notify about state 2: no notification tech defined, 
will not spam more about it

(After initial testing I've started upsmon on this machine via rcctl 
enable upsmon && rcctl start upsmon.)


Is that it?? Is it all working? If I go and pull the power cable out of 
the UPS these three machine should shut down once the battery reaches a 
critical level based on the following?

battery.charge.low: 10
battery.charge.warning: 50

These servers are in a air conditioned rack. The air conditioning is not 
plugged into a UPS (Don't ask) so ideally as soon as the UPS reports its 
state as on batteries nut should shut these servers down.

I've seen that the levels can be overridden...

     override.battery.charge.low = 10
     override.battery.charge.warning = 50

So maybe I could set warning to 95 and low to 90?

Also is it possible to use nut to shut the servers down if the temp in 
the rack goes above some value? I don't see the UPS reporting the temp 
though.

Thanks










More information about the Nut-upsuser mailing list