Nagios Core and Host Escalations

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mreith
Posts: 2
Joined: Tue Feb 04, 2014 5:08 pm

Nagios Core and Host Escalations

Post by mreith »

Hey All,

I'm rather new here so I will do my best to post all the data I can.

I'm currently using Nagios Core 3.x, we are trying to get Host Escalations to work so that:

1) Host goes down
2) Sends alert to webdev
3) After the first message it moves down the ladder to admins (something simple to test)

These are the contents of my host file for host test.test.com:

Code: Select all

define host{

        host_name                       test
        alias                           test.test.com
        address                         test.test.com
        check_command                   check-host-alive
        check_interval                  0
        retry_interval                  1
        max_check_attempts              1
        flap_detection_enabled          0
        check_period                    24x7
        process_perf_data               1
        retain_nonstatus_information    0
        contact_groups                  webdev,admins
        notifications_enabled           1
        notification_interval           1
        notification_period             24x7
        notification_options            d,u,r

        }

define hostescalation{

        host_name test
        contact_groups webdev
        first_notification 1
        last_notification 2
        notification_interval 1
}

define hostescalation{

        host_name test
        contact_groups admins
        first_notification 2
        last_notification 5
        notification_interval 1

}
That is what I have so far. I have tried just about every combination I can think of, placed them in separate files, etc.. and it just won't work.

It seems to grab the contacts I have defined under the host, but ignores my escalations.

I will do my best to respond to any post and provide as much data as possible so I apologize in advance if i missed something obvious.
Last edited by abrist on Tue Feb 04, 2014 5:35 pm, edited 1 time in total.
Reason: code wraps save scroll wheels :)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Core and Host Escalations

Post by tmcdonald »

It seems you have the same contacts being escalated as you have being alerted normally. The result is that both devs and admins will be notified on the first problem and the escalations will not matter.

You want something like this:

Code: Select all

define host {
        host_name                       test
        alias                           test.test.com
        address                         test.test.com
        check_command                   check-host-alive
        check_interval                  5
        retry_interval                  1
        max_check_attempts              1
        flap_detection_enabled          0
        check_period                    24x7
        process_perf_data               1
        retain_nonstatus_information    0
        contact_groups                  webdev
        notifications_enabled           1
        notification_interval           10
        notification_period             24x7
        notification_options            d,u,r
}

define hostescalation {
        host_name test
        contact_groups admins
        first_notification 2
        last_notification 5
        notification_interval 10
}
You have a check interval of 0 which makes no sense so I set it to the default of 5. Your notification interval was 1 as well, so you'd get an email every minute (changed it to 10). Only one escalation is needed, the one for the admins since they are the "escalated" group and the webdevs are the normal contacts. I kept the last_notification at 5 but you can change that to 0 if you want them to get alerts for everything past the first.
Former Nagios employee
mreith
Posts: 2
Joined: Tue Feb 04, 2014 5:08 pm

Re: Nagios Core and Host Escalations

Post by mreith »

Alright so I used the settings you supplied to test the results and I am still just having webdev receiving the emails, it refuses to acknowledge the escalation. I just don't get it..
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Core and Host Escalations

Post by slansing »

Are you actually getting a second notification sent out? I assume you are verifying your configurations, and then restarting nagios correct after the changes?:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Locked