Nagios still send notifications for services during scheduled downtime

nagios

Three of my servers have a down time from 21:50 friday to 5:30 saturday.
So I configured the following time period in timeperiod.cfg :

define timeperiod{
        timeperiod_name 24x7_without_exclude_hours_for_AZE
        alias           24x7 without 21:50 for friday to 5:30 for saturday
        sunday          00:00-24:00
        monday          00:00-24:00
        tuesday         00:00-24:00
        wednesday       00:00-24:00
        thursday        00:00-24:00
        friday          00:00-21:50
        saturday        05:30-24:00
        }

Then in the template.cfg file I create one for these 3 servers :

define host{
        name                    windows-server-AZE  ; The name of this host template
        use                     generic-host    ; Inherit default values from the gene$
        check_period            24x7_without_exclude_hours_for_AZE            ; By def$
        check_interval          5               ; Actively check the server every 5 mi$
        retry_interval          1               ; Schedule host check retries at 1 min$
        max_check_attempts      10              ; Check each server 10 times (max)
        check_command           check-host-alive        ; Default command to check if $
        notification_period     24x7_without_exclude_hours_for_AZE            ; Send n$
        notification_interval   1440            ; Resend notifications every 24 hours
        notification_options    d,r             ; Only send notifications for specific$
        contact_groups          admins          ; Notifications get sent to the admins$
        hostgroups              windows-servers ; Host groups that Windows servers sho$
        register                0               ; DONT REGISTER THIS - ITS JUST A TEMP$
}

Finally on these 3 servers configuration I set :

define host{
        use             windows-server-AZE  ; Inherit default values fro$
        host_name       ServerAZE1       ; The name we're giving to t$
        alias           Server AZE 1       ; A longer name associated $
        address         XXX.XXX.XXX.XXX    ; IP address of the host
        }

But every friday at 22:00 I received plenty of mails like saying that the server AZE 1 CPU Load is CRITICAL because the server is not accessible on its IP and port.

Am I doing something wrong ?

Best Answer

First of all please note that *_period changes are not the same than a "scheduled downtime" in Nagios.

Your problem is that you set a *_period only on the host, but not on the services.

So your host check won't run and notify at the excluded times, but all the services will still run with the timeperiod from default.

Related Topic