NUT package (2.8.0 and below)
-
@kevindd992002 said in NUT package:
monuser/secret is the default username/password for Synology devices. It's interesting though:
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.confThe 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:
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.confThe 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.
/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 :
-
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
-
@kevindd992002 Just for grins...
Last ditch effort if I owned that Synology...
Disable UPS support on the Synology, reboot the Synology, and then re-enable UPS support on the Synology.
Btw out of curiosity, what model of Synology is it?
-
@dennypage said in NUT package:
@kevindd992002 Just for grins...
Last ditch effort if I owned that Synology...
Disable UPS support on the Synology, reboot the Synology, and then re-enable UPS support on the Synology.
Btw out of curiosity, what model of Synology is it?
Ok, I just did that and checked upsmon.conf and /var/log/messages, same exact results :(
I'm using a DS1817+, so it's a pretty recent model.
-
@kevindd992002 said in NUT package:
Will Synology write the defaults in the file after restarting the ups daemon?
I do not have the command for you how to start upsmon manually, but you'll find it on Google ^^ Like https://diktiosolutions.eu/en/synology/synology-ups-nut-en/
This will not generate the config file : as pfSense, when you start (or activate) it using the GUI all the config files are build,
I was curious : if only the config file building faulted, the process never gets started - but if that file is ok, and you start manually, then that's something that indicated that the GUI is at fault.@kevindd992002 said in NUT package:
I do have the correct upsmon.conf in etc.defaults/ so I can also use that (if it's the same as yours).
It should / could be somewhat different : like another master IP etc.
Strange.
I have nothing in this directoryroot@DiskStation:/etc/defaults# ll total 12 drwxr-xr-x 2 root root 4096 Jul 10 2013 . drwxr-xr-x 51 root root 4096 Aug 20 20:47 .. -rw-r--r-- 1 root root 459 Mar 4 2013 rc.conf
-
@Gertjan said in NUT package:
@kevindd992002 said in NUT package:
Will Synology write the defaults in the file after restarting the ups daemon?
I do not have the command for you how to start upsmon manually, but you'll find it on Google ^^ Like https://diktiosolutions.eu/en/synology/synology-ups-nut-en/
This will not generate the config file : as pfSense, when you start (or activate) it using the GUI all the config files are build,
I was curious : if only the config file building faulted, the process never gets started - but if that file is ok, and you start manually, then that's something that indicated that the GUI is at fault.@kevindd992002 said in NUT package:
I do have the correct upsmon.conf in etc.defaults/ so I can also use that (if it's the same as yours).
It should / could be somewhat different : like another master IP etc.
Strange.
I have nothing in this directoryroot@DiskStation:/etc/defaults# ll total 12 drwxr-xr-x 2 root root 4096 Jul 10 2013 . drwxr-xr-x 51 root root 4096 Aug 20 20:47 .. -rw-r--r-- 1 root root 459 Mar 4 2013 rc.conf
Yeah, that makes sense. I think the GUI is at fault here. It's just weird that when I change the UPS IP to an IP that I know is not used, the GUI also errors out, making it like it's connecting properly to the UPS.
It's /usr/syno/etc.defaults/ups
-
On another note, how do I "reset" the battery install date on my UPS for every time I install a new battery? Similar to how PowerChute does it?
-
@kevindd992002 said in NUT package:
On another note, how do I "reset" the battery install date on my UPS for every time I install a new battery? Similar to how PowerChute does it?
Good question.
I used Pan B : I'll hook them up to a PC with run PowerShute, and use that tool to reset the counter.
(otherwise I have to reverse engineer a binary Windows app to see what communication goes over the USB wire .... or read the complete NUTS manual ....) -
@Gertjan said in NUT package:
@kevindd992002 said in NUT package:
On another note, how do I "reset" the battery install date on my UPS for every time I install a new battery? Similar to how PowerChute does it?
Good question.
I used Pan B : I'll hook them up to a PC with run PowerShute, and use that tool to reset the counter.
(otherwise I have to reverse engineer a binary Windows app to see what communication goes over the USB wire .... or read the complete NUTS manual ....)Yeah, I mean I can always do that but I just want to know if there's a NUT command that can do the same action.
As for my UPS issue, here's a some kind of useless reply from Synology (as I half expected):
Dear Customer,Thank you for contacting Synology support.
As the design, the configuration will be rewrite after you set up in DSM.
And we checked the system seems like we can get contact to UPS properly.
root@Synology:~# upsmon -D
Network UPS Tools upsmon DSM6-2-2-24922-nano-1-C5-190604
kill: No such process
0.000000 UPS: ups@192.168.10.1 (slave) (power value 1)
0.000344 Using power down flag file /etc/killpower
0.000924 debug level is '1'
0.006931 Trying to connect to UPS [ups@192.168.10.1]
0.009822 Logged into UPS ups@192.168.10.1
0.010296 UPS [ups@192.168.10.1] connected
Executing command: online
^C 50.141267 Signal 2: exitingWould you like to tell us other finding, since the login log may need to refer to your configuration of NUT master.
Looking forward to your messages.
-
Oh wait! They're not useless after all. It looks like they did something and now my upsmon.conf file is populated with the expected contents! And I can see the monuser account logged in in my pfsense ups logs :) I'll ask what they did, because they had remote access to my Syno. I see this in my /var/log/messages now:
2019-08-26T10:17:51+08:00 Synology upsmon[25917]: Startup successful 2019-08-26T10:17:51+08:00 Synology upsmon[25919]: UPS [ups@192.168.10.1] connected 2019-08-26T10:55:26+08:00 Synology upsmon[25919]: Poll UPS [ups@192.168.10.1] failed - Server disconnected 2019-08-26T10:55:55+08:00 Synology SystemInfo.cgi: ups_info_get.c:97 Can't get UPS status[0] 2019-08-26T10:59:04+08:00 Synology upsmon[25919]: UPS [ups@192.168.10.1] connected 2019-08-26T13:59:23+08:00 Synology upsmon[5713]: Startup successful 2019-08-26T13:59:23+08:00 Synology upsmon[5715]: UPS [ups@192.168.10.1] connected
-
@kevindd992002 said in NUT package:
@dennypage
On another note, how do I "reset" the battery install date on my UPS for every time I install a new battery? Similar to how PowerChute does it?You can run upsrw and see what variables are exposed by the UPS. I believe the variable you are looking for is "battery.date". If it's there, you can update it via the "-s" option.
-
@kevindd992002 said in NUT package:
Oh wait! They're not useless after all. It looks like they did something and now my upsmon.conf file is populated with the expected contents! And I can see the monuser account logged in in my pfsense ups logs :) I'll ask what they did, because they had remote access to my Syno.
I'm also very interested to know what they changed.
-
@dennypage said in NUT package:
@kevindd992002 said in NUT package:
Oh wait! They're not useless after all. It looks like they did something and now my upsmon.conf file is populated with the expected contents! And I can see the monuser account logged in in my pfsense ups logs :) I'll ask what they did, because they had remote access to my Syno.
I'm also very interested to know what they changed.
Their reply, lol:
Dear Customer,Thank you for contacting Synology support.
Like the mail last time, we can't find the root cause from the log.
We are still tracing this case, if you have more clues it will be helpful to let us know.
The design of this configuration will be modify once you connect to other device.
And we just copy it from the etc.default. Please check if there are any problem or not.
Also just recommendation, if the upsmon.conf lose its content again please tell us, and let us check.
Please don't copy it from etc.default by yourself because there might be some symptom to let us know the root cause.
Thank you for your patience, and sorry for any inconvenience caused.
-
Last 10/3/2019 there was a power failure and I received a message from my Syno:
Dear user, The UPS connected to Synology has reached low battery. All services are shut down. The services will be restarted once the UPS is recovered. Sincerely, Synology DiskStation
This is expected. It happened 5:47PM and then at 10:39PM I received this:
Dear user, Synology suffered from power failure and was shut down improperly. Sincerely, Synology DiskStation
I then checked my Syno's upsmon.conf and it is 0 bytes again! I don't know what could've caused this but I'll report back to Syno support as they requested last time. So between 5:47PM and 10:39PM, that conf file got corrupted again for some reason, and was the cause of the improper shutdown.
-
@kevindd992002 Did you have the HOSTSYNC setting in the upsmon.conf section?
-
@dennypage said in NUT package:
@kevindd992002 Did you have the HOSTSYNC setting in the upsmon.conf section?
Yes I did, for 120 seconds. That's what I thought at first but digging through the logs of pfsense, the power went out again at 8:15PM and came back at 10:39PM. And what I think happened is the upsmon.conf file was reverted to 0 bytes right after the Syno turned on when the power went back on at 6:15PM. So at 6:15PM, the Syno never was able to connect to the NUT master.
-
@kevindd992002 That's pretty strange (scary). Other than talking with Synology, the only thing I can think to suggest is to double check that your Synology can easily shut down in 120 seconds. Mine used to shutdown in under 60 seconds. I just retested (glad I did) and I'm seeing it now at 90 seconds. I don't know if the change is due to a newer DSM or because of changes I've made with Surveillance Station.
-
@dennypage said in NUT package:
@kevindd992002 That's pretty strange (scary). Other than talking with Synology, the only thing I can think to suggest is to double check that your Synology can easily shut down in 120 seconds. Mine used to shutdown in under 60 seconds. I just retested (glad I did) and I'm seeing it now at 90 seconds. I don't know if the change is due to a newer DSM or because of changes I've made with Surveillance Station.
I thought of that and it was fine when there was a blackout like a few days ago before Oct 3. So it's got to be the upsmon.conf issue again.
-
@kevindd992002 said in NUT package:
I thought of that and it was fine when there was a blackout like a few days ago before Oct 3. So it's got to be the upsmon.conf issue again.
Cool. Just checking.
Seems pretty clear that Synology has a bug in their nut configuration management.
-
Hello All,
The issue I am having may have been answered already but there are several posts here and I haven't been able to find my answer. Anyways....I have a Tripp Lite SMART1500LCD. It is plugged into my pfsense router; it is an old Dell R210 server running just pfsense. It appears I have everything set up correctly and pfsense is seeing my UPS. I also have my FreeNAS set up as a slave and it can see the UPS through the pfsense box. When I cut the power to test the shutdown process, FreeNAS shuts down after 60 seconds; which is how I have it setup. FreeNAS is working how I want it to. The issue I am having is my pfsense box IS NOT shutting down. When I tested it, the UPS completely ran out of battery and pfsense never initiated the shutdown sequence. I tried using the commands suggested on here in the ups.conf but they don't do anything. I attached some screenshots. of my pfsense UPS settings.
-
@tensi0n519 You have the UPS configured to ignore the low battery signal, and to not initiate a shutdown until the ups is under 5% or 60 seconds of runtime. Note that the 5% and 60 second values are determined by polling (every 30 seconds) rather than by signal from the UPS. This ends up being a very narrow margin for conducting a shutdown.
NUT provides no native way to initiate shutdown within X seconds of going on battery. You can initiate shutdown based on a low battery signal from the UPS (default), or values such as % or runtime calculated from the UPS status.
Things to do:
- Remove ignorelb from configuration. ignorelb is used to work around UPSs that send an immediate low battery signal as soon as the UPS goes on battery. The Tripp Lite does not do this.
- Either remove the % or increase it to a minimum of 15-20%. If it were me, I would simply delete this parameter.
- Either remove the runtime or increase it to a minimum of 120. If it were me, I would use a value of 300.
The higher the values for % and runtime, the easier it is on the battery. And the safer it is for shutdown.
-
@dennypage said in NUT package:
@tensi0n519 You have the UPS configured to ignore the low battery signal, and to not initiate a shutdown until the ups is under 5% or 60 seconds of runtime. Note that the 5% and 60 second values are determined by polling (every 30 seconds) rather than by signal from the UPS. This ends up being a very narrow margin for conducting a shutdown.
NUT provides no native way to initiate shutdown within X seconds of going on battery. You can initiate shutdown based on a low battery signal from the UPS (default), or values such as % or runtime calculated from the UPS status.
Things to do:
- Remove ignorelb from configuration. ignorelb is used to work around UPSs that send an immediate low battery signal as soon as the UPS goes on battery. The Tripp Lite does not do this.
- Either remove the % or increase it to a minimum of 15-20%. If it were me, I would simply delete this parameter.
- Either remove the runtime or increase it to a minimum of 120. If it were me, I would use a value of 300.
The higher the values for % and runtime, the easier it is on the battery. And the safer it is for shutdown.
@dennypage , how do you totally delete the %? Can you put a blank value in the charge.low parameter in the extra arguments for the driver field?
-
@kevindd992002 said in NUT package:
@dennypage , how do you totally delete the %? Can you put a blank value in the charge.low parameter in the extra arguments for the driver field?
Delete the line that says "override.battery.charge.low = 5" from the Additional configuration lines for ups.conf text input box. Be sure to delete the "ignorelb" line as well.
When you are done, the Additional configuration lines for ups.conf section should either be completely empty, or have a single line that says "override.battery.runtime.low = 300"