Monitor UPS with NUT on pfSense
It is a good idea to have you pfSense firewall on a UPS and to have it shutdown properly in the event that you lose power. Today, I will be showing you just how to do that.
I am using a Netgate SG-3100 running pfSense 2.5 attached to a CyberPower OR500LCDRM1U UPS, but these same steps should apply to any physical pfSense firewall and UPS. For the UPS, you may just have to change the driver. You can see what drivers support what UPSs at networkupstools.org/stable-hcl.html.
First you will need connect the firewall to the UPS with a USB A to B cable. Then you can log into your pfSense firewall so that you can install the NUT package. After you are logged in, go to System | Package Manager | Available Packages. Either search for NUT or find it in the list.
Click install on the right hand side and then wait for it to finish. Then head to Services | UPS | UPS Settings. Fill in the Settings like in the picture below. You can give it whatever name you would like.
Now, you should be able to to the UPS Status page and see that it connected. On my SG-3100 however, the UPS still didn’t show up. I looked in the logs and it showed “Poll UPS [CyberPower] failed – Driver not connected. I searched the web and found a post that said it needed to start as root. So I went back to my UPS settings, displayed the advanced settings, and added “user = root” (without the quotes) in the “Additional configuration lines for ups.conf. After I did that, everything was good.
Now if I am ever to lose power, the UPS will trigger the pfSense firewall to shutdown nicely and power back on when power is restored.
Leave a Reply