Mon, 14 Jun 2010

aasms and nagios

Finally setup my aasms module with nagios, which was really the point of the whole exercise.

First, define some new notification commands more or less like this:

define command{
	        command_name    notify-host-by-sms
			command_line    send-aa-sms --file=/etc/nagios3/aasms.config -d $CONTACTEMAIL$ -m "***** Nagios *****Notification Type: $NOTIFICATIONTYPE$ Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$"

# 'notify-service-by-email' command definition
define command{
	        command_name    notify-service-by-sms
		    command_line    send-aa-sms --file=/etc/nagios3/aasms.config -d $CONTACTEMAIL$ -m "***** Nagios *****Notification Type: $NOTIFICATIONTYPE$ Service: $SERVICEDESC$ Host: $HOSTALIAS$ Address: $HOSTADDRESS$ State: $SERVICESTATE$ Date/Time: $LONGDATETIME$ Additional Info: $SERVICEOUTPUT$"

/etc/nagios3/aasms.config should be replaced with an appropriate config file for aasms readable only by nagios. Then define a new contact:

define contact{
		contact_name                    mstevens-sms
		alias                           Michael Stevens (SMS)
		service_notification_period     24x7
		host_notification_period        24x7
		service_notification_options    w,u,c,r
		host_notification_options       d,r
		host_notifications_enabled      1
		service_notifications_enabled   1
		service_notification_commands   notify-service-by-sms
		host_notification_commands      notify-host-by-sms
		email							your_mobile_here

Just add this contact to appropriate groups, and you should now get SMS notification of outages.

The key advantage of all this over the curl example on the A&A site is that you don't have to put your account details in the process name, and they can live privately in a nice config file instead.

[21:44] | [] | aasms and nagios

< June 2010 >
   1 2 3 4 5
6 7 8 9101112

Contact: Michael Stevens <>

RSS: RSS feed

Atom: Atom feed

Valid XHTML 1.0!

Valid CSS!