hi,
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:
- updated contacts.cfg to include my pager:
define contact{
contact_name nadmin
use generic-contact
alias Nagios Admin
email [email protected]
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:
[code]define command{
command_name notify-service-by-email
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
}
define command{
command_name notify-host-by-email
command_line /bin/echo “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” > tmp.txt
}
[/code]
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.
Regards,
JC