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.
> 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 <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.I managed to do this, upsc reports: battery.charge.low: 80 instead of 10 What is the purpose of changing this value?> 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.I have SHUTDOWNCMD "/sbin/shutdown -h +0? now on the Mac is was SHUTDOWNCMD ?? before. How do I check if the UPS is turning itself off after the NAS goes into safe mode? Kind regards, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170608/da99832d/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/20170608/da99832d/attachment.bin>
On 6/8/2017 7:44 AM, Robbie van der Walle wrote:>> 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 <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. > > > > I managed to do this, upsc reports: > > battery.charge.low: 80 instead of 10 > > What is the purpose of changing this value?Once the UPS loses line power (and goes on the battery) it will wait for a configurable amount of time before it will attempt to shut down the hosts computers. Normally, this is when the battery charge gets down to a low level, identified by the battery.charge.low setting. When it is set to 10, that means NUT won't attempt to shut down the hosts until the battery gets down to 10% charge. This can take a while, and can make testing difficult. If you change this value to 80, then it will happen a lot sooner (when the battery gets down to an 80% charge). After you're all done with your testing and your configuration is working the way you want, you'll want to come back to this and set it back to a reasonable value, like 10.> > > >> 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. > > > > I have SHUTDOWNCMD "/sbin/shutdown -h +0? now on the Mac is was SHUTDOWNCMD ?? before. > > > How do I check if the UPS is turning itself off after the NAS goes into safe mode?By this, they mean when the UPS cuts the power to its "switched" outlets - these are the outlets into which your host computers should be connected for power. One easy way to tell when this happens is to just plug a lamp into one of the switched outlets (most UPS models have 3 or 4 switched outlets - make sure you're using these). Then when the lamp goes off, you know the UPS has cut power to the switched outlets.> > > > > Kind regards, > > Rob > > > > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser >
On Thu, 8 Jun 2017, Robbie van der Walle wrote:> 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. > > I managed to do this, upsc reports:? > > battery.charge.low: 80 instead of 10? > What is the purpose of changing this value?When you carry out tests to ensure that the setup is working well, you will pull the power cord from the wall and wait until the UPS reaches LB. This means waiting and wasting time. You can speed up the testing by setting LB very high so that the UPS reaches it quickly. Later you can set a more reasonable value.> 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. > > I have SHUTDOWNCMD "/sbin/shutdown -h +0? now on the Mac is was SHUTDOWNCMD ?? before.> How do I check if the UPS is turning itself off after the NAS goes into safe mode??On most UPS units, there is a light which goes out. Some produce an audible clunk as the relays disconnect the UPS power outlets. You could also connect a light bulb to a protected outlet. It should go out when the UPS shuts down. Example test: 1. Pull power cord from wall 2. UPS beeps, NAS and Mac continue operation 3. Users are warned that power has failed 4. When the battery drops to battery.charge.low the slave (Mac) and then the master (NAS) shutdown. 5. After 20 seconds the UPS shuts down. 6. Reconnect the wall power 7. NAS and Mac should restart You will also need a test in which you wait a long time before step 6, and a test in which you reconnect power between steps 4 and 5. Roger