Home Directory Addons Notifications send_textbelt_sms

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

send_textbelt_sms

Rating
0 votes
Favoured:
0
Current Version
1
Last Release Date
2016-01-08
Compatible With
  • Nagios 3.x
  • Nagios 4.x
License
GPL
Hits
6153
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Basically I was looking for a way to send SMS message through a free gateway. Of course this will only work if you don't have an internet outage. If you have redundant connections most of the time you should be good.

This uses curl and a free sms service called textbelt.com

You can git clone this project via:

cd /home/yourusername
git clone https://github.com/closerwalk/send_textbelt_sms.git
Then copy to send_textbelt_sms to /usr/local/nagios/libexec and chmod +x it.

Or download it below:
This is based on using a free sms service called textbelt.com/text


What to do to get this working:

Note: These instructions are debian based.


##Step 1##
Download send_textbelt_sms to /usr/local/nagios/libexec

chmod +x send_textbelt_sms

##Step 2##

Add the following lines to commands.cfg

sudo nano /usr/local/nagios/etc/objects/commands.cfg




# 'notify-service-by-sms' command definition
define command{
command_name notify-service-by-sms
command_line /usr/local/nagios/libexec/send_textbelt_sms "--Nagios Service Notification-- Host: $HOSTNAME$, Service: $SERVICEDESC$, Description: $SERVICESTATE$, Time: $LONGDATETIME$"
}

# 'notify-host-by-sms' command definition
define command{
command_name notify-host-by-sms
command_line /usr/local/nagios/libexec/send_textbelt_sms "--Nagios Host Notification-- Host: $HOSTNAME$, State: $HOSTSTATE$, Time: $LONGDATETIME$"
}


##Step 3 ##
Modify contacts.cfg
sudo nano /usr/local/nagios/etc/objects/contacts.cfg

Modify your contact definition to look like the following:


define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
service_notification_commands notify-service-by-sms ;sms notices
host_notification_commands notify-host-by-sms ;sms notices
email youremailaddy@xyz.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}


Note:

The lines added to contacts.cfg are:



service_notification_commands notify-service-by-sms ;sms notices
host_notification_commands notify-host-by-sms ;sms notices


## Step 4 ##
Reload Nagios Configs

sudo /etc/init.d/nagios reload