hello, I installed with NUT UPS MGE Pulsar Evolution 2200 all orders of arrest, interrogation etc etc ... UPS work well However, I have a problem with the order in NOTIFYCMD upsmon.conf that not run ... I created a script that generates a simply log I indicated in upsmon.conf NOTIFYCMD / home / nut / alert_ups.sh below my upsmon.conf RUN_AS_USER nut MONITOR pulsar at localhost 1 admin1 lahdnets master MINSUPPLIES 1 FINALDELAY 5 HOSTSYNC 15 NOTIFYCMD /home/nut/alert_ups.sh # NOTIFYCMD /sbin/upssched SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 5 DEADTIME 15 NOCOMMWARNTIME 300 RBWARNTIME 43200 # POWERDOWNFLAG /etc/killpower NOTIFYMSG ONLINE "UPS %s on line power" NOTIFYMSG ONBATT "UPS %s on battery" NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC when the server stops, the log is not generated and Same with upssched ... where can I seach ? Thank you for your help -- Sabine GOUDARD - Informatique et Multim?dia Ecole Nationale Sup?rieure d?Architecture de Saint-?tienne 1, rue Buisson BP 94 42003 Saint-?tienne Cedex 1 T?l. : 04 77 42 37 20 - Fax : 04 77 42 35 40 sabine.goudard at st-etienne.archi.fr
Bonjour Sabine, long time no see (the last time, it was iirc indirectly through Bernard Thomas, from Eaton support team) 2010/11/29 sabine GOUDARD> hello, > > I installed with NUT UPS MGE Pulsar Evolution 2200 > all orders of arrest, interrogation etc etc ... UPS > work well > > However, I have a problem with the order in NOTIFYCMD upsmon.conf that > not run ... > > I created a script that generates a simply log > > I indicated in upsmon.conf NOTIFYCMD / home / nut / alert_ups.sh > > below my upsmon.conf > > RUN_AS_USER nut > MONITOR pulsar at localhost 1 admin1 lahdnets master > MINSUPPLIES 1 > FINALDELAY 5 > HOSTSYNC 15 > NOTIFYCMD /home/nut/alert_ups.sh > # NOTIFYCMD /sbin/upssched > SHUTDOWNCMD "/sbin/shutdown -h +0" > POLLFREQ 5 > POLLFREQALERT 5 > DEADTIME 15 > NOCOMMWARNTIME 300 > RBWARNTIME 43200 > # POWERDOWNFLAG /etc/killpower > NOTIFYMSG ONLINE "UPS %s on line power" > NOTIFYMSG ONBATT "UPS %s on battery" > NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC > NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC > > when the server stops, the log is not generated > and Same with upssched ... > > where can I seach ? > > Thank you for your help >well, upssched is not called because you don't reference it as NOTIFYCMD. Now, you should however get syslog + wall notification whenever you switch to battery or get back to power. is your .sh script executable? has upsmon been (re)started since you've made these configuration changes? can you please also forward us this script for verification? For more information on scheduling, refer to the new documentation: http://new.networkupstools.org/docs/user-manual.chunked/ar01s07.html cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20101129/d5a19aa5/attachment.htm>
Hi again Sabine, first, please keep the list cc'ed 2010/11/29 sabine GOUDARD <sabine.goudard at st-etienne.archi.fr>> > > 2007 effectively .... >indeed, time passes too quickly! my script: very simple> > if I run it manually I have no problem > > # write to a specific log file > date=$(date +"%F %T") > echo "$date >> UPS ALERT, shutting down in a few seconds..." >> > /var/log/ups.log > > is the above your complete script?if so, you should really add a header like: !#/bin/sh don't forget that this will be run from a program, which may be different that running from a shell. next, how do you manually call your script? ie "sh myscript.sh" or simply "./myscript.sh". in other word, are the executable bits set? your problem here may be that the NUT user (the one running upsmon) doesn't have the right privileges to access to your home, where your script is located. in this case, you should put it in a more neutral location, like /usr/local/bin. to get the exact issue, try running upsmon in debug mode (after having stopped it), using "upsmon -DDD". and generate a power failure. have a look at the same time at upsmon output to see what's going on... my guess is that it will be solved by either of the above fix (location, exec bits, header line for interpreter declaration)> I have restart upsmon after each modification in upsmon.conf > > > > I also have question about > > POWERDOWNFLAG /etc/killpower > > When UPS is on LB, it stops and when it restarts > > I don't have any file killpower ? >this one gets cleared (removed) when upsmon restarts. cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20101129/7f0f114a/attachment.htm>
I add #!/bin/bash at the beginning of my script my script is in /home/nut the user nut is owner I run my script with sh /home/nut/alert_ups I try running upsmon in debug mode with "upsmon -DDD". I have a denied permission when the file ups.log is created I create it and I add nut owner and all is OK I'm going to continue my setteings Thanks PS : sorry for my bad english Le 29/11/2010 16:51, Arnaud Quette a ?crit : Hi again Sabine, first, please keep the list cc'ed 2010/11/29 sabine GOUDARD <[sabine.goudard at st-etienne.archi.fr> 2007 effectively .... indeed, time passes too quickly! my script: very simple if I run it manually I have no problem # write to a specific log file date=$(date +"%F %T") echo "$date >> UPS ALERT, shutting down in a few seconds..." >> /var/log/ups.log is the above your complete script? if so, you should really add a header like: !#/bin/sh don't forget that this will be run from a program, which may be different that running from a shell. next, how do you manually call your script? ie "sh myscript.sh" or simply "./myscript.sh". in other word, are the executable bits set? your problem here may be that the NUT user (the one running upsmon) doesn't have the right privileges to access to your home, where your script is located. in this case, you should put it in a more neutral location, like /usr/local/bin. to get the exact issue, try running upsmon in debug mode (after having stopped it), using "upsmon -DDD". and generate a power failure. have a look at the same time at upsmon output to see what's going on... my guess is that it will be solved by either of the above fix (location, exec bits, header line for interpreter declaration) I have restart upsmon after each modification in upsmon.conf I also have question about POWERDOWNFLAG /etc/killpower When UPS is on LB, it stops and when it restarts I don't have any file killpower ? this one gets cleared (removed) when upsmon restarts. cheers, Arnaud -- Linux / Unix Expert R+D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/ -> mailto:sabine.goudard at st-etienne.archi.fr] -- Sabine GOUDARD - Informatique et Multim?dia Ecole Nationale Sup?rieure d?Architecture de Saint-?tienne 1, rue Buisson BP 94 42003 Saint-?tienne Cedex 1 T?l. : 04 77 42 37 20 - Fax : 04 77 42 35 40 sabine.goudard at st-etienne.archi.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20101130/4e075c80/attachment.htm>