Tuesday, 8 March 2016

Configure SMS Alert In Nagios



Free SMS Service:

http://www.mvaayoo.com/UI/Message.aspx

Note:  It works only without DND Number, if dnd service activate on number then it will not work.

Otherwise you have to purchase Transactiona Bulk SMS Service
=================================================================================================



NAGIOS SMS SERVICE INTEGRATION :

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


Tesing SMS API:

http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=namdev.it@gmail.com:123456789&senderID=TEST SMS&receipientno=9421735632,8007487061&dcs=0&msgtxt=This is Test Nagios Message&state=4

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


###  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=9421735632,8007487061&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=9421735632,8007487061&dcs=0&msgtxt=**  Type : $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is  $SERVICESTATE$ at: $LONGDATETIME$ **"
   }

### ENTRY FOR USER2
#Host outage notification entries section

#  'notify-host-by-sms' Command Definition For Host
   define  command{
           command_name    notify-host-by-user2
           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=9421735632,8007487061&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-user2
           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=9421735632,8007487061&dcs=0&msgtxt=**  Type : $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is  $SERVICESTATE$ at: $LONGDATETIME$ **"
   }


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


##  contacts.cfg

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

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

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

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

#### SMS CONTACT GROUP ####


define contactgroup{
        contactgroup_name       SMS_GROUP
        alias                   Nagios Administrators
        members                 Atul,Arvind
        }


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

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

define service{
    use            generic-service
    host_name        DARP-DATABASE-SERVER-192.168.0.100
    service_description    Uptime
    check_command        check_nt!UPTIME
        contact_groups          admins,SMS_GROUP
    }

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



1 comment:

Anonymous said...

Nowadays SMS marketing is more effective to increase your visibility in the market fast. You don't need to spend more money on this and easily get your target audience in a single click.