Re: [Nut-upsuser] Help with Elite 800VA usb UPS
> root@artu:~# /lib/nut/nutdrv_qx -a Elit -u nut -D > Network UPS Tools - Generic Q* USB/Serial driver 0.06 (2.7.2) > USB communication driver 0.32 >0.00 debug level is '5' ... >0.574759 send: Q1 >0.807418 received 46 (40) >0.807475 read: (225.3 140.0 222.6 015 49.9 13.8 30.0 1001 >0.807516 qx_process_answer: short reply (input.voltage) hmm, apparently the UPS doesn't close the replies to our queries with the expected CR and we (I) did not consider that case in nutdrv_qx -- noted: https://github.com/networkupstools/nut/issues/441 But blazer_usb, being less strict on the terminating CR of Q1 replies, should work with your device. > root@artu:~# upsc Elit@artu > Init SSL without certificate database > Error: Driver not connected aehm, was the blazer_usb driver running? ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
> Alternatively, on 10.12 and 10.11, there is a "-u" option to shutdown: > > -u The system is halted up until the point of removing system power, > but waits before removing power for 5 minutes so that an external UPS > (uninterruptible power supply) can forcibly remove power. This simulates a > dirty shutdown to permit a later automatic power on. OS X uses this mode > automatically with supported UPSs in emergency shutdowns. > > Let us know what works. (I have NUT set up on a Mac Mini, but we do not get > frequent power outages, and the machine is set to wake up on a schedule > anyway.) SHUTDOWNCMD "/sbin/shutdown -u -h +0” in upsmon.conf on the Mac did the trick. Thanks! After power is restored, the Mac starts. What I wonder if the shutdown is done proper. Does the shutdown command use umount to prevent disk corruption? I also have to find a solution for starting up upsmon when the Mac starts and also still open is the notification on the Mac. But thanks so much all for the steps so far. Kind Regards, Rob > On 9 Jun 2017, at 14:42, Charles Lepplewrote: > > On Jun 9, 2017, at 4:47 AM, Robbie van der Walle > wrote: >> >>> Under System Preferences, Energy Saver, there is a setting Start up >>> automatically after a power failure. >>> Running sudo pmset -a autorestart 1 does the same trick. >> >> But unfortunately Mac stays . Step 7 >> > > You might want to save off the output of "pmset -g" before experimenting > further - that way, after you find a solution, you can run it again to see > what changed. > > This page implies that the "sudo" and "-a" are not needed: > > > http://www.virtuallyghetto.com/2013/02/enable-auto-startup-after-power-failure.html > > Also potentially useful, though I can't imagine it is changing different > settings under the hood: > > > https://macminicolo.net/blog/files/Be-sure-your-Mac-mini-will-restart-automatically-when-needed.html > > Alternatively, on 10.12 and 10.11, there is a "-u" option to shutdown: > > -u The system is halted up until the point of removing system power, > but waits before removing power for 5 minutes so that an external UPS > (uninterruptible power supply) can forcibly remove power. This simulates a > dirty shutdown to permit a later automatic power on. OS X uses this mode > automatically with supported UPSs in emergency shutdowns. > > Let us know what works. (I have NUT set up on a Mac Mini, but we do not get > frequent power outages, and the machine is set to wake up on a schedule > anyway.) smime.p7s Description: S/MIME cryptographic signature ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
On Jun 9, 2017, at 4:47 AM, Robbie van der Wallewrote: > >> Under System Preferences, Energy Saver, there is a setting Start up >> automatically after a power failure. >> Running sudo pmset -a autorestart 1 does the same trick. > > But unfortunately Mac stays . Step 7 > You might want to save off the output of "pmset -g" before experimenting further - that way, after you find a solution, you can run it again to see what changed. This page implies that the "sudo" and "-a" are not needed: http://www.virtuallyghetto.com/2013/02/enable-auto-startup-after-power-failure.html Also potentially useful, though I can't imagine it is changing different settings under the hood: https://macminicolo.net/blog/files/Be-sure-your-Mac-mini-will-restart-automatically-when-needed.html Alternatively, on 10.12 and 10.11, there is a "-u" option to shutdown: -u The system is halted up until the point of removing system power, but waits before removing power for 5 minutes so that an external UPS (uninterruptible power supply) can forcibly remove power. This simulates a dirty shutdown to permit a later automatic power on. OS X uses this mode automatically with supported UPSs in emergency shutdowns. Let us know what works. (I have NUT set up on a Mac Mini, but we do not get frequent power outages, and the machine is set to wake up on a schedule anyway.) ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
>> After the first test and the NAS is restarted I had to change the setting >> battery.charge.low again to 80 > > Does the NAS DSM reset battery.charge.low to 10 or is it internal to the UPS? > You will have to experiment by disconnecting the UPS control lead from the > NAS and connecting it (if possible) to the Mac. After setting to 80 and a > power off-on cycle is the value 80 or 10? Ok I will have try this. I am also searching on the NAS if it set somehow. >> 3. Users from the NAS are warned, not yet the Mac user. Only when executing >> automatic power-fail shutdown. > > In upsmon.conf on the Mac, what are the values of NOTIFYMSG ONBATT and > NOTIFYFLAG ONBATT? Does program wall work on the Mac? It fails on a lot of > Linux boxes with graphical interfaces - to get a message to the user, you > have to use notify-send, which means setting up upssched. # NOTIFYMSG - change messages sent by upsmon when certain events occur # # You can change the default messages to something else if you like. # # NOTIFYMSG "message" # # NOTIFYMSG ONLINE "UPS %s on line power" # NOTIFYMSG ONBATT "UPS %s on battery" # NOTIFYMSG LOWBATT "UPS %s battery is low" # NOTIFYMSG FSD "UPS %s: forced shutdown in progress" # NOTIFYMSG COMMOK "Communications with UPS %s established" # NOTIFYMSG COMMBAD "Communications with UPS %s lost" # NOTIFYMSG SHUTDOWN"Auto logout and shutdown proceeding" # NOTIFYMSG REPLBATT"UPS %s battery needs to be replaced" # NOTIFYMSG NOCOMM "UPS %s is unavailable" # NOTIFYMSG NOPARENT"upsmon parent process died - shutdown impossible" # # Note that %s is replaced with the identifier of the UPS in question. # # Possible values for : # # ONLINE : UPS is back online # ONBATT : UPS is on battery # LOWBATT : UPS has a low battery (if also on battery, it's "critical") # FSD : UPS is being shutdown by the master (FSD = "Forced Shutdown") # COMMOK : Communications established with the UPS # COMMBAD : Communications lost to the UPS # SHUTDOWN : The system is being shutdown # REPLBATT : The UPS battery is bad and needs to be replaced # NOCOMM : A UPS is unavailable (can't be contacted for monitoring) # NOPARENT : The process that shuts down the system has died (shutdown impossible) # -- # NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur # # By default, upsmon sends walls (global messages to all logged in users) # and writes to the syslog when things happen. You can change this. # # NOTIFYFLAG [+][+] ... # # NOTIFYFLAG ONLINE SYSLOG+WALL # NOTIFYFLAG ONBATT SYSLOG+WALL # NOTIFYFLAG LOWBATTSYSLOG+WALL # NOTIFYFLAG FSDSYSLOG+WALL # NOTIFYFLAG COMMOK SYSLOG+WALL # NOTIFYFLAG COMMBADSYSLOG+WALL # NOTIFYFLAG SHUTDOWN SYSLOG+WALL # NOTIFYFLAG REPLBATT SYSLOG+WALL # NOTIFYFLAG NOCOMM SYSLOG+WALL # NOTIFYFLAG NOPARENT SYSLOG+WALL # # Possible values for the flags: # # SYSLOG - Write the message in the syslog # WALL - Write the message to all users on the system # EXEC - Execute NOTIFYCMD (see above) with the message # IGNORE - Don't do anything # # If you use IGNORE, don't use any other flags on the same line. 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 > Does program wall work on the Mac? file testwall: hallo tried: wall testwall and result: Broadcast Message from (/dev/ttys002) at 11:28 CEST... hallo So wall work in a terminal only. > It fails on a lot of Linux boxes with graphical interfaces - to get a message > to the user, you have to use notify-send, which means setting up upssched. # NOTIFYCMD # # upsmon calls this to send messages when things happen # # This command is called with the full text of the message as one argument. # The environment string NOTIFYTYPE will contain the type string of # whatever caused this event to happen. # # Note that this is only called for NOTIFY events that have EXEC set with # NOTIFYFLAG. See NOTIFYFLAG below for more details. # # Making this some sort of shell script might not be a bad idea. For more # information and ideas, see pager.txt in the docs directory. # # Example: # NOTIFYCMD /usr/local/ups/bin/notifyme NOTIFYCMD /sw/sbin/upssched Results second test 1 after changing on NAS, Control Panel Hardware & Power, Power recovery, Restart automatically after a power failure. And changing on the Mac, system preferences, energy saver, start up automatically after a power failure. 1 Pull power cord 2 Ups beeps NAS and Mac work 3 NAS users warned. Mac not 4 low bat, first slave Mac
Re: [Nut-upsuser] Apple Mac slave
>> After the first test and the NAS is restarted I had to change the setting >> battery.charge.low again to 80 > > Does the NAS DSM reset battery.charge.low to 10 or is it internal to the UPS? > You will have to experiment by disconnecting the UPS control lead from the > NAS and connecting it (if possible) to the Mac. After setting to 80 and a > power off-on cycle is the value 80 or 10? Ok I will have try this. I am also searching on the NAS if it set somehow. >> 3. Users from the NAS are warned, not yet the Mac user. Only when executing >> automatic power-fail shutdown. > > In upsmon.conf on the Mac, what are the values of NOTIFYMSG ONBATT and > NOTIFYFLAG ONBATT? Does program wall work on the Mac? It fails on a lot of > Linux boxes with graphical interfaces - to get a message to the user, you > have to use notify-send, which means setting up upssched. #NOTIFYMSG ONBAT NOTIFYFLAG ONBATT EXEC > Does program wall work on the Mac? file testwall: hallo tried: wall testwall and result: Broadcast Message from (/dev/ttys002) at 11:28 CEST... hallo So wall work in a terminal only. > It fails on a lot of Linux boxes with graphical interfaces - to get a message > to the user, you have to use notify-send, which means setting up upssched. # NOTIFYCMD NOTIFYCMD /sw/sbin/upssched Results second test 1 after changing on NAS, Control Panel Hardware & Power, Power recovery, Restart automatically after a power failure. And changing on the Mac, system preferences, energy saver, start up automatically after a power failure. 1 Pull power cord 2 Ups beeps NAS and Mac work 3 NAS users warned. Mac not 4 low bat, first slave Mac shutdown. Than Master NAS shutdown. ( report in log NAS, server is on battery, server going to safe shutdown) 5 UPS shutdown after 29 seconds. 6 reconnect power 7 NAS now starts up but Mac doesn’t Kind Regards, Rob smime.p7s Description: S/MIME cryptographic signature ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
On Fri, 9 Jun 2017, Robbie van der Walle wrote: # NOTIFYMSG - change messages sent by upsmon when certain events occur # # You can change the default messages to something else if you like. # # NOTIFYMSG "message" # # NOTIFYMSG ONLINE "UPS %s on line power" # NOTIFYMSG ONBATT "UPS %s on battery" # NOTIFYMSG LOWBATT "UPS %s battery is low" # NOTIFYMSG FSD "UPS %s: forced shutdown in progress" # NOTIFYMSG COMMOK "Communications with UPS %s established" # NOTIFYMSG COMMBAD "Communications with UPS %s lost" # NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding" # NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced" # NOTIFYMSG NOCOMM "UPS %s is unavailable" # NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible" # Lots more lines of comments. Please remove comments and blank lines before posting in mailing lists. I gave up reading. Roger ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
>> After the first test and the NAS is restarted I had to change the setting >> battery.charge.low again to 80 > > Does the NAS DSM reset battery.charge.low to 10 or is it internal to the UPS? > You will have to experiment by disconnecting the UPS control lead from the > NAS and connecting it (if possible) to the Mac. After setting to 80 and a > power off-on cycle is the value 80 or 10? Ok I will have try this. I am also searching on the NAS if it set somehow. >> 3. Users from the NAS are warned, not yet the Mac user. Only when executing >> automatic power-fail shutdown. > > In upsmon.conf on the Mac, what are the values of NOTIFYMSG ONBATT and > NOTIFYFLAG ONBATT? Does program wall work on the Mac? It fails on a lot of > Linux boxes with graphical interfaces - to get a message to the user, you > have to use notify-send, which means setting up upssched. # NOTIFYMSG ONLINE "UPS %s on line power" # NOTIFYMSG ONBATT "UPS %s on battery" # NOTIFYMSG LOWBATT "UPS %s battery is low" # NOTIFYMSG FSD "UPS %s: forced shutdown in progress" # NOTIFYMSG COMMOK "Communications with UPS %s established" # NOTIFYMSG COMMBAD "Communications with UPS %s lost" # NOTIFYMSG SHUTDOWN"Auto logout and shutdown proceeding" # NOTIFYMSG REPLBATT"UPS %s battery needs to be replaced" # NOTIFYMSG NOCOMM "UPS %s is unavailable" # NOTIFYMSG NOPARENT"upsmon parent process died - shutdown impossible" 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 > Does program wall work on the Mac? file testwall: hallo tried: wall testwall and result: Broadcast Message from (/dev/ttys002) at 11:28 CEST... hallo So wall work in a terminal only. > It fails on a lot of Linux boxes with graphical interfaces - to get a message > to the user, you have to use notify-send, which means setting up upssched. # NOTIFYCMD # # upsmon calls this to send messages when things happen # # This command is called with the full text of the message as one argument. # The environment string NOTIFYTYPE will contain the type string of # whatever caused this event to happen. # # Note that this is only called for NOTIFY events that have EXEC set with # NOTIFYFLAG. See NOTIFYFLAG below for more details. # # Making this some sort of shell script might not be a bad idea. For more # information and ideas, see pager.txt in the docs directory. # # Example: # NOTIFYCMD /usr/local/ups/bin/notifyme NOTIFYCMD /sw/sbin/upssched Results second test 1 after changing on NAS, Control Panel Hardware & Power, Power recovery, Restart automatically after a power failure. And changing on the Mac, system preferences, energy saver, start up automatically after a power failure. 1 Pull power cord 2 Ups beeps NAS and Mac work 3 NAS users warned. Mac not 4 low bat, first slave Mac shutdown. Than Master NAS shutdown. ( report in log NAS, server is on battery, server going to safe shutdown) 5 UPS shutdown after 29 seconds. 6 reconnect power 7 NAS now starts up but Mac doesn’t Kind Regards, Rob smime.p7s Description: S/MIME cryptographic signature ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
>> 7. No they didn’t restart. I know there is a setting on the NAS to activate >> this. I will check and try again. > > Not sure for the NAS, but for the Mac, it is probably something like this: > > sudo pmset -a autorestart 1 > > There is also usually a checkbox in the Energy Saver panel in the System > Preferences GUI. Under System Preferences, Energy Saver, there is a setting Start up automatically after a power failure. Running sudo pmset -a autorestart 1 does the same trick. But unfortunately Mac stays . Step 7 I will try again. Kind Regards, Rob smime.p7s Description: S/MIME cryptographic signature ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Apple Mac slave
On Thu, 8 Jun 2017, Robbie van der Walle wrote: After the first test and the NAS is restarted I had to change the setting battery.charge.low again to 80 Does the NAS DSM reset battery.charge.low to 10 or is it internal to the UPS? You will have to experiment by disconnecting the UPS control lead from the NAS and connecting it (if possible) to the Mac. After setting to 80 and a power off-on cycle is the value 80 or 10? 3. Users from the NAS are warned, not yet the Mac user. Only when executing automatic power-fail shutdown. In upsmon.conf on the Mac, what are the values of NOTIFYMSG ONBATT and NOTIFYFLAG ONBATT? Does program wall work on the Mac? It fails on a lot of Linux boxes with graphical interfaces - to get a message to the user, you have to use notify-send, which means setting up upssched. 7. No they didn’t restart. I know there is a setting on the NAS to activate this. I will check and try again. Does the NAS have a BIOS option "Power on when AC resumes"? Roger ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Help with Elite 800VA usb UPS
Use the name from ups.conf in front of "@localhost". The result is quite different ;) root@artu:~# upsc Elit@artu Init SSL without certificate database Error: Driver not connected > What if you try nutdrv_qx without specifying megatec? (It should > autodetect.) > Here is the result: root@artu:~# upsdrvctl start Network UPS Tools - UPS driver controller 2.7.2 Network UPS Tools - Generic Q* USB/Serial driver 0.06 (2.7.2) USB communication driver 0.32 Device not supported! Device not supported! Driver failed to start (exit status=1) > If that doesn't work, please try to get some logs - they will look like > this: > >http://lists.alioth.debian.org/pipermail/nut-upsuser/ > 2017-March/010555.html > > The author of the driver recommends a debug level of 5: "-D" > > (Note that we are not looking for the debug output for upsdrvctl, but > rather for nutdrv_qx. If you pass "-D" flags to upsdrvctl, it should tell > you how to start the driver in debug mode instead.) Here is the output of debug level 5: root@artu:~# /lib/nut/nutdrv_qx -a Elit -u nut -D Network UPS Tools - Generic Q* USB/Serial driver 0.06 (2.7.2) USB communication driver 0.32 0.00 debug level is '5' 0.001187 upsdrv_initups... 0.414464 Checking device (1D6B/0001) (006/001) 0.477567 - VendorID: 1d6b 0.477611 - ProductID: 0001 0.477619 - Manufacturer: unknown 0.477627 - Product: unknown 0.477634 - Serial Number: unknown 0.477648 - Bus: 006 0.477656 Trying to match device 0.477668 Device does not match - skipping 0.477784 Checking device (1D6B/0001) (005/001) 0.541404 - VendorID: 1d6b 0.541733 - ProductID: 0001 0.541933 - Manufacturer: unknown 0.542124 - Product: unknown 0.543843 - Serial Number: unknown 0.543897 - Bus: 005 0.543935 Trying to match device 0.543978 Device does not match - skipping 0.544122 Checking device (/) (004/004) 0.561393 - VendorID: 0.561428 - ProductID: 0.561438 - Manufacturer: 0.561443 - Product: 010937 0.561457 - Serial Number: 0.561461 - Bus: 004 0.561466 Trying to match device 0.561473 Device matches 0.565355 send_to_all: SETINFO ups.vendorid "" 0.565815 send_to_all: SETINFO ups.productid "" 0.566137 send: QGS 0.566421 read: QGS 0.566708 qx_process_answer: short reply (input.voltage) 0.567007 send: QGS 0.567377 read: QGS 0.567668 qx_process_answer: short reply (input.voltage) 0.567965 send: QGS 0.568256 read: QGS 0.568609 qx_process_answer: short reply (input.voltage) 0.568952 send: M 0.569310 read: M 0.569498 voltronic_qs_protocol: invalid protocol [M] 0.569678 ups_infoval_set: failed to preprocess value [ups.firmware.aux: M] 0.569866 send: M 0.570071 read: M 0.570262 voltronic_qs_protocol: invalid protocol [M] 0.570460 ups_infoval_set: failed to preprocess value [ups.firmware.aux: M] 0.570653 send: M 0.570834 read: M 0.571024 voltronic_qs_protocol: invalid protocol [M] 0.571213 ups_infoval_set: failed to preprocess value [ups.firmware.aux: M] 0.571405 send: QS 0.571587 read: QS 0.571781 qx_process_answer: short reply (input.voltage) 0.571973 send: QS 0.572155 read: QS 0.572343 qx_process_answer: short reply (input.voltage) 0.572532 send: QS 0.572716 read: QS 0.572903 qx_process_answer: short reply (input.voltage) 0.573093 send: D 0.573288 read: D 0.573481 qx_process_answer: short reply (input.voltage) 0.573673 send: D 0.573853 read: D 0.574041 qx_process_answer: short reply (input.voltage) 0.574236 send: D 0.574414 read: D 0.574600 qx_process_answer: short reply (input.voltage) 0.574759 send: Q1 0.807418 received 46 (40) 0.807475 read: (225.3 140.0 222.6 015 49.9 13.8 30.0 1001 0.807516 qx_process_answer: short reply (input.voltage) 0.807548 send: Q1 1.041418 received 46 (40) 1.041472 read: (225.3 140.0 224.5 015 49.9 13.9 30.0 1001 1.041487 qx_process_answer: short reply (input.voltage) 1.041508 send: Q1 1.275423 received 46 (40) 1.275476 read: (225.3 140.0 222.6 015 49.9 13.9 30.0 1001 1.275489 qx_process_answer: short reply (input.voltage) 1.275511 send: Q1 1.509410 received 46 (40) 1.509463 read: (225.3 140.0 222.6 015 49.9 13.9 30.0 1001 1.509501 qx_process_answer: short reply (input.voltage) 1.509566 send: Q1 1.743299 received 46 (40) 1.743344 read: (225.3 140.0 222.6 015 49.9 13.9 30.0 1001 1.743353 qx_process_answer: short reply (input.voltage) 1.743365 send: Q1 1.976367 received 46 (40) 1.976428