SMS Alerts
Posted: Thu Aug 22, 2013 8:46 pm
Hi,
Anyone can help on SMS Alert?
I'm using GSM to work with Nagios to send sms alert.
The command works if I run in on the shell windows but it doesn't work in Nagios command.cfg, everytime got alert the smsd.log will show waiting for message to send and stop there.
I'm using nagios 3.5 on centos 5
# 'notify-by-sms' command definition - added by Yen Yen
define command{
command_name notify-by-sms
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nState: $SERVICESTATE$ for $SERVICEDURATION$\nAddress: $HOSTADDRESS$\n\nInfo:\n\n$SERVICEOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nACK by: $SERVICEACKAUTHOR$\nComment: $SERVICEACKCOMMENT$\n" | /usr/bin/smssend "myphonenumber" $CONTACTPAGER$ "** $NOTIFICATIONTYPE$ Service Alert: $SERVICEDESC$ on $HOSTALIAS$ is $SERVICESTATE$ **"
}
Anyone can help on SMS Alert?
I'm using GSM to work with Nagios to send sms alert.
The command works if I run in on the shell windows but it doesn't work in Nagios command.cfg, everytime got alert the smsd.log will show waiting for message to send and stop there.
I'm using nagios 3.5 on centos 5
# 'notify-by-sms' command definition - added by Yen Yen
define command{
command_name notify-by-sms
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nState: $SERVICESTATE$ for $SERVICEDURATION$\nAddress: $HOSTADDRESS$\n\nInfo:\n\n$SERVICEOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nACK by: $SERVICEACKAUTHOR$\nComment: $SERVICEACKCOMMENT$\n" | /usr/bin/smssend "myphonenumber" $CONTACTPAGER$ "** $NOTIFICATIONTYPE$ Service Alert: $SERVICEDESC$ on $HOSTALIAS$ is $SERVICESTATE$ **"
}