Sunday, 28 August 2016

NAGIOS SMS SERVICE INTEGRATION


NAGIOS SMS SERVICE INTEGRATION :

http://solutionsatexperts.com/sms-integration-with-nagios/

===============================================


###  commands.cfg



# Entry For User 1
#Host outage notification entries section

#  'notify-host-by-sms' Command Definition For Host
   define  command{
           command_name    notify-host-by-user1
           command_line    /usr/bin/printf "%b" "*****  Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:  $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:  $LONGDATETIME$\n" | wget "api.mVaayoo.com/mvaayooapi/MessageCompose?user=namdev.it@gmail.com:123456789&senderID=TEST SMS&receipientno=9860755532,8149477323&dcs=0&msgtxt=**  Type : $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ at:  $LONGDATETIME$ **"
     }


#Service outage notification entries section

#  'notify-service-by-sms' command definition for solutionsatexperts-and-appsupport
   define  command{
           command_name    notify-service-by-user1
           command_line    /usr/bin/printf "%b" "*****  Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:  $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:  $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional  Info:\n\n$SERVICEOUTPUT$\n" | wget  "api.mVaayoo.com/mvaayooapi/MessageCompose?user=namdev.it@gmail.com:123456789&senderID=TEST SMS&receipientno=9860755532,8149477323&dcs=0&msgtxt=**  Type : $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is  $SERVICESTATE$ at: $LONGDATETIME$ **"
   }

:wq




##  contacts.cfg

######## SMS Contact User Name Details #####

define contact{
        contact_name                    username             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
        alias                           username            ; Full name of user
        email                           user@example.com  ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        host_notification_commands      notify-host-by-user1
        service_notification_commands   notify-service-by-user1
        }


:wq



=========================

#### SMS CONTACT GROUP ####


define contactgroup{
        contactgroup_name       SMS_GROUP
        alias                   Nagios Administrators
        members                 username1,username2
        }


#####  For Defind Server Contact Group In host.cfg

define host{
    use        linux-server    ; Inherit default values from a template
    host_name    serverhost    ; The name we're giving to this host
    alias        serverhost    ; A longer name associated with the host
        address        serverip    ; IP address of the host
        hostgroups        AWS-Windows
        notifications_enabled    1                                   ; For SMS Notification
        contact_groups          admins,SMS_GROUP
    }

define service{
    use            generic-service
    host_name        serverhost
    service_description    Uptime
    check_command        check_nt!UPTIME
        contact_groups          admins,SMS_GROUP
    }

=========================================================



No comments: