Results 1 to 3 of 3

Thread: Problem with SMS notification to a contactgroup

  1. #1
    Junior Member
    Join Date
    Nov 2014
    Posts
    2

    Problem with SMS notification to a contactgroup

    Hello guys!
    I am a newbie with Shinken and monitoring. Now i'm using shinken for my work. And i have a problem, that is:
    I used "gsmsendsms" command in Ubuntu 14.04 and shinken to send a SMS notification for a contact when a host down. And it was successful. But when i used it with a contactgroup, it fail.
    Here is my config:

    cat /etc/shinken/hosts/test.cfg
    Code:
    define host{
            use           generic-host
            contactgroups      users
            host_name        test
            address         172.16.69.100
            notification_interval     60
            notification_period      24x7
            notification_options      d,u,r
            notifications_enabled  1
        }
    /etc/shinken/contactgroups/users.cfg
    Code:
    define contactgroup{
      contactgroup_name  users
      alias        users
      members       ducnc,ducnc1
    }
    cat /etc/shinken/contacts/ducnc.cfg
    Code:
    define contact{
      use       generic-contact
      contact_name  ducnc
      email      nguyenxxxxxxxx@gmail.com
      pager      0948xxxxxx
      password    xxxx
      host_notifications_enabled   1
      service_notifications_enabled  1
      can_submit_commands       1
      notificationways        sms,email
      is_admin    1
    }
    cat /etc/shinken/contacts/ducnc1.cfg
    Code:
    define contact{
      use       generic-contact
      contact_name  ducnc1
      email      nguyenyyyyyyy@gmail.com
      pager      0985yyyyyy
      password    yyyyyy
      host_notifications_enabled   1
      service_notifications_enabled  1
      can_submit_commands       1
      notificationways        sms,email
      is_admin    1
    }
    cat /etc/shinken/notificationways/sms.cfg
    Code:
    define notificationway{
        notificationway_name      sms
        service_notification_period   24x7
        host_notification_period    24x7
        service_notification_options  c,w,r
        host_notification_options    d,u,r,s
        host_notification_commands   send-sms-host-alert  ; send host notifications via sms
    }
    cat /etc/shinken/commands/send-sms-host-alert.cfg
    Code:
    define command {
      command_name  send-sms-host-alert
      command_line  /usr/bin/printf "Shinken Notification  Type:$NOTIFICATIONTYPE$  Host: $HOSTNAME$  Address: $HOSTADDRESS$   State: $HOSTSTATE$  Date/Time: $DATE$ $TIME$\n" | gsmsendsms -d /dev/ttyUSB0 -b 19200 $CONTACTPAGER$
    }
    When my host "test" down, i received 2 email in 2 mailbox, but i don't received any SMS

    tailf /var/log/shinken/schedulerd.log
    Code:
    2014-11-07 05:13:45,537 [1415355225] Warning : Contact ducnc host notification command '/usr/bin/printf "Shinken Notification  Type:PROBLEM  Host: test  Address: 172.16.69.100   State: DOWN  Date/Time: 07-11-2014 05:13:12\n" | gsmsendsms -d /dev/ttyUSB0 -b 19200 0948309446 ' timed out after 30 seconds
    2014-11-07 05:13:45,538 [1415355225] Warning : Contact ducnc1 host notification command '/usr/bin/printf "Shinken Notification  Type:PROBLEM  Host: test  Address: 172.16.69.100   State: DOWN  Date/Time: 07-11-2014 05:13:12\n" | gsmsendsms -d /dev/ttyUSB0 -b 19200 0985580867 ' timed out after 30 seconds
    Anw, sorry about my English and thanks in advance!

    PS: The links about gsmsendsms is http://hashtips.wordpress.com/2013/0...-ubuntu-12-04/

  2. #2
    Junior Member
    Join Date
    Nov 2014
    Posts
    2

    Re: Problem with SMS notification to a contactgroup

    Hello everyone.
    I have fixed it. I changed gsmsendsms command by a script in python to send sms alert. And it work properly with both host and service alerts, both contact and contactgroup.
    Here is my config: https://github.com/ducnc/shinken-20-.../sms-alert.txt
    Cheer!

  3. #3
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,130

    Re: Problem with SMS notification to a contactgroup

    Thanks for sharing
    No direct support by personal message. Please open a thread so everyone can see the solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •