Notification_Interval query

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.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Notification_Interval query

Post by neworderfac33 »

Good afternoon,

Although I have this in my templates.cfg:

Code: Select all

define host{
        name                    windows-server  ; The name of this host template
        use                     generic-host    ; Inherit default values from the generic-host template
        check_period            24x7            ; by default, Windows servers are monitored round the clock
        check_interval          5               ; Actively check the server every 5 minutes
        retry_interval          1               ; Schedule host check retries at 1 minute intervals
        max_check_attempts      10              ; Check each server 10 times (max)
        check_command           check-host-alive; Default command to check if servers are "alive"
        notification_period     24x7            ; Sends notifications out at any time - day or night
        notification_options    d,r
        notification_interval   0               ; Minutes or 0 Only send the FIRST notification
        contact_groups          admins          ; Notifications get sent to the admins by default
        hostgroups              windows-servers ; Host groups that Windows servers should be a member of
        register                0               ; DONT REGISTER THIS - ITS JUST A TEMPLATE
        }
I am receiving email notifcations every 60 minutes!

[Edit] I think I might just have answered my own question - do I need to add Notification_Interval = 0 into generic_host as well?

Code: Select all

define host{
        name                            generic-host    ; The name of this host template
        notifications_enabled           1               ; Host notifications are enabled
        event_handler_enabled           1               ; Host event handler is enabled
        flap_detection_enabled          1               ; Flap detection is enabled
        process_perf_data               1               ; Process performance data
        retain_status_information       1               ; Retain status information across program restarts
        retain_nonstatus_information    1               ; Retain non-status information across program restarts
        notification_period             24x7            ; Send host notifications at any time
        notification_interval           0
        register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
        }
[Edit] I set Notification_Interval to 0 in generic host as well and I'm STILL getting notifications every 60 minutes! :o

Thanks in advance

Pete
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Notification_Interval query

Post by neworderfac33 »

Changed the interval to 5 and it alerted every 5 minutes.
Then set it to ten and it alerted every 10 minutes.
I've just set it back to 0 and I'm waiting to see if it goes back to alerting every 60! I'll know in just under an hour!

Pete
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Notification_Interval query

Post by jdalrymple »

peterooney wrote:do I need to add Notification_Interval = 0 into generic_host as well?
No, the way template directives stack - the ones closest to the end definition are the effective ones. This doesn't really explain your behavior - are you sure it's a host notification that you're receiving every 60 minutes? You don't have any escalations set up or anything else?
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Notification_Interval query

Post by neworderfac33 »

No, I don't have anything like that set up - and the bad news is, an hour has passed with Notification_Interval set to 0 and the notifications have just started flooding in again! :-(

They're a mixture of disk space, application and service alerts, plus one to report the version of NSClient++

I was hoping that the act of changing the Notification_Interval a couple of times might have flushed the error out. It was OK with 5 minutes and 10 minutes, but setting it to 0 has started the alerts are coming at 60 minute intervals again.

I'm going to set it to 360 minutes before I finish for the day and see how that looks in the morning.

Thanks

Pete
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Notification_Interval query

Post by jdalrymple »

peterooney wrote:They're a mixture of disk space, application and service alerts, plus one to report the version of NSClient++
These are service notifications and you're messing about with your host definition. While there is implied inheritance, I suggest you start by fixing it at the service, then if we can figure that out, move on to trying to make implied inheritance work as you expect.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Notification_Interval query

Post by neworderfac33 »

You put me on the right track with your suggestion! Notification_Interval for "generic-service" was set to 60! Doh! :oops:

Something else I've learned after a couple of sleepless nights - thank you very much!

Pete
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Notification_Interval query

Post by jdalrymple »

Problem solved?

The bit I was talking about implied inheritence... in case you care - about 2/3 of the way down.

OK to mark solved and lock?
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Notification_Interval query

Post by neworderfac33 »

Well no, not just yet...

If I set Notification_Interval to 10 or 20 for example in

Code: Select all

define service{
        name                            generic-service         ; The 'name' of this service template
        active_checks_enabled           1                       ; Active service checks are enabled
        passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
        parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
        obsess_over_service             1                       ; We should obsess over this service (if necessary)
        check_freshness                 0                       ; Default is to NOT check service 'freshness'
        notifications_enabled           1                       ; Service notifications are enabled
        event_handler_enabled           1                       ; Service event handler is enabled
        flap_detection_enabled          1                       ; Flap detection is enabled
        process_perf_data               1                       ; Process performance data
        retain_status_information       1                       ; Retain status information across program restarts
        retain_nonstatus_information    1                       ; Retain non-status information across program restarts
        is_volatile                     0                       ; The service is not volatile
        check_period                    24x7                    ; The service can be checked at any time of the day
        max_check_attempts              3                       ; Re-check the service up to 3 times in order to determine its final (hard) state
        normal_check_interval           5                       ; Check the service every 5 minutes under normal conditions
        retry_check_interval            2                       ; Re-check the service every two minutes until a hard state can be determined
        contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group
        notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
        notification_interval           0                       ; Re-notify about service problems every hour
        notification_period             24x7                    ; Notifications can be sent out at any time
        register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        }

the emails are sent out at the correct interval.

When I set it to 0, they still come out every 60 minutes.

I'm going to try a few things - can you leave it open for the time being, please?

Pete
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Notification_Interval query

Post by jdalrymple »

You betcha. I wonder if setting it to 0 in a nagios service is interpreted as NULL under the hood... if that were the case that inheritance stuff would take over.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Notification_Interval query

Post by neworderfac33 »

Good morning, the puzzle is that if I specify CERTAIN notification intervals such as 15, 20, 30 etc, they they work correctly, indicating that it Nagios isn't inheriting its interval value from somewhere else.

The problem is, when I set it to 0, I can't for the life of me figure out how it's reverting to 60.

Is there a maximum value - can I set it to something silly like 1440 (24 hours)?

I'll keep trying.

Pete
Locked