op5 SMS notifications – integration manual

Here we describe how to setup op5 with SMSEagle for SMS notifications. It should take you about 5 min to have it up and running.

This tutorial is also available on: Nagios Exchange website

 

SMSEagle Setup

Create a new user for this script in SMSEagle. This user will be referenced below as: SMSEAGLEUSER and SMSEAGLEPASSWORD
Replace SMSEAGLEUSER and SMSEAGLEPASSWORD in script below with your values.

 

op5 Setup

1. Download latest version of the script notify_eagle_sms.pl from our repository: https://bitbucket.org/proximus/smseagle-nagios
Place the plugin in your op5 plugins directory.

2. Create the SMS notification commands (commonly found in file commands.cfg).
Replace SMSEAGLEIP with IP Address of your SMSEagle device.
Replace SMSEAGLEUSER and SMSEAGLEPASSWORD with your user/password to SMSEagle.

Define two commands:

define command { 
command_name notify-by-sms 
command_line $USER1$/notify_eagle_sms.pl -s SMSEAGLEIP -u SMSEAGLEUSER -p SMSEAGLEPASSWORD -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 SMSEAGLEIP -u SMSEAGLEUSER -p SMSEAGLEPASSWORD -d $CONTACTPAGER$ -t "$NOTIFICATIONTYPE$ $HOSTSTATE$ Host($HOSTALIAS$) Info($HOSTOUTPUT$) Time($SHORTDATETIME$)" 
}

3. In your op5 contacts (commonly found in file contacts.cfg) add the contact. Field “pager” should contain a mobile number for sms alerts in full international format without leading + sign, for example: 48xxxxxxxxx (if your mobile operator requires + sign in a telephone number put 00 instead)

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 
}