Proxmox, UPS and Network MS card

inxsible

Active Member
Feb 6, 2020
139
8
38
Hi,

I have a rack mounted Eaton 5PX1500RTN with a Network MS card that I would like to use in a way to shutdown all VMs and CTs and then shutdown the Proxmox host 5 mins after the power is lost.

I have set it up successfully in my FreeNAS and my pfSense boxes. However, when I try to search for UPS related threads in Proxmox, the only ones I found indicated to use apcupsd with a USB connection. Is there any way to get a SNMP card to work with Proxmox and check the UPS battery status and accordingly initiate shutdown procedures?

That way, all servers can individually check the UPS battery level instead of me assigning master/slave config.

Thanks,
 
Ok, I got a few things going, but I don't think I am there yet.

  1. Install nut-snmp apt install nut-snmp This will install all the necessary nut tools
  2. Edit /etc/nut/nut.conf and change MODE=none to MODE=standalone
  3. Edit /etc/nut/ups.conf and add configuration for your UPS
    1. INI:
      [upsname] # choose whatever name you want
      driver = snmp-ups
      port = IP ADDR # ip address of your network card on the UPS
      snmp_version = v1
      pollfreq = 15 # choose any number of seconds you want
  4. Edit /etc/nut/upsd.users and add admin and monitor user
    1. INI:
      [USER1] # any user name you want
      password = PASSWORD # set your password
      actions = SET
      instcmds = ALL
      
      [USER2] #any user name you want
      password = PASSWORD #set your password
        upsmon master
  5. Edit /etc/nut/upsmon.conf and add the following line at the end MONITOR upsname@localhost 1 USER2 PASSWORD master Make sure that the upsname is the same as the one you created in ups.conf and the USER2 and PASSWORD must match the one created in upsd.users
  6. # systemctl start nut-server
  7. # systemctl start nut-monitor
  8. # upsc upsname The ups name that you set in ups.conf (step 3)
  9. The command in #8 should show you a bunch of parameters that your UPS supports. My output is listed below. Your output will depend on your UPS. This indicates successful communication with your UPS.
    1. Bash:
      Init SSL without certificate database ambient.humidity: 0.00
      ambient.temperature: 0.0
      battery.charge: 100.00
      battery.charge.low: 20
      battery.runtime: 5434.00
      battery.runtime.low: 180.00
      battery.voltage: 50.00
      device.mfr: Eaton
      device.model: Eaton 5PX
      device.serial: G690G11046
      device.type: ups
      driver.name: snmp-ups
      driver.parameter.pollinterval: 2
      driver.parameter.port: IP ADDR
      driver.parameter.snmp_version: v1
      driver.parameter.synchronous: no
      driver.version: 2.7.4
      driver.version.data: mge MIB 0.5
      driver.version.internal: 0.97
      input.phases: 1.00
      input.transfer.reason:
      outlet.desc: Main Outlet
      outlet.id: 0
      output.current: 1.00
      output.frequency: 59.00
      output.phases: 1.00
      output.voltage: 120.00
      ups.beeper.status: enabled
      ups.delay.shutdown: 20
      ups.delay.start: 30
      ups.firmware: 01.02.0002
      ups.firmware.aux: JI
      ups.load: 8.00
      ups.mfr: Eaton
      ups.model: Eaton 5PX
      ups.serial: G690G11046
      ups.start.auto: yes
      ups.status: OL
      ups.test.result: done and passed
      ups.timer.reboot: -1.00
      ups.timer.shutdown: -1.00
      ups.timer.start: -1.00


The only thing that I am not yet sure of is how to set it so that the Proxmox host initiates a Shutdown on every CT & VM and then shuts down itself.

My guess is that the SHUTDOWNCMD in upsmon.conf needs to be changed -- but I am not sure how. Maybe a script that can initiate shutdown on each guest -- need to think about that.

Let me know if you have any ideas ! Don't be shy now !
 
Last edited:
I added my community to the snmp config.

[upsname] # choose whatever name you want
driver = snmp-ups
port = 192.168.1.44
community = public1
snmp_version = v1
pollfreq = 15 # choose any number of seconds you want
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!