hdietze42@web.de (Holger Dietze) schrieb:
ich kann aber nicht verstehen, wie das Programm konfiguriert werden
muss...
So, es scheint, daß jetzt das Programm läuft... Was ich aber noch nicht geschafft habe ist, daß upsmon mir eine E-Mail schickt, wenn ein EVENT passiert...
So ist mein upsmon.conf: -------------------- RUN_AS_USER nut MONITOR apc@anika 1 nut meinpasswort master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD /usr/sbin/upssched POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower
NOTIFYMSG COMMBAD "UPS communications lost" NOTIFYMSG COMMOK "UPS communications established" NOTIFYMSG FSD "UPS being shut down by master" NOTIFYMSG LOWBATT "UPS has a low battery" NOTIFYMSG NOCOMM "UPS unavailable" NOTIFYMSG ONBATT "UPS on battery power" NOTIFYMSG ONLINE "UPS on line power" NOTIFYMSG REPLBATT "UPS battery needs replacement" NOTIFYMSG SHUTDOWN "NUT shutting system down"
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
RBWARNTIME 43200 NOCOMMWARNTIME 10 FINALDELAY 5 --------------------
und das ist mein upssched.conf: -------------------- CMDSCRIPT /home/upssched-cmd PIPEFN /var/run/nut/upssched.pipe LOCKFN /var/run/nut/upssched.lock
AT COMMBAD * START-TIMER COMMBAD 10 AT COMMOK * CANCEL-TIMER COMMBAD COMMOK AT FSD * EXECUTE FSD AT LOWBATT * EXECUTE LOWBATT AT NOCOMM * START-TIMER COMMBAD 10 AT ONBATT * START-TIMER ONBATT 300 AT ONLINE * CANCEL-TIMER ONBATT ONLINE AT REPLBATT * EXECUTE REPLBATT AT SHUTDOWN * EXECUTE SHUTDOWN --------------------
Und so ist /home/upssched-cmd (ich habe die Konfiguration und das Skript in http://homepage.mac.com/pauljlucas/personal/macmini/ups.html gefunden): -------------------- MAIL=/bin/mail EMAIL=lucabert@lucabert.intra
[ -z "$PAGER" ] && PAGER=$EMAIL
notify() { /bin/echo $2 | $MAIL -s "$3" $1 }
case $1 in COMMBAD) notify $PAGER $1 "UPS communications lost" ;; COMMOK) notify $PAGER $1 "UPS communications established" ;; FSD) notify $EMAIL $1 "UPS being shut down by master" ;; LOWBATT) notify $EMAIL $1 "UPS has a low battery" ;; NOCOMM) notify $PAGER $1 "UPS unavailable" ;; ONBATT) notify $PAGER $1 "UPS on battery power" ;; ONLINE) notify $PAGER $1 "UPS on line power" ;; REPLBATT) notify $EMAIL $1 "UPS battery needs replacement" ;; SHUTDOWN) notify $EMAIL $1 "NUT shutting system down" ;; esac --------------------
Ich sehe kein Problem in der Log, aber ich bekomme auch gar keine E-Mail... Ich denke, wenn ich das Daemon starte, sollte ich eine E-Mail bekommen (Event COMMOK), kommt aber nix...
Ideen?
Danke Luca Bertoncello (lucabert@lucabert.de)