Page 1 of 1

SMS Notification for service recovery

Posted: Wed Jan 09, 2019 11:50 am
by morabanc
Hi guys,

We noticed that when a service fails (critical or warning) we get an sms + email notification but not when recover (ok) only receive email notification.

Service:

Code: Select all

define service {
    host_name                srvDDD
    service_description      Disco O
    use                      generic-service
    check_command            check_nrpe_disk!o!95!98
    notification_period      workhours_srvDDD
    register                 1
}
Serviceescalation lvl1:

Code: Select all

define serviceescalation {
    # config_name            lvl1_srvDDD
    host_name                srvDDD
    service_description      Disco O
    contacts                 David
    contact_groups           contact-Mail
    first_notification       1
    last_notification        3
    notification_interval    15
    escalation_period        24x7
}
Serviceescalation lvl2:

Code: Select all

define serviceescalation {
    # config_name            lvl2_srvDDD
    host_name                srvDDD
    service_description      Disco O
    contact_groups           contact,contact-Mail
    first_notification       4
    last_notification        0
    notification_interval    15
    escalation_period        24x7
}
Contact:

Code: Select all

define contact {
    contact_name                     David
    alias                            David
    host_notifications_enabled       1
    service_notifications_enabled    1
    host_notification_period         24x7
    service_notification_period      24x7
    host_notification_options        d,u,r,
    service_notification_options     w,u,c,r,
    host_notification_commands       host-notify-by-sms
    service_notification_commands    service-notify-by-sms
    pager                            <telephone...>
    use                              generic-contact
}

Thanks

Re: SMS Notification for service recovery

Posted: Wed Jan 09, 2019 4:15 pm
by npolovenko
Hello, @morabanc. What are you using to send out SMS messages? A built-in sms script or a physical device? Can you click on the XI username at the top right corner, then click on the Notifications Preferences in the left column and make sure that Host Recovery SMS notification box is checked and Service Recovery SMS notification box is checked as well.

Re: SMS Notification for service recovery

Posted: Mon Jan 14, 2019 2:25 am
by morabanc
Hi npolovenko,

Sorry for the late.

We are using a gsm module integrated in the physical server which are NagiosXi installed.

This sms notifications is defined at commands like this:

host-notify-by-sms

Code: Select all

echo "Host Alert: $HOSTNAME$. Host State: $HOSTSTATE$. Date/Time: $LONGDATETIME$. Desc: $HOSTOUTPUT$" | gammu-smsd-inject TEXT $CONTACTPAGER$
service-notify-by-sms

Code: Select all

echo "Service Alert: $HOSTNAME$/$SERVICEDESC$. Service State: $SERVICESTATE$. Date/Time: $LONGDATETIME$. Desc: $SERVICEOUTPUT$" | gammu-smsd-inject TEXT $CONTACTPAGER$
At nagios we only have "nagiosadmin" user, then at contacts we have all people that may receive sms.
I check Nagiosadmin preferences and all check box ara marked.

Let me know if you need some additional information.


Appreciate your help,
Thanks

Re: SMS Notification for service recovery

Posted: Mon Jan 14, 2019 5:14 pm
by npolovenko
@morabanc, I see that you have two service escalations. The first one is using the SMS contact "David" but the second escalation is using two contact groups. If your SMS contacts are not a part of those contact groups in the second escalation, they will not receive SMS notifications either. Can you try assigning the contact David to the second escalation?

Re: SMS Notification for service recovery

Posted: Tue Jan 15, 2019 6:28 am
by morabanc
Hi npolovenko,

Thanks for your advice but I solved the problem.

All config are ok but our script don't work correctly and won't send sms when they receive a Recovery flag ($NOTIFICATIONTYPE$).


Thanks a lot to all :)

Re: SMS Notification for service recovery

Posted: Tue Jan 15, 2019 6:00 pm
by scottwilkerson
morabanc wrote:Hi npolovenko,

Thanks for your advice but I solved the problem.

All config are ok but our script don't work correctly and won't send sms when they receive a Recovery flag ($NOTIFICATIONTYPE$).


Thanks a lot to all :)
glad to hear it is resolved!

Locking thread