Icinga SMS notifications – integration manual

Here we describe how to setup Icinga 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 is an offline hardware SMS gateway. Therefore no external connection to 3rd party system is required. All notifications are generated on-premise and sent directly to a cellular network. This solution can be used in secure installations without Internet access.

SMSEagle Setup

  • Create a new user in SMSEagle (menu Users > + Add Users, user access level: “User”).
  • Grant API access to the created user:
    • click Access to API beside the newly created user
    • Enable APIv1
    • Generate new token (copy it for later use)
    • Add access permissions in section APIv1 Permission for: send_sms, send_tocontact, send_togroup
    • Save settings

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.

Icinga 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 Icinga plugins directory.

2. Create the SMS notification commands (commonly found in file 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$ $SERVICESTATE$ $SERVICEDESC$ Host($HOSTNAME$) Info($SERVICEOUTPUT$) Date($SHORTDATETIME$)" }

3. In your Icinga 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 
}

Icinga Setup (alternative method)

On Icinga Exchange you can also find a package of scripts than can be used to communicate with SMSEagle:

  • notify_smseagle – sends SMS via an SMSEagle device
  • check_smseagle – checks the GSM/3G/4G signal strength
  • smseagle_ack.cgi – script for the “callback url” function of an SMSEagle device. It parses incoming SMSs and acknowledges host/service problems if an SMS requests that.

 

Have Questions?

SMSEagle devices are designed for easy setup. If you don't have a device yet, just buy your SMSEagle and get started with your integration. If you need technical assistance or have questions about our products, we’ll be happy to help you.