More aasms hacking, v0.4 can now get the username and password from a config file, so you don't have to have them in the process name. (which is more or less why I started the whole exercise)
Mon, 14 Jun 2010
[21:45] | [/python] | aasms v0.4
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] | [/python] | aasms and nagios
Sun, 13 Jun 2010
Very minor tweaks to Proc::InvokeEditor, created a github repository for it, and uploaded the shiny new to CPAN.
While I was there, noticed some very old versions of some modules I had on CPAN, and deleted them.
[19:18] | [/perl] | Proc::InvokeEditor v.103
Mon, 07 Jun 2010
Hooked on gadgets, and paying a mental price
(the cynic in me suggests the recent surge in articles on this topic is related to the forthcoming book from Nicholas Carr)
[12:15] | [/distraction] | Distraction continued