Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
SMS Notifications via LabsMobile
1.4.2
2018-03-08
- Nagios 3.x
- Nagios 4.x
- Nagios XI
- Nagios Fusion
- Nagios Reactor
- Nagios Network Analyzer
- Nagios Log Server
Other
8119
File | Description |
---|---|
notify_sms.pl | notify_sms.pl |
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!
Full instructions and help given in the script.
To use this script you will need a LabsMobile account available from http://www.labsmobile.com
# ============================== SUMMARY =====================================
#
# Program : notify_sms.pl
# Version : 1.4
# Date : 08 Mar 2018
# Author : Boris Vogel / LabsMobile
# Copyright : LabsMobile All rights reserved.
# Summary : This plugin sends SMS alerts through the LabsMobile SMS API
# License : ISC
#
# =========================== PROGRAM LICENSE =================================
#
# Copyright (c) LabsMobile 2018
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# ============================= MORE INFO ======================================
#
# As released this plugin requires a LabsMobile account to send text
# messages. To setup a LabsMobile account visit:
# http://www.labsmobile.com
#
#
# ============================= SETUP NOTES ====================================
#
# Copy this file to your Nagios plugin folder
# On a Centos install this is typically /usr/lib/nagios/libexec (32 bit)
# or /usr/lib64/nagios/libexec (64 bit) other distributions may vary.
# Make sure you have SSL enabled. Run this otherwise:
# perl -MCPAN -e 'install Crypt::SSLeay'
# Testing. From the command line in the plugin folder run:
# ./notify-sms.pl -u yourusername -p yourpassword -t yournumber -f Nagios -m "bodge"
# replacing yourusername, yourpassword and yournumber with the appropriate values.
#
#
# NAGIOS SETUP
#
# 1. Create the SMS notification commands. (Commonly found in commands.cfg)
# Don't forget to add your LabsMobile username and password. These can be placed
# in your commands instead of the API_USERNAME and API_PASSWORD given below
# -f Nagios - you can change Nagios to a different "from" if you want.
#
# define command{
# command_name service-notify-by-sms
# command_line $USER1$/notify_sms.pl -u API_USERNAME -p API_PASSWORD -t $CONTACTPAGER$ -f Nagios -m "Service: $SERVICEDESC$nHost: $HOSTNAME$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nInfo: $SERVICEOUTPUT$nDate: $LONGDATETIME$"
# }
#
# define command{
# command_name host-notify-by-sms
# command_line $USER1$/notify_sms.pl -u API_USERNAME -p API_PASSWORD -t $CONTACTPAGER$ -f Nagios -m "Host $HOSTNAME$ is $HOSTSTATE$nInfo: $HOSTOUTPUT$nTime: $LONGDATETIME$"
# }
#
# 2. In your nagios contacts (Commonly found on contacts.cfg) add
# the SMS notification commands:
#
# service_notification_commands service-notify-by-sms
# host_notification_commands host-notify-by-sms
#
# 3. Add a pager number to your contacts, make sure it has the international
# prefix, e.g. 44 for UK or 1 for USA, without a leading 00 or +.
#
# pager 447700900000
#
#
# Program : notify_sms.pl
# Version : 1.4
# Date : 08 Mar 2018
# Author : Boris Vogel / LabsMobile
# Copyright : LabsMobile All rights reserved.
# Summary : This plugin sends SMS alerts through the LabsMobile SMS API
# License : ISC
#
# =========================== PROGRAM LICENSE =================================
#
# Copyright (c) LabsMobile 2018
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# ============================= MORE INFO ======================================
#
# As released this plugin requires a LabsMobile account to send text
# messages. To setup a LabsMobile account visit:
# http://www.labsmobile.com
#
#
# ============================= SETUP NOTES ====================================
#
# Copy this file to your Nagios plugin folder
# On a Centos install this is typically /usr/lib/nagios/libexec (32 bit)
# or /usr/lib64/nagios/libexec (64 bit) other distributions may vary.
# Make sure you have SSL enabled. Run this otherwise:
# perl -MCPAN -e 'install Crypt::SSLeay'
# Testing. From the command line in the plugin folder run:
# ./notify-sms.pl -u yourusername -p yourpassword -t yournumber -f Nagios -m "bodge"
# replacing yourusername, yourpassword and yournumber with the appropriate values.
#
#
# NAGIOS SETUP
#
# 1. Create the SMS notification commands. (Commonly found in commands.cfg)
# Don't forget to add your LabsMobile username and password. These can be placed
# in your commands instead of the API_USERNAME and API_PASSWORD given below
# -f Nagios - you can change Nagios to a different "from" if you want.
#
# define command{
# command_name service-notify-by-sms
# command_line $USER1$/notify_sms.pl -u API_USERNAME -p API_PASSWORD -t $CONTACTPAGER$ -f Nagios -m "Service: $SERVICEDESC$nHost: $HOSTNAME$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nInfo: $SERVICEOUTPUT$nDate: $LONGDATETIME$"
# }
#
# define command{
# command_name host-notify-by-sms
# command_line $USER1$/notify_sms.pl -u API_USERNAME -p API_PASSWORD -t $CONTACTPAGER$ -f Nagios -m "Host $HOSTNAME$ is $HOSTSTATE$nInfo: $HOSTOUTPUT$nTime: $LONGDATETIME$"
# }
#
# 2. In your nagios contacts (Commonly found on contacts.cfg) add
# the SMS notification commands:
#
# service_notification_commands service-notify-by-sms
# host_notification_commands host-notify-by-sms
#
# 3. Add a pager number to your contacts, make sure it has the international
# prefix, e.g. 44 for UK or 1 for USA, without a leading 00 or +.
#
# pager 447700900000
#
Reviews (0)
Be the first to review this listing!