0

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 ?

3
  • Was your host down at this time? Scheduled downtime for a host doesn't imply downtime for all its services, so if the host is up, but services are down, those will still notify. – MadHatter Jul 18 '16 at 13:23
  • Yes they were down. So now I created a services template for my servers services with the correct time period. Thanks – Pierre Bressand Jul 18 '16 at 13:41
  • Glad you got it working. I note in passing that you seem to be using the term scheduled downtime other than how NAGIOS uses it; what you describe above is not scheduled downtime, as lazyfrosch also noted. Should you want to ask more questions on the subject, it might be helpful to use the same terms the NAGIOS people use. – MadHatter Jul 18 '16 at 14:49
2

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.

1
  • I think Nagios was clever enough to suspend services notifications for thoses hosts during non monitoring period. I created a services template for my servers services with the correct time period. Thank you ! – Pierre Bressand Jul 18 '16 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.