Home Directory Plugins Notifications SMS FoxBox Notification Scripts

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

SMS FoxBox Notification Scripts

Current Version
3.0
Compatible With
  • Nagios 2.x
  • Nagios 3.x
Owner
License
GPL
Hits
77200
Files:
FileDescription
sendSMS_new_vers.sh.tarPerl script to send the SMS notifications
CommandsAddition.tar.bz2Addenda to commands file
ContactsAddition.tar.bz2Addenda to contacts file
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This tutorial explains how to integrate a standard Nagios monitoring server with an SMS notification external device, the FoxBox (www.smsfoxbox.it).
Thus, you will be able to forward the alerts from your hosts/services on a mobile phone using the GSM network, often more reliable than classic architectures based on Ethernet standards.
FoxBox comes in two similar versions (G25 and LX800) differing on hardware specifics, and this system can be safely used on each of them without problems.
Also older version (G20) supports this plugin, but here is required some modification on paths and filenames.

This guide has been developed for Debian Squeeze and Nagios 3.x.x.
Step #1 (FoxBox side)
The device is designed for these kind of communication tasks, so there is not much to do here except:
A) Provide a valid IP address, reachable from our monitoring server;
B) Insert a tested and full working SIM card, to send the SMS.

Step #2 (Monitoring server side)
First of all we need to place the script sendSMS.sh inside of the folder /usr/lib/nagios/plugins/.
It is also important to set properly the permissions on this file, to allow the Nagios user executing it.

Now we should add the new notification commands, working on the SMS channel instead of the classic email one. To do so, we have to add these lines to the file /etc/nagios3/commands.cfg:
# 'notify-host-by-foxbox' command definition
define command{
command_name notify-host-by-foxbox
command_line /usr/lib/nagios/plugins/sendSMS.sh -h "127.0.0.1" -u "nagiosadmin" -pw "nagios" -n "$CONTACTPAGER$" -m "Host Alert: $HOSTNAME$ nHost State: $HOSTSTATE$ nDate/Time: $LONGDATETIME$"
}

# 'notify-service-by-foxbox' command definition
define command{
command_name notify-service-by-foxbox
command_line /usr/lib/nagios/plugins/sendSMS.sh -h "127.0.0.1" -u "nagiosadmin" -pw "nagios" -n "$CONTACTPAGER$" -m "Service Alert: $HOSTALIAS$/$SERVICEDESC$ nService State: $SERVICESTATE$ nDate/Time: $LONGDATETIME$"
}

As you can see, we need a new information for the contacts: the phone number. Thus, we have to define it as "pager" in the file /etc/nagios3/conf.d/contacts_nagios2.cfg.
Moreover, we set up the service/host notification command. By default these are using the email channel, while we want to alert with the new notification commands, so we have to edit the parameters "service_notification_commands" and "host_notification_commands" too:
define contact{
contact_name test-contact
use generic-contact
alias tester
email yourname@domain
host_notification_commands notify-host-by-foxbox
service_notification_commands notify-service-by-foxbox
pager 12453683421
}

Obviously, once finished the configurations we have to restart the Nagios service in order to see their effects.
To check that everything is ok, maybe you could launch the pre-flight check with: nagios3 -v /etc/nagios3/nagios.cfg

This architecture has also been natively implemented on a pair of FoxBox versions, providing an all-in-one notification solution (EasyG2 G25 and Monitoring LX800).

--- Reference site: www.smsfoxbox.it ----