I want to execute a perl script that will send sms alert to me instead of alert mails which are working fine.Taken following steps but no avail yet:
1. updated contacts.cfg to include my pager:
alias Nagios Admin
pager 99xxx5247 # just hidden here
- updated commands.cfg to include notification by sms but script didnt get called, even updated the notify-service-by-email to include my script instead of sending mails but not working. At last I am trying this to echo message to a temporary file:
command_line /bin/echo "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" > tmp.txt
command_line /bin/echo "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" > tmp.txt
It's also not working. I'm just in need to call 'alertsms.pl $contactnumber$ $message$" script whenever there's any status change in Nagios. Please let me know how should I proceed.