NUT package



  • @tman222 FWIW, I'm up and running with the AP9631. I haven't had time to play with the USB, but I assume it won't work until Modbus support is added to NUT.



  • @dennypage said in NUT package:

    @bazzacad Did you go into UPS Settings and press Save?

    Yes, I hit Save, still doesn't work.



  • @bazzacad Have you rebooted since NUT install? Or unplugged and replugged the cable?

    Can you post log entries please?



  • @dennypage said in NUT package:

    @bazzacad Have you rebooted since NUT install? Or unplugged and replugged the cable?

    Can you post log entries please?

    I tried unplug & re-plug and it didn't help.
    I'll have to reboot after hours.
    But here's the log. The "No such file or directory" looks promising...

    3e6b467f-dd7b-40ec-9d39-567262d70a05-image.png



  • @dennypage said in NUT package:

    @tman222 FWIW, I'm up and running with the AP9631. I haven't had time to play with the USB, but I assume it won't work until Modbus support is added to NUT.

    Thanks @dennypage, that's good to know. I've actually got a AP9630 sitting next to me here as well. Planning to install in the next couple days so I can get the full information from the UPS via SNMP.



  • @bazzacad I've seem some weird problems with packages re-installed after a restore. If reboot doesn't solve your issue, I would recommend removing the NUT package and re-installing it.



  • @tman222 said in NUT package:

    @dennypage said in NUT package:

    @tman222 FWIW, I'm up and running with the AP9631. I haven't had time to play with the USB, but I assume it won't work until Modbus support is added to NUT.

    Thanks @dennypage, that's good to know. I've actually got a AP9630 sitting next to me here as well. Planning to install in the next couple days so I can get the full information from the UPS via SNMP.

    Installed the AP9630 last night -- all is working well now and I see the required information using NUT.

    Only pain was getting a SSL cert installed on the UPS -- turns out one has to use the APC Network Management Card Security Wizard software to generate a .p15 cert file as the UPS doesn't seem to want to take any other format.

    https://www.apc.com/shop/my/en/products/APC-Network-Management-Card-Security-Wizard-v1-0-4/P-SFNMCSECWIZ104



  • @tman222 said in NUT package:

    Only pain was getting a SSL cert installed on the UPS -- turns out one has to use the APC Network Management Card Security Wizard software to generate a .p15 cert file as the UPS doesn't seem to want to take any other format.

    Yea, serious pain. I haven’t been able to accomplish it as I don’t have access to a Windows system. APC is ridiculously behind security wise. Be sure to update the firmware on the network card or you will be stuck with TLS 1.0.



  • @dennypage said in NUT package:

    @bazzacad I've seem some weird problems with packages re-installed after a restore. If reboot doesn't solve your issue, I would recommend removing the NUT package and re-installing it.

    The reboot worked. ;-)
    Thanks much



  • @dennypage said in NUT package:

    @tman222 said in NUT package:

    Only pain was getting a SSL cert installed on the UPS -- turns out one has to use the APC Network Management Card Security Wizard software to generate a .p15 cert file as the UPS doesn't seem to want to take any other format.

    Yea, serious pain. I haven’t been able to accomplish it as I don’t have access to a Windows system. APC is ridiculously behind security wise. Be sure to update the firmware on the network card or you will be stuck with TLS 1.0.

    I was lucky enough that mine came with firmware 6.6.4 pre-installed so I already had support up to TLS 1.2. I did install 6.7.2 yesterday hoping I might see TLS 1.3, but alas still only 1.2.

    One thing I did notice - I'm unable to over-write some of the UPS parameters: For instance if I try to overwrite battery.runtime.low under "Extra Arguments To Driver" I get a message in the syslog that this parameter is immutable. Have you run into this as well @dennypage ? Thanks in advance.



  • @tman222 said in NUT package:

    One thing I did notice - I'm unable to over-write some of the UPS parameters: For instance if I try to overwrite battery.runtime.low under "Extra Arguments To Driver" I get a message in the syslog that this parameter is immutable.

    I haven't explored the SNMP implementation much yet, but I expect that you will want to change these variables in the UPS itself via Configuration->Shutdown in the NMC interface. You can probably also change them using SNMPv3, but I haven't tried.



  • @dennypage said in NUT package:

    @kevindd992002 It will be a while before I can truly experiment. I won't actually have a UPS again for several weeks.

    However, I just brought my Synology up and noticed that I didn't not receive an email indicating that the nut server was not available. Previously I always received notification from the Synology when the nut server went offline so there may indeed be an issue with newer the DSM versions.

    @dennypage , when do you think can you get back to troubleshooting this?



  • @kevindd992002 I have confirmed that the Synology is no longer sending emails when it is disconnected from the NUT server even though these are enabled in the Synology notification interface. This would certainly be a Synology bug.

    I've also confirmed that there is a log entry in the pfSense system log when the Synology connects. It looks like this:

    Aug 6 09:50:09	upsd	52880	User monuser@192.168.0.4 logged into UPS [ups]
    

    If you are not seeing this in the logs, then the Synology is not successfully connecting.



  • @dennypage said in NUT package:

    If you are not seeing this in the logs, then the Synology is not successfully connecting.

    @dennypage : thanks for your last (above) message.
    I knew something was missing.
    Could figure out what is was / didn't take the time for it.

    Placed this on the NUT settings page :

    dbcd2cc8-8cc3-4d2b-9afe-abcdf51b2d79-image.png

    because the file on my Syno said ( /usr/syno/etc/ups/upsmon.conf ) :

    .....
    MONITOR ups@192.168.1.1 1 monuser secret slave
    ....
    

    Know I have :

    048f5abb-03a0-4fc9-8108-b4f02f4c133f-image.png

    192.168.1.15 is my Syno.

    When I have some time, I'll check what happens when pfSense (the UPS master) is switched to battery.



  • @dennypage said in NUT package:

    upsd

    Ok, that's not good then. When I checked the logs now, I didn't see any upsd entries. I only saw upsmon entries. I then restarted the pfsense UPS monitoring service and got this:

    
    Aug 9 07:52:04 	upsmon 	17459 	UPS ups on battery
    Aug 9 08:02:16 	upsmon 	17459 	UPS ups on line power
    Aug 9 08:04:01 	upsmon 	17459 	UPS ups on battery
    Aug 9 08:05:16 	upsmon 	17459 	UPS ups on line power
    Aug 9 11:01:04 	upsmon 	17459 	Signal 15: exiting
    Aug 9 11:01:04 	upsd 	19154 	User local-monitor@::1 logged out from UPS [ups]
    Aug 9 11:01:04 	upsd 	19154 	mainloop: Interrupted system call
    Aug 9 11:01:04 	upsd 	19154 	Signal 15: exiting
    Aug 9 11:01:04 	usbhid-ups 	18838 	Signal 15: exiting
    Aug 9 11:01:04 	upsmon 	37412 	Startup successful
    Aug 9 11:01:05 	usbhid-ups 	38472 	Startup successful
    Aug 9 11:01:05 	upsd 	38680 	listening on 192.168.55.1 port 3493
    Aug 9 11:01:05 	upsd 	38680 	listening on 192.168.10.1 port 3493
    Aug 9 11:01:05 	upsd 	38680 	listening on ::1 port 3493
    Aug 9 11:01:05 	upsd 	38680 	listening on 127.0.0.1 port 3493
    Aug 9 11:01:05 	upsd 	38680 	Connected to UPS [ups]: usbhid-ups-ups
    Aug 9 11:01:05 	upsd 	38722 	Startup successful
    Aug 9 11:01:07 	upsd 	38722 	User local-monitor@::1 logged into UPS [ups] 
    

    I don't see any logs in the past. Does pfsense do circular logging? I'm thinking past logs were deleted or something but the weird thing is that I still have August 2 logs from other services so that couldn't be it. I'm not really sure.

    The most pressing matter though is why does the Synology GUI say that it is connected to the UPS but the pfsense system logs doesn't show that? What could be the issue here? I have a similar setup in two locations but this one has a Synology client and experiencing this issue.

    EDIT1:

    I did another test. Like I said, I have two locations and I have a site-to-site OpenVPN tunnel between them. I connected the Synology device to the UPS of the remote site and when I checked the pfsense system logs there, I also didn't see the monuser log that we're looking for. So this tells me that there is something wrong with the Synology device? I'm not really sure.

    EDIT2:

    I already tried reinstalling the NUT package to no avail. Here's what I see in Synology:

    77f59b28-21ce-4d41-92d6-1daf71a57e4a-image.png

    It does show the correct UPS statistics there so I know it's connecting.



  • @kevindd992002 said in NUT package:

    Does pfsense do circular logging?

    Yep (see manual - the clog stuff)

    Did you looked up the user name of your UPS ? I had to access the files (found them using the Syno forums) to see that the user/password were.
    I entered those into the UPS settings on pfSense (see above).



  • monuser/secret is the default username/password for Synology devices. It's interesting though:

    d06144d7-3fe5-4ea8-9e18-3544ff0deda7-image.png

    This means that my Synology's upsmon.conf file has nothing in it. @dennypage , do you know why? I also changed the password in the upsd.users settings of the pfsense master NUT service and my Synology slave still connected in the GUI and was able to obtain device information. It's as if that the Synology UPS does not use any authentication to connect to the pfsense slave.



  • @Gertjan and the UPS on the server must be named “ups”



  • @kevindd992002 said in NUT package:

    This means that my Synology's upsmon.conf file has nothing in it. @dennypage , do you know why? I also changed the password in the upsd.users settings of the pfsense master NUT service and my Synology slave still connected in the GUI and was able to obtain device information. It's as if that the Synology UPS does not use any authentication to connect to the pfsense slave.

    The upsd.users file on pfSense will be overwritten whenever the service re-saves.

    On the Syno you’re probably looking in the wrong place for the upsmon.conf file. They moved it a few releases back. Look to see what file gets modded.



  • @dennypage said in NUT package:

    @kevindd992002 said in NUT package:

    This means that my Synology's upsmon.conf file has nothing in it. @dennypage , do you know why? I also changed the password in the upsd.users settings of the pfsense master NUT service and my Synology slave still connected in the GUI and was able to obtain device information. It's as if that the Synology UPS does not use any authentication to connect to the pfsense slave.

    The upsd.users file on pfSense will be overwritten whenever the service re-saves.

    On the Syno you’re probably looking in the wrong place for the upsmon.conf file. They moved it a few releases back. Look to see what file gets modded.

    I meant I changed the password of the monuser user in the pfsense NUT GUI. So technically if I change that to some gibberish random string, the Syno won't be able to connect and get the ups device information, right? Or is that monuser account only used for monitoring alone?

    That's weird. All documentation I see in the Internet say that's the correct place for the upsmon.conf in a Syno. And regardless, you won't be able to change the Syno monuser account anyway, right?



  • @dennypage , do you still have any other ideas/clues as to why this is happening on my environment?



  • @kevindd992002 said in NUT package:

    monuser/secret is the default username/password for Synology devices. It's interesting though:

    d06144d7-3fe5-4ea8-9e18-3544ff0deda7-image.png

    This means that my Synology's upsmon.conf file has nothing in it. @dennypage , do you know why? I also changed the password in the upsd.users settings of the pfsense master NUT service and my Synology slave still connected in the GUI and was able to obtain device information. It's as if that the Synology UPS does not use any authentication to connect to the pfsense slave.

    Some of the previous information has to be incorrect.

    An empty upsmon.conf file would not only would this mean that there is no authentication, it would also mean that the Synology was able to magically intuit the IP address of the remote NUT master.

    I am running DSM 6.2.2-24922 Update 2.

    There are these "ups.conf" and "upsmon.conf" files:

    -rwxr-xr-x 1 root root 3935 May 9 15:51 /etc.defaults/ups/ups.conf
    -rwxr-xr-x 1 root root 3924 May 10 2015 /etc/ups/ups.conf
    -rw-r----- 1 root root 3935 May 9 15:51 /usr/syno/etc.defaults/ups/ups.conf
    -rw-r----- 1 root root 3898 Aug 11 15:08 /usr/syno/etc/ups/ups.conf
    -rw-r----- 1 root root 12150 May 9 15:51 /usr/syno/etc.defaults/ups/upsmon.conf
    -rw-r--r-- 1 root root 12150 Aug 11 15:08 /usr/syno/etc/ups/upsmon.conf

    The operational files currently appear in /usr/syno/etc/ups.

    With ups monitoring enabled on the Synology, /usr/syno/etc/ups/upsmon.conf cannot not be empty, regardless of the ups being local or remote.

    I would suggest you start from the ground up. Ignore pfSense for now. Update, reboot and reconfigure ups monitoring on the Synology. Confirm that it is updating /usr/syno/etc/ups/upsmon.conf as expected.



  • Also : login using 'root'.



  • @Gertjan said in NUT package:

    Also : login using 'root'.

    Lol. I thought that might be a Synology issue as well. I did test however, and was able to see the correct content of upsmon.conf using sudu.



  • @dennypage said in NUT package:

    @kevindd992002 said in NUT package:

    monuser/secret is the default username/password for Synology devices. It's interesting though:

    d06144d7-3fe5-4ea8-9e18-3544ff0deda7-image.png

    This means that my Synology's upsmon.conf file has nothing in it. @dennypage , do you know why? I also changed the password in the upsd.users settings of the pfsense master NUT service and my Synology slave still connected in the GUI and was able to obtain device information. It's as if that the Synology UPS does not use any authentication to connect to the pfsense slave.

    Some of the previous information has to be incorrect.

    An empty upsmon.conf file would not only would this mean that there is no authentication, it would also mean that the Synology was able to magically intuit the IP address of the remote NUT master.

    I am running DSM 6.2.2-24922 Update 2.

    There are these "ups.conf" and "upsmon.conf" files:

    -rwxr-xr-x 1 root root 3935 May 9 15:51 /etc.defaults/ups/ups.conf
    -rwxr-xr-x 1 root root 3924 May 10 2015 /etc/ups/ups.conf
    -rw-r----- 1 root root 3935 May 9 15:51 /usr/syno/etc.defaults/ups/ups.conf
    -rw-r----- 1 root root 3898 Aug 11 15:08 /usr/syno/etc/ups/ups.conf
    -rw-r----- 1 root root 12150 May 9 15:51 /usr/syno/etc.defaults/ups/upsmon.conf
    -rw-r--r-- 1 root root 12150 Aug 11 15:08 /usr/syno/etc/ups/upsmon.conf

    The operational files currently appear in /usr/syno/etc/ups.

    With ups monitoring enabled on the Synology, /usr/syno/etc/ups/upsmon.conf cannot not be empty, regardless of the ups being local or remote.

    I would suggest you start from the ground up. Ignore pfSense for now. Update, reboot and reconfigure ups monitoring on the Synology. Confirm that it is updating /usr/syno/etc/ups/upsmon.conf as expected.

    I'm on that latest version too. I have auto-update enabled on this Synology box so it's always updated.

    I udnerstand that a upsmon.conf is impossible but it is what I see and I don't have a clue as to why.

    @Gertjan , running sudo is the same as running the command as root. Anyway, I went in as root (sudo -i) and see the same thing.

    b59489a5-5505-4fcf-835a-c8973e8031ed-image.png

    2da88250-d50b-4974-a046-3390e8d2b8cf-image.png

    /usr/syno/etc.defaults/ups/upsmon.conf does have the contents that we expect but like mentioned this is not the operational file.

    @dennypage , I already did try disabling and re-enabling ups monitoring on Synology to no avail. Is it a time for a Synology support ticket now?



  • @kevindd992002 said in NUT package:

    @dennypage , I already did try disabling and re-enabling ups monitoring on Synology to no avail. Is it a time for a Synology support ticket now?

    Just for completeness, what does the command

    ls -lc /usr/syno/etc/ups
    

    show?



  • @dennypage said in NUT package:

    ls -lc /usr/syno/etc/ups

    root@Synology:~# ls -lc /usr/syno/etc/ups
    total 24
    -rw-r----- 1 root root 5515 May 15 03:20 nutscan-usb.h
    -rw-r----- 1 root root 3935 Aug  9 17:42 ups.conf
    -rw-r----- 1 root root   15 May 15 03:20 upsd.conf
    -rw-r----- 1 root root 2016 Aug  9 17:44 upsd.users
    -rw-r--r-- 1 root root    0 Aug  9 17:42 upsmon.conf
    -rw-r----- 1 root root 4020 Aug  9 17:42 upssched.conf
    

    upsmon.conf has read rights for root, root (group), and others so I should be able to read the contents.



  • @kevindd992002 said in NUT package:

    upsmon.conf has read rights for root, root (group), and others so I should be able to read the contents.

    Your upsmon.conf is a zero bytes file.

    Here mine for comparison :

    root@DiskStation:~# ls -lc /usr/syno/etc/ups
    total 36
    -rw-r----- 1 root root  5515 May 15 06:19 nutscan-usb.h
    -rw-r----- 1 root root  3935 Aug  7 17:12 ups.conf
    -rw-r----- 1 root root    15 May 15 06:19 upsd.conf
    -rw-r----- 1 root root  2016 May 15 06:19 upsd.users
    -rw-r--r-- 1 root root 12151 Aug  7 17:12 upsmon.conf
    -rw-r----- 1 root root  4051 Aug  7 17:12 upssched.conf
    

    It seems that only your upsmon.conf file is created correctly.
    Mine has 12151 bytes, yours none.

    edit : something in your (Syno GUI) settings makes the system complain, and it fails to create the config file ?



  • @Gertjan said in NUT package:

    @kevindd992002 said in NUT package:

    upsmon.conf has read rights for root, root (group), and others so I should be able to read the contents.

    Your upsmon.conf is a zero bytes file.

    Here mine for comparison :

    root@DiskStation:~# ls -lc /usr/syno/etc/ups
    total 36
    -rw-r----- 1 root root  5515 May 15 06:19 nutscan-usb.h
    -rw-r----- 1 root root  3935 Aug  7 17:12 ups.conf
    -rw-r----- 1 root root    15 May 15 06:19 upsd.conf
    -rw-r----- 1 root root  2016 May 15 06:19 upsd.users
    -rw-r--r-- 1 root root 12151 Aug  7 17:12 upsmon.conf
    -rw-r----- 1 root root  4051 Aug  7 17:12 upssched.conf
    

    It seems that only your upsmon.conf file is created correctly.
    Mine has 12151 bytes, yours none.

    edit : something in your (Syno GUI) settings makes the system complain, and it fails to create the config file ?

    Right, I notice that. You mean my upsmon.conf is NOT created correctly.

    Nothing complains in the Syno GUI but it doesn't follow any of the UPS master's (in pfsense) commands and there is no log in pfsense where the UPS is connecting to it using the monuser account.



  • @kevindd992002 said in NUT package:

    is NOT created correctly

    Yep, that right - sorry for the typo.

    I taled the main messages 'syslog' - it does show up some UPS related messages.

    Here I activate the UPs with the 192.168.1.1 == my pfSense.

    2019-08-20T17:26:39+02:00 DiskStation synoscgi_SYNO.Core.ExternalDevice.UPS_1_set[8663]: webapi-UPS.cpp:238 Set Service from Disable to Enable
    2019-08-20T17:26:41+02:00 DiskStation upsmon[8721]: Startup successful
    2019-08-20T17:26:41+02:00 DiskStation upsmon[8723]: UPS [ups@192.168.1.1] connected
    

    I used the command

    tail -f /var/log/messages
    

    Use also

    grep 'ups' /var/log/messages
    


  • @Gertjan said in NUT package:

    grep 'ups' /var/log/messages

    Thanks for the tip. Look at my /var/log/messages: https://pastebin.com/pGHXFzgp

    It looks like the last time my UPS connection worked properly was on 6/4/2019 which was a long time ago! I don't know what happened but I see a lot of these now:

    2019-06-04T17:58:02+08:00 Synology synoservice: synoservice.c:1559 pause gcpd du e to require service cupsd runkey is stop

    You have any clue as to what's that?



  • Your Syno clock is ok ?
    Or all messages from last month are missing ? Or did you only took a part of the log ?

    A fact is : it all changed here for you :

    2019-06-04T14:38:33+08:00 Synology synoups: [UPS] Check Boot Status.
    2019-06-04T14:38:33+08:00 Synology synoups: [UPS] Server is going to Safe Mode. It will stop all services and umount all volumes.
    

    I know you won't like the next advise : re-install de DSM ...... ;)



  • @Gertjan said in NUT package:

    A fact is : it all changed here for you :

    2019-06-04T14:38:33+08:00 Synology synoups: [UPS] Check Boot Status.
    2019-06-04T14:38:33+08:00 Synology synoups: [UPS] Server is going to Safe Mode. It will stop all services and umount all volumes.
    

    This entry in the log indicates that the Synology is waiting to have the power removed and restored.

    It's unlikely that the Synology has been sitting in safe mode (non functional) for 75 days. But if it hasn't been rebooted since then, I would certainly reboot it.



  • @dennypage
    The DSM was rebooted a lot of times since then. It certainly is not in safe mode because it is being used everyday.

    @Gertjan
    I posted a snippet of the result of the grep but did not skip in between lines, the clock is fine. Reinstalling DSM is my last resort, yes, but I have an open case with Snyology. Let me know if you have more ideas though.



  • @kevindd992002 said in NUT package:

    more ideas

    Yep, a nasty one.
    I'll post tomorrow the file upsmon.conf your missing, the one refuses to generate.
    You should edit it with your own settings - put in place - make it read only .... and start / restart the 'ups' demon.

    Here it is : https://pastebin.com/L1mqCb1Y

    Without the comments, these are the settings :

    RUN_AS_USER root
    
    MONITOR ups@192.168.1.1 1 monuser secret slave
    
    MINSUPPLIES 1
    
    SHUTDOWNCMD ""
    
    NOTIFYCMD /usr/sbin/upssched
    
    POLLFREQ 5
    
    POLLFREQALERT 5
    
    HOSTSYNC 15
    
    DEADTIME 90
    
    POWERDOWNFLAG /etc/killpower
    
    NOTIFYFLAG ONLINE EXEC
    NOTIFYFLAG ONBATT EXEC
    NOTIFYFLAG LOWBATT EXEC
    NOTIFYFLAG NOCOMM EXEC
    NOTIFYFLAG COMMBAD IGNORE
    NOTIFYFLAG COMMOK IGNORE
    NOTIFYFLAG SHUTDOWN IGNORE
    NOTIFYFLAG FSD EXEC
    NOTIFYFLAG NOPARENT SYSLOG
    
    RBWARNTIME 43200
    
    NOCOMMWARNTIME 300
    
    FINALDELAY 5
    

    My settings :

    51a65a27-05bc-469a-807f-25f1568a3587-image.png



  • @Gertjan

    Will Synology write the defaults in the file after restarting the ups daemon? I do have the correct upsmon.conf in etc.defaults/ so I can also use that (if it's the same as yours).



  • @kevindd992002 Given that the Synology isn’t writing the upsmon.conf file correctly, I wouldn’t count on it starting the upsmon service correctly either.



  • @Gertjan said in NUT package:

    grep 'ups' /var/log/messages

    Right. I'm at a loss here. I'm checking the syslog and messages log again and I do see the last successful connection of the Syno to my UPS NUT master was last 6/4/2019. Here's a more detailed view of the messages log file: https://pastebin.com/bXk7YEWf



  • @kevindd992002 Does "ps -elf" on the Synology show any ups processes running?



  • @dennypage said in NUT package:

    @kevindd992002 Does "ps -elf" on the Synology show any ups processes running?

    Looks like that's a no: https://pastebin.com/dKDHdg2w


Log in to reply