Nagios Notification Customizations

Getting notified by SMS is better than via email, I think, because then you can tell the difference between midnight spam and a server fire. Here’s my command for sending a shortened message (to #yournumber#@YourCarrierSMSGateway.com)

Add these to your commands.cfg and then change your contact settings (usually contacts_nagios2.cfg) to use the appropriate command.


define command{
command_name notify-service-by-sms
command_line /usr/bin/printf "%b" "$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($SERVICEOUTPUT$)." | /usr/bin/mail -s "$NOTIFICATIONTYPE$" $CONTACTEMAIL$
}

define command{
command_name notify-host-by-sms
command_line /usr/bin/printf "%b" "$HOSTALIAS$ is $HOSTSTATE$ ($HOSTOUTPUT$)." | /usr/bin/mail -s "$NOTIFICATIONTYPE$" $CONTACTEMAIL$
}

See my earlier Nagios Setup post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s