Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
SMS FoxBox Notification Scripts
3.0
- Nagios 2.x
- Nagios 3.x
GPL
77916
File | Description |
---|---|
sendSMS_new_vers.sh.tar | Perl script to send the SMS notifications |
CommandsAddition.tar.bz2 | Addenda to commands file |
ContactsAddition.tar.bz2 | Addenda to contacts file |
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!
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 ----
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 ----
Reviews (0)
Be the first to review this listing!