[Nut-upsuser] problem with mailing (nut 2.4.1 and a powermust650 -> megatec_usb)
Thomas Stather
thomasstather at aol.com
Sat Jan 9 12:43:23 UTC 2010
Hello guys
Yesterday i started do configure my Mustek Powermust650 with nut using
the megatec_usb driver. Everything works fine except for the mailing
when something happens. My upsmon looks like this:
MONITOR powermust650 at localhost 1 local controller master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
NOTIFYCMD /root/upsmailer
POLLFREQ 10
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 45
POWERDOWNFLAG /etc/killpower
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 SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG FSD SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC
RBWARNTIME 43200
NOCOMMWARNTIME 300
INALDELAY 5
the /root/upsmailer is just a simple shell script that mails the events,
it looks like:
#!/bin/bash
RECIPIENT="controller at xxx"
SCRIPTNAME=`basename $0`
[ `echo $UPSNAME | wc -w` -eq "0" ] && UPSNAME="unknown"
[ `echo $NOTIFYTYPE | wc -w` -eq "0" ] && NOTIFYTYPE="unknown"
echo "$*" | mailx -s "$SCRIPTNAME: $UPSNAME $NOTIFYTYPE" $RECIPIENT
exit 0
When i disconnect the UPS from the power line, i get a message in my
syslog but not on the wall and the script isn't started either. What
have i done wrong (i'm relatively new to nut :) )?
Greets Thomas
More information about the Nut-upsuser
mailing list