Notification Check Timeperiod

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
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Notification Check Timeperiod

Post by kwhogster »

Nagios Core 4.1

Still get Alerts event tho I have check_period and notification_period set
Why does it still show on my Probles display

My services example

Code: Select all

define service{
        use                     generic-service
        host_name               TGKW007
        service_description     CPU Load
        servicegroups           CPULoad
        check_command           check_nrpe!alias_cpu
        check_period            backup_time
        notification_period     backup_time
        }
define service{
        use                     generic-service
        host_name               TGKW007
        service_description     Memory Usage
        check_command           check_nrpe!alias_mem
        servicegroups           MemUsage
        check_period            backup_time
        notification_period     backup_time
        }
My timeperiod

Code: Select all

define timeperiod{
        timeperiod_name                         backup_time
        alias                                   backup_time
        sunday                                  00:00-19:00,07:00-24:00
        monday                                  00:00-19:00,07:00-24:00
        tuesday                                 00:00-19:00,07:00-24:00
        wednesday                               00:00-19:00,07:00-24:00
        thursday                                00:00-19:00,07:00-24:00
        friday                                  00:00-19:00,07:00-24:00
        saturday                                00:00-19:00,07:00-24:00
        }
                        
So why does my services show up when I do not monitor them ? What am I missing here.

Thanks

Tom
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Notification Check Timeperiod

Post by rkennedy »

Post the full headers of the email.
Former Nagios Employee
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Notification Check Timeperiod

Post by kwhogster »

Here is an example

It is like they are not even checking to see the timeperiod settings

Received: from TGCS017.our.network.tgcsnet.com (10.2.8.79) by
tgcs025.our.network.tgcsnet.com (10.2.8.36) with Microsoft SMTP Server id
14.3.319.2; Tue, 28 Feb 2017 19:28:12 -0500
Received: by TGCS017.our.network.tgcsnet.com (Postfix, from userid 1001) id
56AB11603F0; Tue, 28 Feb 2017 19:28:09 -0500 (EST)
Date: Tue, 28 Feb 2017 19:28:08 -0500
To: <systems-alert@tgcsnet.com>
Subject: ** PROBLEM Service Alert: Windows 7 PRO/NRPE Status
TGKW008 is CRITICAL **
User-Agent: s-nail v14.8.6
Message-ID: <20170301002811.56AB11603F0@TGCS017.our.network.tgcsnet.com>
From: <nagios@nagios.notify>
MIME-Version: 1.0
Content-Type: text/plain
Return-Path: nagios@nagios.notify
X-MS-Exchange-Organization-AuthSource: TGCS025.our.network.tgcsnet.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-Antispam-Report: IPOnAllowList
X-MS-Exchange-Organization-SCL: -1
X-Auto-Response-Suppress: DR, OOF, AutoReply



Received: from TGCS017.our.network.tgcsnet.com (10.2.8.79) by
tgcs025.our.network.tgcsnet.com (10.2.8.36) with Microsoft SMTP Server id
14.3.319.2; Tue, 28 Feb 2017 19:30:55 -0500
Received: by TGCS017.our.network.tgcsnet.com (Postfix, from userid 1001) id
34A12160444; Tue, 28 Feb 2017 19:30:55 -0500 (EST)
Date: Tue, 28 Feb 2017 19:30:55 -0500
To: <systems-alert@tgcsnet.com>
Subject: ** RECOVERY Service Alert: Windows 7 PRO/NRPE Status
TGKW008 is OK **
User-Agent: s-nail v14.8.6
Message-ID: <20170301003055.34A12160444@TGCS017.our.network.tgcsnet.com>
From: <nagios@nagios.notify>
MIME-Version: 1.0
Content-Type: text/plain
Return-Path: nagios@nagios.notify
X-MS-Exchange-Organization-AuthSource: TGCS025.our.network.tgcsnet.com
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-Antispam-Report: IPOnAllowList
X-MS-Exchange-Organization-SCL: -1
X-Auto-Response-Suppress: DR, OOF, AutoReply
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Notification Check Timeperiod

Post by mcapra »

Your time period seems a bit off:

Code: Select all

define timeperiod{
        timeperiod_name                         backup_time
        alias                                   backup_time
        sunday                                  00:00-19:00,07:00-24:00
        monday                                  00:00-19:00,07:00-24:00
        tuesday                                 00:00-19:00,07:00-24:00
        wednesday                               00:00-19:00,07:00-24:00
        thursday                                00:00-19:00,07:00-24:00
        friday                                  00:00-19:00,07:00-24:00
        saturday                                00:00-19:00,07:00-24:00
        }
                 


This would effectively be from 12:00am to 07:00pm, then 07:00am to 11:59pm every day. Due to the overlap, this is effectively a 24 hour time period every day. Could you tell us what you'd like to accomplish with this time period?
Former Nagios employee
https://www.mcapra.com/
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Notification Check Timeperiod

Post by kwhogster »

Oh

My backup time starts at 7:00 PM and stop at 7:00 AM

Suggestions

Code: Select all

define timeperiod{
        timeperiod_name                         backup_time
        alias                                   backup_time
        sunday                                  19:00-07:00
        monday                                 19:00-07:00
        tuesday                                 19:00-07:00
        wednesday                            19:00-07:00
        thursday                                19:00-07:00
        friday                                    19:00-07:00
        saturday                                19:00-07:00
        }
                        

Is this correct?

Will I get notifications during this time? I do not want any notification during this time period


Thanks

Tom
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Notification Check Timeperiod

Post by mcapra »

kwhogster wrote:My backup time starts at 7:00 PM and stop at 7:00 AM
In that case, since the backup runs overnight and spills into 2 distinct days, this time period might make more sense:

Code: Select all

define timeperiod{
        timeperiod_name						backup_time
        alias								backup_time
        sunday								00:00-07:00,19:00-24:00
        monday								00:00-07:00,19:00-24:00
        tuesday								00:00-07:00,19:00-24:00
        wednesday							00:00-07:00,19:00-24:00
        thursday							00:00-07:00,19:00-24:00
        friday								00:00-07:00,19:00-24:00
        saturday							00:00-07:00,19:00-24:00
        }
This says "midnight to 7am, and 7pm-midnight" for any given day. Due to each day having the same definition, this should effectively encompass a 7am-7pm time period each day.
Former Nagios employee
https://www.mcapra.com/
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Notification Check Timeperiod

Post by kwhogster »

Looks Good

Lets lock this one now

Thank you
Locked