>> I am running NUT on a Synology NAS with attached a USB APC UPS. > > Do you have upsd and upsmon running as daemons on the Synology DSM? >Yes I have them both running on the Synology DSM: root 7236 1 0 Jun01 ? 00:00:16 /usr/sbin/upsd root 7741 1 0 Jun01 ? 00:00:00 /usr/sbin/upsmon root 7744 7741 0 Jun01 ? 00:00:12 /usr/sbin/upsmon> Does the NAS shut down (and restart) correctly when wall power fails?Yes it does and also the other Synology Nas which is attached via the network. It brings the Synology NAS in a safe-mode.> Is the Mac protected by the same APC UPS as the Synology NAS?Yes it is. The power cable of the Mac is connected to the APC UPS. The dataport of the APC UPS is connected via USB with the Synology NAS.> Do you have upsd and possibly upsmon running on the Mac?Standard not when I start, sudo upsmon -D, only upsmon and not upsd.> What does command ps -elf | grep -E "ups[dms]|nut? report on the Mac?With copy and paste the commando didn?t work. So I changed it. ps -elf | grep -E "ups[dms]|nut? 0 2919 2788 4106 0 31 0 2447248 10756 - S+ 0 ttys000 0:00.04 sudo upsmon -D 2:06PM 0 2920 2919 4006 0 31 0 2444528 2376 - S+ 0 ttys000 0:00.01 upsmon -D 2:06PM 0 2921 2920 106 0 31 0 2444528 2216 - S+ 0 ttys000 0:00.03 upsmon -D 2:06PM> From the NAS, can you execute commands such as > > upsc UPS at Mac ups.statusupsc UPS@<ip adres> ups.status Error: Connection failure: Connection refused> Does upsmon.conf on the NAS contain a MONITOR statement for the Mac?No it doesn?t and do I need to configure this.> Do you propose shutting down on LB or after a time interval: in other words, do you need upssched?I don?t know yet. Kind Regards, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170607/96a32954/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3583 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170607/96a32954/attachment.bin>
On Wed, 7 Jun 2017, Robbie van der Walle wrote:> I am running NUT on a Synology NAS with attached a USB APC UPS. > Do you have upsd and upsmon running as daemons on the Synology DSM? > Yes I have them both running on the Synology DSM:? > root? ? ? 7236 ? ? 1? 0 Jun01 ?? ? ? ? 00:00:16 /usr/sbin/upsd > root? ? ? 7741 ? ? 1? 0 Jun01 ?? ? ? ? 00:00:00 /usr/sbin/upsmon > root? ? ? 7744? 7741? 0 Jun01 ?? ? ? ? 00:00:12 /usr/sbin/upsmonI see upsd and the first upsmon are running as "root". They are often run as user "nut" or "upsd".> Does the NAS shut down (and restart) correctly when wall power fails? > Yes it does and also the other Synology Nas which is attached via the > network. It brings the Synology NAS in a safe-mode.?I don't know the Synology NAS, but I guess that unless it is shutdown completely, it will still draw power. Will the safe-mode drain the UPS completely, leading to a crash? Out of curiosity, when you shut down the NAS, do you run the command "upsdrvctl shutdown" ? Do you see or hear anything to suggest that the delayed UPS shutdown has happened?> Is the Mac protected by the same APC UPS as the Synology NAS? Yes > it is. The power cable of the Mac is connected to the APC UPS. The > dataport of the APC UPS is connected via USB with the Synology NAS.?Apart from these points, it looks as if NUT is running correctly on the Synology NAS. Now for the Mac: You will need to have upsmon running on the Mac with a MONITOR declaration of the form MONITOR UPS at NAS 1 <upsmaster> <password> slave Setting "slave" says that upsmon on the Mac is to shutdown the Mac as soon as LB is detected in the NAS. I suggest 1. Shutting down on LB rather than on a timer since it's easier to set up. 2. On the NAS, use command upsrw -s battery.charge.low=80 -u upsmaster -s sekret UPS to set the low limit very high during testing. This will speed up your testing. You can reset it to something else later. Roger
> I see upsd and the first upsmon are running as "root". They are often run as user "nut" or "upsd?.Apparently Synology has implemented it standard like this. Upsmon.conf on the Synology NAS: RUN_AS_USER root I suppose this needs to be changed from a security point of view.> I don't know the Synology NAS, but I guess that unless it is shutdown completely, it will still draw power. Will the safe-mode drain the UPS completely, leading to a crash?Good question and I don?t know the answer yet. This is what I can find about safe-mode means that all services are stopped and volumes (unmounted). So I quess it is not completely shut down and wil draw still power. I have to examine this.> Out of curiosity, when you shut down the NAS, do you run the command > "upsdrvctl shutdown" ? Do you see or hear anything to suggest that the delayed UPS shutdown has happened?I don?t know where to search to answer this. The delayed UPS shutdown means that Synology NAS will turn off the UPS after the delay? ups.delay.shutdown Interval to wait after shutdown with delay command (seconds). Shutdown of what? I don?t know what is means.> Now for the Mac: You will need to have upsmon running on the Mac > with a MONITOR declaration of the form > > MONITOR UPS at NAS 1 <upsmaster> <password> slave > > Setting "slave" says that upsmon on the Mac is to shutdown the Mac as soon as LB is detected in the NAS.On the Mac I have in upsmon.conf MONITOR ups@<ip address> 1 <user> <password> slave 2. On the NAS, use command upsrw -s battery.charge.low=80 -u upsmaster -s sekret UPS to set the low limit very high during testing. This will speed up your testing. You can reset it to something else later. When I run this command: upsc ups at localhost: battery.charge.low: 10 The commando upsrw cannot be found on the Synology NAS? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170607/8f80adde/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3583 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170607/8f80adde/attachment.bin>
On Jun 7, 2017, at 1:14 PM, Roger Price wrote:> > 2. On the NAS, use command > > upsrw -s battery.charge.low=80 -u upsmaster -s sekret UPSRobbie, The "upsrw" command contacts upsd, so it sounds like you should be able to add a user to upsd.users on the NAS, and then run something like this on the Mac: upsrw -s battery.charge.low=80 -u upsmaster -s sekret UPS at synology Per http://networkupstools.org/docs/man/upsd.users.html , the "upsmaster" user would need at least "actions = SET". You will need to reload upsd after changing upsd.users. If the UPS is not turning itself off after the NAS goes into safe mode, it might be possible to do this from the Mac. You probably have something like this in the Mac's upsmon.conf: SHUTDOWNCMD "/sbin/shutdown -h +0" You could add an UPS shutdown command before the Mac shutdown command: upscmd -u upsmaster -s sekret UPS at synology shutdown.stayoff but you would need to be sure that the UPS shutdown delay is long enough to allow the NAS to go into safe mode. (This is why it is recommended that the master (the NAS in your case) initiate the UPS shutdown.) Also, you would need to configure that NUT user to allow instant commands in upsd.users as well as upsrw access.