We’re running 2 “old” HP N40L Microservers at home and they’ve been working great for the last few years [I think I got them in 2011 !]
The one is running XigmaNAS [a free NAS based on FreeBSD] and the other is running Ubuntu 18.10 [we use this to run a few Docker containers].
As we’ve been experiencing so-called “Load-shedding” again in South Africa in the last couple of months, it is imperative to have some sort of backup power to allow the servers to shutdown in a controlled manner [I’ve lost a drive on the NAS in the past due to multiple power outages/spikes :-(]
I purchased an Eaton 5E 650i UPS which has a USB interface.
I’m using the UPS on the Ubuntu machine as the “master” and on XigmaNAS, I’ve configured it as a “slave” – this means when the power goes out and the UPS is running low on battery, the “slave” will shutdown 1st and then the “master”.
Here are the steps I followed to make this work:
Step 1 – install NUT
You can find information on NUT [Network UPS Tools] on their website.
Basic step is:
sudo apt-get install nut
Step 2 – Configure
Driver setup – UPS.CONF
Now you need to configure the /etc/nut/ups.conf file
By default this file does only contains samples [in comments]
Add the following:
driver = usbhid-ups
port = auto
vendorid = 0463
pollfreq = 30
desc = "Eaton UPS on MyServer"
port is auto for USB
I had to get the vendorid as it would not start up without specifying it.
Vendorid was checked with the following command – lsusb:
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 005: ID 0463:ffff MGE UPS Systems UPS
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
So when you configure it for yourself, you can confirm the vendor ID for your own device using the lsusb command.
User access – UPSD.USERS
Now you have to configure the users who can access the service – edit the /etc/nut/upsd.users file
[upsmon]password = "your_password_goes_here"
password = "your_password_goes_here"
password = "your_password_goes_here"
actions = SET
instcmds = ALL
password – your password
and then tell upsmon whether it will be the master or slave user [slave for other ups monitoring on the network]
The [admin] user is for some UPS specific settings changes [like beeper disable – see later]
Allow for multiple monitoring points – NUT.CONF
Configure NUT as netserver – so multiple devices [like LazyNAS] can also monitor it
Edit the /etc/nut/nut.conf file and set mode to netserver [if only for local, you would make it standalone]
You now need to let the UPSD service know on which network interfaces to listen – edit /etc/nut/upsd.conf
LISTEN 127.0.0.1 3493
Localhost is 127.0.0.1 and our internal network interface is 192.168.2.5
TEST your configuration
Ok now to start all the stuff !
Run this command
sudo upsdrvctl start
Results when successfully started:
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: MGE HID 1.39
Then the moment of truth for checking the status:
Use the upsc command to connect to the service and get info on the EatonUPS UPS
Init SSL without certificate database
device.model: 5E 650i
driver.version.data: MGE HID 1.39
outlet.desc: Main Outlet
ups.model: 5E 650i
Success ! 🙂
Step 3 – Disabling the BEEPER !
By default the beeper is set to ENABLED.
It will beep on start-up and on loss of power AND when it’s about to shutdown – NOISY !!!
So to check the current beeper status, you can run this command [on the localhost]:
upsc EatonUPS ups.beeper.status
To change the status to DISABLED, use the upscmd utility:
upscmd EatonUPS beeper.disable
Username (lazyserver): admin
This would use the user [admin] /password created in the /etc/nut/upsd.users file earlier
Now the status will be disabled & it won’t disturb you when the power goes out in the middle of the night !
Step 4 – Configure XigmaNAS to also monitor this UPS as a slave device
XigmaNAS has a UPS option under Services -> UPS
Configure the following:
Identifier: EatonUPS [this is the name as defined on the Ubuntu machine (lazyserver) for the UPS]
IP Address: 192.168.2.5 [this is the ip address of the machine with the UPS linked to via USB]
Shutdown mode: UPS reaches low battery [ to ensure it will only shutdown after it’s been on UPS for a while & power did not come back]
Username: mynas [as defined in the /etc/nut/upsd.users file]
Password: your_password_goes_here [as defined in the /etc/nut/upsd.users file]
Enable the service (tickbox & save & restart) and check the logs to confirm it is working.
On homepage, you should see status in UPS section at the bottom
For more detail you can click on the “Show UPS Information” link and you will see all the detail:
That’s it !
Next steps would be to configure XigmaNAS to send you emails, etc. – but that’s standard functionality when you setup XigmaNAS – so not covered here.
The following links helped a lot with my setup.
Instructions found for install on Ubuntu: