Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
SMS Notifications and Alerting via SMSEagle
2.0
2020-12-30
- Nagios 2.x
- Nagios 3.x
- Nagios 4.x
- Nagios XI
BSD
60264
File | Description |
---|---|
notify_eagle_sms.pl | notify_eagle_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!
This is a plugin for Nagios to send SMS Text Message notifications with SMSEagle - sms hardware gateway.
Simple setup in about 5 minutes.
SMSEAGLE SETUP
1. Create a new user for this script in SMSEagle webGUI > menu Users.
2. When the user is saved, edit its properties and under API Access token:
a) check Enable token
b) click Generate new token
This will generate a new API access token for your SMSEagle. The API token will be referenced below as SMSEAGLEAPITOKEN. Replace SMSEAGLEAPITOKEN in script below with your value.
NAGIOS SETUP
1. Create the SMS notification commands. (Commonly found in commands.cfg)
Replace SMSEAGLEURL with URL Address of your SMSEagle device (for example: http://192.168.50.150)
Replace SMSEAGLEAPITOKEN with your API token for your SMSEagle (for example: NZg2yNmWYb5Q7I3Y3Ifnk5E)
Define two commands:
define command {
command_name notify-by-sms
command_line $USER1$/notify_eagle_sms.pl -s SMSEAGLEURL -a SMSEAGLEAPITOKEN -d $CONTACTPAGER$ -t "$NOTIFICATIONTYPE$ $SERVICESTATE$ $SERVICEDESC$ Host($HOSTNAME$) Info($SERVICEOUTPUT$) Date($SHORTDATETIME$)"
}
define command {
command_name host-notify-by-sms
command_line $USER1$/notify_eagle_sms.pl -s SMSEAGLEURL -a SMSEAGLEAPITOKEN -d $CONTACTPAGER$ -t "$NOTIFICATIONTYPE$ $HOSTSTATE$ Host($HOSTALIAS$) Info($HOSTOUTPUT$) Time($SHORTDATETIME$)"
}
2. In your nagios contacts (Commonly found on contacts.cfg) add
the contact. Field "pager" should contain a mobile number for sms alerts in
full international format e.g. 48xxxxxxxxx
define contact {
contact_name engineer
alias Support Engineer
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email,notify-by-sms
host_notification_commands host-notify-by-email,host-notify-by-sms
email engineer@somedomain.com
pager 48xxxxxxxx
}
That's it!
Notice for Nagios XI users: If you encounter perl error, please add the path to the perl executable at the start of the command in Nagios.
Simple setup in about 5 minutes.
SMSEAGLE SETUP
1. Create a new user for this script in SMSEagle webGUI > menu Users.
2. When the user is saved, edit its properties and under API Access token:
a) check Enable token
b) click Generate new token
This will generate a new API access token for your SMSEagle. The API token will be referenced below as SMSEAGLEAPITOKEN. Replace SMSEAGLEAPITOKEN in script below with your value.
NAGIOS SETUP
1. Create the SMS notification commands. (Commonly found in commands.cfg)
Replace SMSEAGLEURL with URL Address of your SMSEagle device (for example: http://192.168.50.150)
Replace SMSEAGLEAPITOKEN with your API token for your SMSEagle (for example: NZg2yNmWYb5Q7I3Y3Ifnk5E)
Define two commands:
define command {
command_name notify-by-sms
command_line $USER1$/notify_eagle_sms.pl -s SMSEAGLEURL -a SMSEAGLEAPITOKEN -d $CONTACTPAGER$ -t "$NOTIFICATIONTYPE$ $SERVICESTATE$ $SERVICEDESC$ Host($HOSTNAME$) Info($SERVICEOUTPUT$) Date($SHORTDATETIME$)"
}
define command {
command_name host-notify-by-sms
command_line $USER1$/notify_eagle_sms.pl -s SMSEAGLEURL -a SMSEAGLEAPITOKEN -d $CONTACTPAGER$ -t "$NOTIFICATIONTYPE$ $HOSTSTATE$ Host($HOSTALIAS$) Info($HOSTOUTPUT$) Time($SHORTDATETIME$)"
}
2. In your nagios contacts (Commonly found on contacts.cfg) add
the contact. Field "pager" should contain a mobile number for sms alerts in
full international format e.g. 48xxxxxxxxx
define contact {
contact_name engineer
alias Support Engineer
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email,notify-by-sms
host_notification_commands host-notify-by-email,host-notify-by-sms
email engineer@somedomain.com
pager 48xxxxxxxx
}
That's it!
Notice for Nagios XI users: If you encounter perl error, please add the path to the perl executable at the start of the command in Nagios.
Reviews (0)
Be the first to review this listing!