UPS configuration - master/slave

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I recently bought a Eaton 5PX1500RTN UPS(1440VA/1440W) with a Network-MS card. I connected it via ethernet and can now see the Web UI for Eaton. This thread here gave me confidence that the UPS would work via the network instead of using the USB or Serial cable/driver. Now comes the part where I configure it with FreeNAS and pfSense router in order for it to gracefully shutdown in case of a power outage.

I want to achieve the following in case of a power outage:
  • 60 seconds into the power outage -- initiate graceful shut down of Main NAS and backup NAS.
  • Keep the pfSense router, unmanaged switch, modem and DD-WRT Access Point running until the battery is 5% remaining. At that point, gracefully shut everything down including the UPS.

Given what I want to achieve, here are some questions I have:
  1. Do I still need to connect the "control cable" (usb or serial) even though the UPS has a network card and is visible on my network?
  2. Should I make FreeNAS as the master or pfSense as the Master?
  3. What is the advantage of making FreeNAS as master or vice-a-versa?
  4. In what order would a device shut down if it is a master vs a slave?
  5. Since my switch is a dumb switch, I believe that when the UPS shuts down at 5% battery, the switch and modem will just die due to lack of power and I am ok with that. However can the DD-WRT access point be configured to shutdown gracefully?

Note: all of the devices listed are connected to a PDU which is connected to the UPS.
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I was able to use the network card itself and connect my FreeNAS systems and my pfSense system to the UPS via SNMP. No USB or Serial cable required. For posterity's sake, here's what I did
upsConfig.png
upsConfig2.png



  1. Select UPS Mode as Master -- since the system is going to talk directly to the UPS via the SNMP card.
  2. Put in an identifier to uniquely identify the UPS
  3. Select the closest driver compatible with your SNMP card -- I selected
    Code:
    Eaton ups 5 various models (SNMP Mode) SNMP/Web Minislot Card (ref 66244) (snmp-ups)
    . Most times this is going to be snmp-ups for network cards. Note that if you go into the UPS Configuration setting after saving, it might have changed the driver that is selected -- This is because FreeNAS chooses any available name using the same driver (snmp-ups). I don't know why it does this but it doesn't affect anything as they all use the snmp-ups driver. Maybe this requires a "Nice-to-have" bug creation.
  4. Put in the IP address of your SNMP card/UPS as the Port value. It's best to assign a static IP to the UPS/SNMP card and not use DHCP because that may change in case of outage.
  5. Add in additional parameters if you want -- See here to check what parameters can be passed in. This also depends on what your UPS supports.
  6. Put in a description if you like
  7. Change the Monitor Password to what ever you like
  8. Enable Email Status updates and add in the email address that you want the updates sent to
  9. Keep Remote Monitor disabled
  10. Power off UPS -- I kept this disabled because I want FreeNAS to shutdown but I want my internet(modem, router, switch & AP) to keep working for as long as possible. You can choose to enable this if the UPS is only powering your FreeNAS box or if you want everything connected to the UPS to shutdown in case of power outage.
  11. Click OK and start up the UPS service and enable "Start on boot"

Repeat the procedure on any other FreeNAS box that you might have on the network.

Hope that helps
 

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
This is a super helpful post. Thanks for taking the time to write it.

How did you set up snmp on pfSense?

I have pfSense, FreeNAS and a couple Unifi switches all connected to the Eaton ups via the network card.

I am wanting the FreeNAS server to shut down first then pfSense and switches. Not too sure how to accomplish all this though.
 

Matt_G

Explorer
Joined
Jan 24, 2016
Messages
65
First let me state that I have never used an Eaton UPS.
I am using CyberPower here.

I have a similar setup.
FreeNAS is the master and pfSense is the slave on my CyberPower_CP1500PFCLCD UPS.

In pfSense, under Services>UPS Settings, set the UPS type to remote NUT server.
(in your case, you may have to use remote SNMP as the type. I have never used SNMP here so I'm not sure...)
Give it a name and enable email notifications if desired.
Under driver settings, give it the IP address of your FreeNAS box and port if necessary.
Then give it the upsmon username and password.

It should work.
 

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
First let me state that I have never used an Eaton UPS.
I am using CyberPower here.

I have a similar setup.
FreeNAS is the master and pfSense is the slave on my CyberPower_CP1500PFCLCD UPS.

In pfSense, under Services>UPS Settings, set the UPS type to remote NUT server.
(in your case, you may have to use remote SNMP as the type. I have never used SNMP here so I'm not sure...)
Give it a name and enable email notifications if desired.
Under driver settings, give it the IP address of your FreeNAS box and port if necessary.
Then give it the upsmon username and password.

It should work.
Is it possible to have pfSense as master and FreeNAS as slave?
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,924
Is it possible to have pfSense as master and FreeNAS as slave?
Yes - I have two FreeNAS boxes as slaves from my pfSense master.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,924
Yes indeed.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
Is it possible to have pfSense as master and FreeNAS as slave?
Why not make them all Master?

Since you are using a network card to monitor anyway, they can shutdown/startup independently of each other. Master/Slave configuration is usually useful, if you are attaching the UPS via a serial or usb cable to one of the devices (pfsense or FreeNAS) and then having the other device (slave) check on the status of the master device.

Since it's a network card, you can have them both monitor the UPS' network card and take action accordingly. That's what I do.
 

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
Why not make them all Master?

Since you are using a network card to monitor anyway, they can shutdown/startup independently of each other. Master/Slave configuration is usually useful, if you are attaching the UPS via a serial or usb cable to one of the devices (pfsense or FreeNAS) and then having the other device (slave) check on the status of the master device.

Since it's a network card, you can have them both monitor the UPS' network card and take action accordingly. That's what I do.
I had no idea I could do this with the network card, will definitely look in to it.

Would you mind sharing your configuration for pfSense and the UPS? I have installed the Nut package but am unsure how to configure.

Also, did you have to log in to your UPS to adjust any settings? I am using an Eaton 5px3000va/2700w
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I had no idea I could do this with the network card, will definitely look in to it.
Well yeah ! Since it's a network card, every network device can talk to it directly. No need for another device in the middle to be a Master etc.

Not much in terms of pfSense UPS settings:
I just changed the pollfreq from the default to 45 seconds because I think it suffices. I have an Eaton 5PX1500RTN UPS and pfsense communicates directly and so does FreeNAS

Code:
General Settings
    UPS Type : Remote SNMP
    UPS Name : "whatever name you like, I just named it the same as my ups hostname"

Driver Settings
    Remote IP address or hostname: "your hostname or IP"
    Extra arguments to driver : pollfreq = 45


Also, did you have to log in to your UPS to adjust any settings? I am using an Eaton 5px3000va/2700w
I did log in to the UPS to set up a few things, but they are unrelated to the pfSense configuration. I was hoping for the UPS to send me emails etc directly when it went on battery power and a bunch of other Alerts -- but the UPS' network card (Network-MS) doesn't support TLS (or at least there is nothing where I can set that) so all the emails just fail and I can't send them over.

I researched and it seems the general consensus is that usually these UPS' are used in Enterprise environments where they have a separate mail server within the same LAN network where it could be forwarded. For me though, it was too much of a hassle, so I just used the UPS scripts available on FreeNAS forums to get me the information I wanted.
 
Last edited:

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
Well yeah ! Since it's a network card, every network device can talk to it directly. No need for another device in the middle to be a Master etc.

Not much in terms of pfSense UPS settings:
I just changed the pollfreq from the default to 45 seconds because I think it suffices. I have an Eaton 5PX1500RTN UPS and pfsense communicates directly and so does FreeNAS

Code:
General Settings
    UPS Type : Remote SNMP
    UPS Name : "whatever name you like, I just named it the same as my ups hostname"

Driver Settings
    Remote IP address or hostname: "your hostname or IP"
    Extra arguments to driver : pollfreq = 45


I did log in to the UPS to set up a few things, but they are unrelated to the pfSense configuration. I was hoping for the UPS to send me emails etc directly when it went on battery power and a bunch of other Alerts -- but the UPS' network card (Network-MS) doesn't support TLS (or at least there is nothing where I can set that) so all the emails just fail and I can't send them over.

I researched and it seems the general consensus is that usually these UPS' are used in Enterprise environments where they have a separate mail server within the same LAN network where it could be forwarded. For me though, it was too much of a hassle, so I just used the UPS scripts available on FreeNAS forums to get me the information I wanted.
Thanks for the pfSense configuration. Is it possible to have both the FreeNAS and pfSense pollfreq set to 30 or would this cause a conflict?

Also, as per your screenshots of the FreeNAS UPS setup, the monitor user and monitor password is this set up via the Eaton gui?

I also read on nguvu.org (https://nguvu.org/pfsense/network ups tools (nut)/pfsense-ups-nut/) to set extra arguments regarding low battery warning to 20%. Is this something you had to do?
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
Is it possible to have both the FreeNAS and pfSense pollfreq set to 30 or would this cause a conflict?
That should be fine. I have both my pfSense and FreeNAS set to 45.

Also, as per your screenshots of the FreeNAS UPS setup, the monitor user and monitor password is this set up via the Eaton gui?
No not from the Eaton gui. These are the user/pass that you set up in the NUT configuration. I think it's the upsmon.conf file.

I also read on nguvu.org (https://nguvu.org/pfsense/network ups tools (nut)/pfsense-ups-nut/) to set extra arguments regarding low battery warning to 20%. Is this something you had to do?
No I didn't do this because the default low battery level for my UPS is 20%. I think that's the default for all, but I could be wrong. I would change it only if you want to override the default low battery level to anything other than 20%. Going lower risks not cleanly shutting down all devices before the UPS loses all battery power depending on how many devices you have connected.

My initial goal was to shutdown FreeNAS, 5 mins after losing AC power and keep the other devices running until 20% battery remained. During my research I found that taking the UPS batteries that low in charge will kill the batteries much faster. So now I just gracefully shutdown all possible devices 5 mins after losing AC power.

My dumb switch and an old Wifi AP (DD/WRT) just die for lack of power after 5 mins -- as there is nothing that I can set up for shutting them down.
 

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
That should be fine. I have both my pfSense and FreeNAS set to 45.


No not from the Eaton gui. These are the user/pass that you set up in the NUT configuration. I think it's the upsmon.conf file.


No I didn't do this because the default low battery level for my UPS is 20%. I think that's the default for all, but I could be wrong. I would change it only if you want to override the default low battery level to anything other than 20%. Going lower risks not cleanly shutting down all devices before the UPS loses all battery power depending on how many devices you have connected.

My initial goal was to shutdown FreeNAS, 5 mins after losing AC power and keep the other devices running until 20% battery remained. During my research I found that taking the UPS batteries that low in charge will kill the batteries much faster. So now I just gracefully shutdown all possible devices 5 mins after losing AC power.

My dumb switch and an old Wifi AP (DD/WRT) just die for lack of power after 5 mins -- as there is nothing that I can set up for shutting them down.
I have noticed the Eaton UPS has a default low battery at 20%. Also, I read pfSense automatically uses this low battery to initiate graceful shutdown.

I am struggling with setting the monitor user and password on pfSense. When I select ups type as remote snmp, I don’t see an option to enter these details. I can’t find any information where to enter these
 

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
So I had a bit of time today to get all my switches/pfSense/FreeNAS hooked up to the UPS.

Everything went smoothly until I try and set up the UPS on pfSense via Services > UPS. For some reason UPS status shows failed to retrieve status.

The UPS is on a separate vlan that can communicate with pfSense. I have enabled snmp via Eaton gui.

If it helps, I am using the new Eaton Network-M2 network card as the Network-MS card is end of life. I’m thinking maybe the M2 card is not supported by nut...

Edit: Have been trying for half of today and still no luck.
It should be no where near as difficult as it is. Have managed to source a new/sealed original box Eaton Network-MS card (arriving next Thursday/Friday) and will keep this post updated with the outcome
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I’m thinking maybe the M2 card is not supported by nut...
They don't have to support nut, they have to support SNMP. I would think any network card for an UPS would support SNMP. You might want to check which version of SNMP your card supports. I think pfSense defaults to v1, but if your card supports v2 or v3 then you might have to explicitly state that in ups.conf.

Have managed to source a new/sealed original box Eaton Network-MS card (arriving next Thursday/Friday) and will keep this post updated with the outcome
Would have been easier to just try the USB cable or the Serial cable option if you had the cables, don't you think?
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
Eaton seems to suggest that your Network-M2 card does support SNMP v1 and v3 but not v2c (or at least there is no mention of v2c)


Seems the only difference between Network-MS and Network-M2
  1. M2 having a Gigabit NIC vs the MS having a Fast Ethernet only and
  2. M2 having a lower power consumption 300mA vs 500-1000mA for MS
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
The one thing that I do remember when setting up my UPS and pfSense was that after making changes to the UPS and providing it with a static IP address outside my DHCP range -- I had to power cycle the UPS and even remove the LAN cable from the Network-MS card and then restart the UPS and attach the ethernet cable again. For some reason, without removing the cable, it didn't reset it's internal state table -- which gave me quite a headache trying to figure out why I couldn't communicate with the UPS. You might want to try that out as well.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I am struggling with setting the monitor user and password on pfSense. When I select ups type as remote snmp, I don’t see an option to enter these details. I can’t find any information where to enter these
Don't worry about that. I don't have anything set up either. The nut package available for pfSense uses default values, if I am not mistaken.
 

Sir SSV

Explorer
Joined
Jan 24, 2015
Messages
96
Thanks for the replies.

I have managed to get pfSense and UPS talking with each other. I ended up using a network-ms card.

It took a while however what I needed to do is uninstall the nut package then install net-snmp then the nut package.

Apparently the snmp-ups driver requires dependencies that net-snmp installs.

The only other issue I am having now is getting Freenas to communicate with my ups. I am on 11.2-u8 and I just can't get it to work.

The driver I have selected is: MGE UPS Systems ups 5 various models (SNMP mode) NMC Minislot (Ref 66102) (snmp-ups)
I have specified the UPS mode as Master and Port as ip address of the ups. I keep getting connection refused

Edit: Turns out I managed to get my UPS and FreeNAS communicating with each other. Did a test by pulling the mains to the ups and FreeNAS shut down after 5 mins.

I couldn't get the Slave setup to work so I went with Master. Had to configure a couple firewall rules on the pfSense side (this was blocking the communication between FreeNAS and the UPS).

Also did a tidy up of the packages on my pfSense and I do not require net-snmp package, I did however decide to upgrade to the latest version of pfSense and this has fixed all issues.
 
Last edited:
Top