Connecting a Synology DiskStation to a NUT server

Synology DiskStations internally use NUT to interface with several UPS devices. You can also configure DSM to act as a server, to connect several of them together.

But what if you want to connect the DSM to an already existing NUT setup? The only thing that you can configure from the control panel is the server IP… let’s see how to configure the NUT server to handle connections from your DiskStation.

First of all, make sure upsd listens on the required network interface. Edit upsd.conf and add a couple of lines like these:

LISTEN 127.0.0.1
LISTEN 192.168.1.1

(by default it listens only on the loopback interface).

Then you should match your configuration to the one hardcoded in the DiskStation. You can use the values in this post for reference: in case Synology decides to change them in a future product, you can enable SSH on your device then look for the new values in /usr/syno/etc/ups/

The first thing to do is to change the name of the ups to… err… ups 🙂 This means editing ups.conf:

[ups]
    driver = ...

(remember to update your upsmon.conf file too, if you changed the name).

Next, you’ll need to create the user that Synology requires. Edit upsd.users and append these lines:

[monuser]
    password = secret
    upsmon slave

Restart upsd, enable UPS support in DSM, enter the IP of your server and Bob’s your uncle. 🙂

15 comments

  1. Stefano says:

    Hi,

    I’m just setting up NUT in my environment and ended up here 🙂

    You’re basically saying that, in order to allow DSM to connect to the NUT server, the configuration of the SERVER should be modified according to the DSM default one, aren’t you?

    What if I simply change the NUT scripts on the DSM according to the existing setup?

    Thanks for the post, it’s really one of the few relevant ones about this stuff available on the web.

    • Simone says:

      I guess you can change the settings on the Synology too. I’ve chosen to change them on my server because there’s a chance that Synology might overwrite its settings when you edit something from the web interface or during a system update

      • Stefano says:

        Ok, that makes sense. I think I’ll try your way, it’s safer to modify the server configuration than the DSM one.
        I haven’t really understood the connection between the web interface and the scripts, however; most of the options are hardcoded, even the USB driver (my UPS is not an APC, for example) and the user/password. No SHUTDOWNCMD has been defined, and I am quite worried to specify one.

      • Tim says:

        I figured I’d post this for posterity reasons for anyone else running into the same issue. This was a great quick little guide for pointing me in the right direction.

        You *HAVE* to use “ups” as the name for the UPS at the server side. When you start the ups-net service on the Synology, it triggers a process that changes your upsmon.conf file MONITOR statement back to “MONITOR ups@ …”. Granted, if you’ve got the determination, you can probably find what continues to modify this file and correct it, but that would increase the risk of problems in my opinion.

        I was losing my mind trying to figure out why the synology wasn’t connecting, and after three times modifying upsmon.conf and finally noticing what was going on, I switched everything to “ups”, and everything worked.

  2. Jonathan says:

    This is very frustrating.

    I’ve tried what you describe here in every possible way imaginable, and the Synology just says “cannot connect”.

    I can’t even see any evidence of it attempting to connect to the NUT server at all.

    It’s like they’ve completely broken network UPS support.

    • Simone says:

      it’s still working fine with the latest DSM for me.

      You might want to check your firewall settings on your server, or that NUT is listening on the right interface. Also check your server logs, to see if there’s any error.

      • R says:

        I’m having the same issue. My NUT server is definitely set up right but my Synology can’t talk to it at all. It’s definitely username “monuser” password “secret” isn’t it?

        • Simone says:

          on my NAS, yes. I don’t know if it’s the same across all of Synology products though (but I guess so, since they should be interoperable). You can enable SSH on your Synology and check its config, though.

  3. Chris says:

    Thanks , very helpful post !
    If you want to do this the other way around, as in configure the synology to use a different username and password to connect ( some pre-packaged NUT distributions have a default monuser user already , or you want an actual password ) :
    /usr/syno/etc/rc.sysv/ups-net.sh contains the hardcoded username and password .
    look for a line like
    sed “/^MONITOR/c\\MONITOR ups@${UpsmonServer} 1 monuser secret slave” /usr/syno/etc/ups/upsmon.conf > /tmp/upsmon.conf
    and replace ‘monuser’ (username) and ‘secret’ ( password ) to your liking.
    synoservice -restart ups-net
    will then enable those changes.
    It seems to survive changes made in the UI , but I’m sure synology will eventually replace the ups-net.sh when you install an update, so you might have to repeat that change.

  4. Frank L says:

    Very helpfull post.
    My DSM EDS14 is successfully connecting to my upsd and responding to ups.status changes in the Health display – with some lag.

    HOWEVER – it does not enter safemode on a change from OB to LB.
    What is the exact condition (and expected set) of parameters that triggers safemode in the DSM?

    Running upsmon in the host system correctly takes the host down on LB with battery.charge/battery.runtime less the limits setup for the driver.

    I am trying to use the dummy-ups driver as a way to shutdown the DSM safely during automated shutdown of a host system supplying power to the DSM. (not a really an UPS)

Leave a Reply to Ed Cancel reply

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