Hi, new NUT user here, so please bear with me.

I have setup my Eaton 5SX, and am trying to do a simple notification email, without going to the more complex upssched examples.

I have a simple notification command listed in upsmon.conf, and have added +EXEC to the NOTIFYFLAGs:

NOTIFYCMD /etc/ups/notifycmd.sh
NOTIFYFLAG ONLINE     SYSLOG+EXEC
NOTIFYFLAG ONBATT     SYSLOG+EXEC

...the script passes the variables to msmtp to send an email on an event:

#!/bin/bash
EMAIL='si...@simonandkate.net'
echo -e "Subject: UPS ALERT: $NOTIFYTYPE\n\nUPS: $UPSNAME\r\nAlert type: $NOTIFYTYPE" | msmtp $EMAIL

That results in an email saying (e.g.):

Subject: UPS ALERT: ONBATT
UPS: eaton5sx@localhost
Alert type: ONBATT

I'd like it to read per the NOTIFYMSG content in upsmon.conf, e.g.:

Subject: UPS ALERT: UPS eaton5sx is on battery
UPS: eaton5sx@localhost
Alert type: UPS eaton5sx is on battery


...but I can't work out how to read the NOTIFYMSG into the script instead of NOTIFYTYPE. How do I do that?

Simon.

--
Simon Wilson
M: 0400 12 11 16


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to