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

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


Leave a Reply

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

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

Facebook photo

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

Connecting to %s