How to setup an UPS with a Synology NAS

Synology NAS are excellent units to backup large data and can even entirely replace proprietary cloud solutions such as google drive, google photos, etc… They have indeed their own series of applications that do exactly the same, except that you are in total control of your data: These never leave your home or office and do not risk to be used for any kind of data mining purpose by a third party.

However, to have completely effective backup solution, one also need to consider potential failures of those NAS units. Apart from the usual 3-2-1 backup rule that anyone should have in mind (look at this if you don’t know what this is), it is highly preferable to combine your NAS with a backup power supply (ie an UPS) that will let your NAS shutdown safely in case of electricity cut and before any data loss occurs. In addition to that Synology NAS come with a great capability: It can broadcast an emergency shutdown to any device within it’s network using NUT.

In this post, I will explain how (1) you can setup your NAS so that it gets connected to a UPS with USB broadcasting capability. And (2) how this same NAS can be used to alert your other linux-based systems (assuming the support of apt, ie in Debian based OS such as Ubuntu). This tutorial will also assume that you have a DSM 6 or 7, which I know support that functionality and that have a similar setup process regarding (1).

Setup your NAS

First, go in: Control Panel –> Hardware & Power –> UPS

Click: Enable UPS Support

Choose your UPS type. Most low-to-medium end UPS use USB to comunicate.

If you want that NAS to let other devices in your network receive an instruction to shutdown when the power supply is compromised, tick: Enable network UPS Server

You may also add a list of IP for permitted diskstation if you want to limit access by clicking on: Permitted Diskstation Devices

Then choose: Apply

If all went well, you should be able to see the UPS device information by clicking on the button with that same name.

Fig.1 Main screen for the setup of an UPS server on a Synology DSM 7.2

Now, the Synology NAS should be able to get notification of loss of power from the UPS and should be able to broadcast it to other devices within your network.

Setting up NUT in you Debian-based Linux systems

If you want you computers to receive and interpret the instructions from the Synology UPS server, you need to follow these steps on each of your Linux machines:

First update and install NUT:

sudo apt update
sudo apt install nut

Then, edit the nut configuration file. For example using nano:

sudo nano /etc/nut/nut.conf

Ensure that instead of MODE=NONE, you have:

MODE=netclient

Leave the editor without forgetting to save the file. Then, edit the monitoring configuration file upsmon.conf :

sudo nano /etc/nut/upsmon.conf

At the end of the file, add the following line,

MONITOR ups@[Your NAS IP] 1 monuser secret slave

Here, replace [Your NAS IP] by the IP of your NAS (e.g. 10.0.1.100)

Finally you need to save the file and restart the NUT client service:

sudo systemctl restart nut-client.service

You may verify that the system properly connected to the UPS by looking at the status of the service:

sudo systemctl status nut-client.service

I would also recommend to perform a live test by disconnecting you UPS and see if everything goes as planned. You should have your UPS making a sound indicating the loss of power and after some time (if you set the Synology behaviour as in Fig.1, after 30 seconds), the NAS will also beep, send the alert to your set computers and those should all turn off by themselves. Once the power is back, you should then have a restart of all of your systems: The NAS and the computers.

Leave a Reply

Your email address will not be published. Required fields are marked *