Page 1 of 1

Timeperiod Assistance

Posted: Fri Apr 11, 2014 9:02 am
by and1100
Hello,

My goal is to have notifications for a specific host be sent out only during the hours of 6AM est and 5pm est, Monday through Friday. All other hours will not send any alerts. I have defined the following timeperiod in timeperiods.cfg

Code: Select all

define timeperiod{
        timeperiod_name test-uptime
        alias           Uptime Hours

        use             us-holidays             ; Get holiday exceptions from other timeperiod

        monday          06:01-17:00
        tuesday         06:01-17:00
        wednesday       06:01-17:00
        thursday        06:01-17:00
        friday          06:01-17:00
        }
In my linux.cfg, for the host, it looks as follows:

Code: Select all

define host{
        use                     linux-server
        host_name               testserver
        alias                   teserver
        address                 x.x.x.x
        hostgroups              linux
        max_check_attempts      2
        notification_interval   30
        notification_period     test-uptime
        hostgroups              testgroup
        contacts                blah
        }
As I was going through the configs accumulating the information, I may have realized my error. Do I need to define the notification_period for each specific service that is being checked?

Thanks.

Re: Timeperiod Assistance

Posted: Fri Apr 11, 2014 1:56 pm
by and1100
Also, if do need to add notification_period for the specific servers, how would I then only do it for one specific server in a hostgroup. Would I need to create a separate service check separate from the hostgroup for that one host?

Re: Timeperiod Assistance

Posted: Fri Apr 11, 2014 2:09 pm
by abrist
and1100 wrote:Do I need to define the notification_period for each specific service that is being checked?
Only if you need to override host/template settings, otherwise you could set the timeperiod on the host or on the template.
and1100 wrote:Would I need to create a separate service check separate from the hostgroup for that one host?
Not necessarily. Settings on the object itself will override settings on the hostgroup/etc. Basically, the closer you are to the host/service object, the higher precedence your settings take.

Re: Timeperiod Assistance

Posted: Sun Apr 13, 2014 1:08 pm
by and1100
Hi abrist,

Thank you for the response and information. I have set the timeperiod on the host definition but I still seem to be receiving the alerts when I'd like them to be suppressed.

I double checked the configuration in the GUI has well and it looks to have stuck for the host:


Time Period test-uptime
Name Alias/Description Exclusions Days/Dates Times
test-uptime test Uptime Hours december 25 00:00:00 - 00:00:00
july 4 00:00:00 - 00:00:00
january 1 00:00:00 - 00:00:00
thursday 4 november 00:00:00 - 00:00:00
monday 1 september 00:00:00 - 00:00:00
monday -1 may 00:00:00 - 00:00:00
monday 06:01:00 - 17:00:00
tuesday 06:01:00 - 17:00:00
wednesday 06:01:00 - 17:00:00
thursday 06:01:00 - 17:00:00
friday 06:01:00 - 17:00:00

Is there something I am not seeing?

Thank you!

Re: Timeperiod Assistance

Posted: Mon Apr 14, 2014 10:07 am
by slansing
No that looks fine to me, can you verify your configuration and show us the output?:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Also, you are sure that you restarted nagios correct?

Re: Timeperiod Assistance

Posted: Mon Apr 21, 2014 11:20 am
by and1100
Hi - yep I have definitely restarted Nagios.

Combing through the configs again.

Thank you.

Re: Timeperiod Assistance

Posted: Tue Apr 22, 2014 11:04 am
by slansing
Are you just testing this with the host? You will want to assign the time period to either your services, or your contact(s)/groups that are assigned to them as well to suppress those notifications.