In my upsmon.conf I have:
NOTIFYCMD /usr/sbin/upssched
NOTIFYMSG ONLINE "UPS %s on - line power"
NOTIFYMSG ONBATT "UPS %s on - battery"
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
Then in upssched.conf :
CMDSCRIPT /usr/local/bin/upssched-cmd
# Command pipe and lock-file
PIPEFN /run/nut/upssched.pipe
LOCKFN /run/nut/upssched.lock
# Send alerts immediately on change in line power
AT ONBATT * EXECUTE onbatt
I can print, but MSG does not pass forward. Its in the log from upssched, but I want the message to post in the email.
#!/bin/sh
case $1 in
onbatt)
printf "1:$UPSNAME 2:"$@" 3:$NOTIFYTYPE" >&2
;;
esac
I do not see the pre-defined message being passed through. If it not, can you consider adjusting the code?
In my upsmon.conf I have:
Then in upssched.conf :
I can print, but MSG does not pass forward. Its in the log from upssched, but I want the message to post in the email.
I do not see the pre-defined message being passed through. If it not, can you consider adjusting the code?