Results 1 to 2 of 2

Thread: clean way of escalating alert to SMS for a selection of hosts and services

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Location
    Paris, France
    Posts
    21

    clean way of escalating alert to SMS for a selection of hosts and services

    Hi,

    after many tries I've come to the conclusion that escalations are the best way to get SMS notifications for nonworking hours.
    By best, I mean I don't have to touch packs, hosts, services ( so no need to duplicate or modify any of them)

    I've succeeded in making it work for host related alerts, but not for services yet.
    Here is my setup (h=host / t=template / cg=contactgroup / c=contact / e=escalation / nw=notificationway )

    h/ati-test-ati.cfg
    \_ t/generic-host-sms.cfg
    ..\_ t/generic-host.cfg
    \_ e/escalation-sms.cfg
    ..\_ cg/admin_by_sms.cfg
    ....\_ c/ATI.cfg
    ......\_ nw/sms.cfg

    This is working well, and allows me to select in the host configuration files if it should trigger sms alerts at night, SIMPLY by adding the line:
    use generic-host-sms
    Great !


    But...
    for services, I can't add generic-service-sms.cfg to my host, or I would get this error message in /tmp/shinken_checkconfig_result :
    WARNING: [Shinken] [items] Host u'ati-test-ati' use/inherit from an unknown template (u'generic-service-sms') ! Imported from: /etc/shinken/hosts/ati-test-ati.cfg:1

    As I'm using packs, I don't want to duplicate all services // or modify the files in packs (that get overwritten when packs get updated).
    Using a servicegroup would be great (not rewritting nothing, just adding the escalation I want ) , but it does not accept this keywork...

    Any idea on how to make work this cleanly ?

    Thanks
    ATI

  2. #2
    Junior Member
    Join Date
    Aug 2014
    Location
    Paris, France
    Posts
    21
    In fact: escalation to send sms for a selected host and associated services => this work fine
    I'll post configuration below for those who are looking for this information.

    note: I'll open another thread about changing priority (like check_interval) for services WITHOUT duplicating them.


    For those who are looking for this information, I will detail configuration above (that works) here:
    www-website.cfg:
    define host {
    use generic-host,linux-ssh,http,https
    host_name www-website
    alias website
    address 1.2.3.4
    escalations escalation-sms
    }
    escalations/escalation-sms.cfg:
    define escalation{
    escalation_name escalation-sms
    contact_groups admins_by_sms
    first_notification 1
    last_notification 1 ; we send only 1 sms total / per status change
    notification_interval 30 ; not used if first_notification = last_notification !
    escalation_period nonworkhours ; 24x7
    escalation_options d,r,c,w,r ; unsure why how to distinguish host recovery & service recovery
    ; for service [w,u,c,r,f,s] warning unknonw critical recovery flapping_change scheduled_downtime none
    ; for host [d,u,r,f,s] down unreachable recovery flapping_change schedule_downtime
    }
    contactgroups/admins_by_sms.cfg:
    define contactgroup{
    contactgroup_name admins_by_sms
    alias admins_by_sms
    members ati-sms,ati2-sms
    }
    contacts/ati.cfg
    define contact{
    contact_name ati
    use generic-contact
    alias oim
    email ati@chezoim.com
    pager 00336xxyyzztt ; contact phone number
    is_admin 1
    can_submit_commands 1 # even if already in generic-contact
    retain_status_information 1
    retain_nonstatus_information 1
    notifications_enabled 1
    }
    define contact{
    contact_name ati-sms
    use generic-contact
    alias oim
    email ati@chezoim.com
    pager 00336xxyyzztt ; contact phone number
    is_admin 1
    can_submit_commands 1 # even if already in generic-contact
    retain_status_information 1
    retain_nonstatus_information 1
    notifications_enabled 1
    notifications_enabled 1
    notificationways sms
    }
    notificationways/sms.cfg
    define notificationway{
    notificationway_name sms
    host_notification_period nonworkhours ; 24x7
    host_notification_options d,r
    host_notification_commands notify-host-by-ovhsms
    service_notification_period nonworkhours ; 24x7 ;nonworkhours
    service_notification_options c,r
    service_notification_commands notify-service-by-ovhsms
    }
    ATI

Posting Permissions

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