- Nagios Network Monitoring
- General Information and TidBits
- Installation Tips & Tricks
- Addons, Plugins, Tweaks & Customizations
- Checking Drupal Status with Nagios and WebInject
- AddOn - NRPE / NSClient
- AddOn - Nagios Event Log aka NagEventLog
- Addon - Nagios Passive Checks with NSCA
- Nagios Custom Object Variables
- Nagios Event Handler - Restart Remote Service
- Nagios Event Handler - Restarting a Local Service
- Plugin: check_dns_secondary - Checking NS Servers
- Plugin: check_http_requisites - Page Size, Files, and Loadtime
- Plugin: check_mem - Linux Memory Usage
- Plugin: check_sql - Check MSSQL and MYSQL servers
- Plugin: check_svn - Check Subversion
- Tweak - Nagios Jabber / XMPP Notifications
- Tweak - Nagios SMS Messaging
- Tweak - check_file_age to check_file_modified
- Tweak: Using NagiosGraph's SHOW.CGI
- Tweak: check_sql - Allow decimal values
- Common Errors & Fixes
Tweak - Nagios SMS Messaging
Want to send SMS messages from Nagios? SMS messages sometimes blocked when sending them via <phone#>@provider.com? Sending alot of SMS messages? Sounds like you need an SMS Gateway Provider.
In our corporate environment we wanted a more reliable/consistant SMS messaging system to work with our Nagios monitoring environment. A little research quickly led us to Clickatell. To keep things as simple as possible, we setup Nagios to use the SMS Gateway via SMTP API.
Now we had to configure Nagios. First off, we needed to create a notification method/command. Here is the command.cfg entry we created:
define command{
command_name notify-service-by-sms
command_line /usr/bin/printf "%b" "api_id:<API_ID> \nuser:<USERNAME> \npassword:<PASSWORD> \nto:$CONTACTPAGER$\nreply:<REPLY_ADDY> \ntext:$NOTIFICATIONTYPE$ $HOSTALIAS$-$SERVICEDESC$ $SERVICESTATE$\ntext:Address-$HOSTADDRESS$\ntext:Additional Info-$SERVICEOUTPUT$" | /bin/mail -s "$HOSTALIAS$-$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
}
Bold items in brackets you must specify based on your environment. Notice how we had to significantly strip down the info sent via SMS text message. We found the above was simple and communicated the required info.
Then let's create a contact to use...
define contact {
contact_name sms
use generic-contact
alias SMS Alert
email sms@messaging.clickatell.com
pager 16665551234,16665554321
service_notification_commands notify-service-by-sms
}
The phone numbers to SMS are just a comma seperated list. It is important to note the phone numbers must have a "1" before them.
Now simply add the "sms" contact in the service definitions you want to alert by SMS text messages. Reload Nagios and you should be off and running.
- MWalker's blog
- Printer-friendly version
- Login or register to post comments
-

Recent comments
7 weeks 2 days ago
24 weeks 5 days ago
27 weeks 6 days ago
37 weeks 5 days ago
45 weeks 1 day ago
45 weeks 3 days ago
50 weeks 4 hours ago
1 year 1 week ago