Integration with Nagios Server Monitoring — NotePage, Inc.

Integrate with Existing Applications

Integration with Nagios Server Monitoring

PageGate integrates with Nagios by having Nagios submit alerts through PageGate's GetWeb interface. First prepare PageGate's GetWeb interface using the web interface video tutorial ↗, then:

Step 1 — Create the SMS Alert Shell Script

  1. Create a Linux shell script in the Nagios libexec folder (default: /usr/local/nagios/libexec/). Name it smsalert.sh.
  2. Paste the following content:
    #!/bin/bash
    UrlToCgi=$(printf "http://127.0.0.1/scripts/webgate.exe")
    RecipientVar=$(printf "?USER=")
    Recipient=$(printf "pageyou")
    SenderVar=$(printf "&FRM=")
    Sender=$(printf "fromme")
    MessageVar=$(printf "&MSG=")
    Message=$@
    Message=$(php -r "echo urlencode("$Message");")
    FullUrl=$UrlToCgi$RecipientVar$Recipient$SenderVar$Sender$MessageVar$Message
    wget -O- "$FullUrl"
    Update UrlToCgi to the hostname/IP of the GetWeb server. Update Recipient to the PageGate recipient or group name. Update Sender to your preferred sender name.

Step 2 — Configure Nagios Commands

  1. Open commands.cfg with vi:
    vi /usr/local/nagios/etc/objects/commands.cfg
  2. After the notify-host-by-email section, insert:
    # notify-service-by-sms
    define command{
    command_name notify-service-by-sms
    command_line /usr/local/nagios/libexec/smsalert.sh "--PageGate Service Alert-- Host: $HOSTNAME$, State: $HOSTSTATE$ Service $SERVICEDESC$ Description: $SERVICESTATE$ Time: $LONGDATETIME$"
    }

    # notify-host-by-sms
    define command{
    command_name notify-host-by-sms
    command_line /usr/local/nagios/libexec/smsalert.sh "--PageGate Host Alert-- Host: $HOSTNAME$, State: $HOSTSTATE$, Time: $LONGDATETIME$"
    }
  3. Save: press Escape, then type :wq

Step 3 — Configure Nagios Contacts

  1. Open contacts.cfg:
    vi /usr/local/nagios/etc/objects/contacts.cfg
  2. Insert before the email section:
    service_notification_commands notify-service-by-sms
    host_notification_commands notify-host-by-sms
  3. Save and restart Nagios:
    service nagios restart

Return to Integration Directory

Need help with this integration?

Our support team can walk you through the configuration steps.