personalize notification commands
Nelson Serafica
ntserafica at yahoo.com
Fri Jul 4 15:29:08 CEST 2008
I want to set nagios to send a txt message if there is a down or critical status. I setup a nagios for testing to another box instead of playing in the stable nagios that was runnin. I already have email notification but sometimes I don't open my email in midnight so I need an alert ans I choose sms. I have an officemate who have a linux box and setup a url where if I visit the url it will send a txt message. Here is the sample url:
http://x.x.x.x/testserver?page=sms_sendsmsmessage&multi_recipients=+123456789&smsmessage=testing&username=nagios&NOEXPIRE
123456789 = sms contact number
testing = message of the sms
Now, I have setup in commands.cfg the ff:
define command{
command_name notify-by-txt
command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICE
OUTPUT$\nDate: $LONGDATETIME$" |/usr/bin/links "http://x.x.x.x/testserver?page=sms_sendsmsmessage&multi_recipients=+123456789&smsmessage=$HOSTNAME&&username=nagios&NOEXPIRE &"
}
Then I set my contacts.cfg
define contact{
contact_name nagios-admin
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-txt
host_notification_commands notify-by-txt
pager http://x.x.x.x/testserver?page=sms_sendsmsmessage&multi_recipients=+123456789&smsmessage=testing&username=nagios&NOEXPIRE
}
I see the logs in nagios the notify-by-txt but I don't receive a sms message. But when I command it via shell, I receive a sms message.
Could someone direct me to right commands in notification commands? Can I set a sample script just to test notification commands?
Yahoo! Toolbar is now powered with Search Assist.Download it now!
http://ph.toolbar.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080704/de139bbe/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list