Setup NAS Remote UPS Monitoring

I recently purchased and setup a new QNAP TS-451 to upgrade from my old ReadyNAS NV+ V2. The ReadyNAS served it’s purpose for several years and overall I’ve been very happy with it. With the latest advances in the NAS space, and considering some reliability problems I’ve been having with the old ReadyNAS, it was time for an upgrade. In setting up the new NAS I decided I wanted to migrate all of my old data off the ReadyNAS and put it on the QNAP, since I planned to use the new NAS as my primary data store for my home office.

Previously I had the ReadyNAS connected to a UPS so that if the power was cut, the NAS could gracefully shutdown before complete powerless (I’ve experienced more than one occurrence of a RAID rebuild after the ReadyNAS was shutdown in a less than graceful manner and this was meant to avoid that). So I decided that it was more important for the QNAS system to get the updates from the UPS, and connected it accordingly. When I went to setup the shutdown parameters I noticed a little feature that I wasn’t previously aware of: you can setup the QNAS as a UPS master server and send notifications to slave devices which enables them to essentially act as if the UPS were directly connected. Pretty cool! But setting this up and getting the devices connected was less than straight forward unfortunately.

The information I found generally pertained to setting up the ReadyNAS as a UPS master and configuring other ReadyNAS devices to connect to it in the same fashion. Another feature in the ReadyNAS line that I wasn’t previously aware of, but in the end it was a nice surprise. When I tried to set it all up I ran into some issues that make me feel like the feature is still rather half-baked in both platforms, and thus I needed to consult Google to try and track down some details on both platforms. With that information in hand, I was able to update the UPS monitoring configuration on both hosts and successfully connected the ReadyNAS to the QNAP for UPS monitoring.

On the QNAP
These notes were compiled with the help of the following QNAP Forum post: http://forum.qnap.com/viewtopic.php?f=151&t=47493&sid=27e23d1c7e634c843f81540334d1de5c

  1. Configure the QNAP as a UPS network master via the user interface (System Settings -> External Devices -> UPS), enable network UPS master and setup any remote hosts you wish to have connected to the QNAP for UPS monitoring.
  2. Connect to your WNAP using SSH and login as admin (or alternatively another user with permissions to run sudo.
  3. Navigate to the /etc/config/ups folder.
  4. Using vi, open the upsmon.conf file and locate the line starting with MONITOR. It should be listed as MONITOR [email protected] 1 admin 123456 master – this means the QNAP is setup as the master server and hosts updates for a UPS called ‘qnapups’, which can be accessed remote using ‘admin’ as the username and ‘123456’ as the password. These are the important bits – in addition to the IP address of your NAS. You should consider editing the password and possibly the username for additional security but for now we’ll leave these as is.
  5. Close upsmon.conf and, using vi again, open upsd.users and locate the section with the header ‘[admin]’. Locate the line in the section labelled ‘allowfrom’ which should read allowfrom = localhost. Change it to read allowfrom = ALL to allow multiple clients to connect using the credentials. Save the file and exit vi.
  6. Restart the UPS monitoring daemon using the following command: upsd -c reload

Now with that your QNAP NAS is setup as the master and ready to accept inbound connections from other hosts for UPS monitoring updates. The next step is to configure the clients, and in my case the only client I needed to configure is the ReadyNAS device. Now, the ReadyNAS devices do support remote monitoring of UPS master devices however the base configuration doesn’t seem to be compatible with monitoring a UPS hosted using other NAS vendor’s hosting configuration for UPS monitoring (no, I’m not entirely surprised by this). So, to get it working, we have to make similar changes on the ReadyNAS as we did with the QNAP NAS in order to make this work.

On the ReadyNAS
This process was compiled and put together with the help of the following ReadyNAS forum post: http://www.readynas.com/forum/viewtopic.php?f=18&t=63011

  1. Before you can proceed, you will need to locate and install the add-on to enable root SSH access to the ReadyNAS device. By default the NAS will not accept SSH connections for the root user and this is required in order to update the UPS monitoring configuration. You can find the add-on by looking up add-ons for your specific device on the ReadyNAS site. For the ReadyNAS NV+ V2, the add-on can be found here: http://www.readynas.com/?p=4203.
  2. Using vi, open the file located at /etc/default/nut. Look for the line listed as START_UPSMON=no and change it to START_UPSMON=yes and then save the file.
  3. Now, also using vi, open the upsmon.conf in the /etc/nut folder and remove any existing line that starts with MONITOR. Add a new line with the text of MONITOR [email protected] 1 admin 123456 slave (replacing “ip.of.qnap.nas” with the IP of your NAS of course), and then save the configuration file.
  4. Next, you must create an empty log file for the monitoring daemon to write log data to. This can be accomplished by running the touch command as follows: touch /var/log/frontview/ups.log.
  5. Start the UPS daemon by running /etc/init.d/ups-monitor start.
  6. Now, in order to make sure the change persists if/when you restart your NAS, you need to open the /etc/init.d/upsmonitor file using vi and locate the line labeled start_stop_client(). Within this section (function), locate the first line labeled start-stop-daemon and directly above it, add touch /var/log/frontview/ups.log and save it.

To verify the connection you can check the logs to ensure no additional errors were reported, and you should now see the UPS status on the FrontView (with the dashboard version 1.0.0.271 that comes with RAIDiator 5.3.10 for the NV+ V2, this can be seen on the screen that appears when you click on Configure after opening the dashboard in your favorite web browser). With the status updates now flowing between the NAS devices, you can rest assured that the slave NAS device will now also respond to power loss and will gracefully shut itself down before power loss occurs.

One issue I did see, is that after this configuration process is complete, even though the Configure screen on the ReadyNAS shows a green light next to the UPS and is reporting current battery levels, the info screen appears to be operating erratically and no longer consistently shows the individual drive list with their health in the top half of the windows. I am not entirely sure why that isn’t working after the configuration changes are applied but if/when I do find out I will be sure to update this post with the relevant details.

Hope this tip helps! As always please comment with any questions, concerns or details on how this process can or has been improved.

Leave a Comment

You must be logged in to post a comment.