desactivate checks from host regular time

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
runouri
Posts: 3
Joined: Tue Feb 26, 2013 11:36 am

desactivate checks from host regular time

Post by runouri »

Hello
I have a host that have a BBDD backup at the 7:00 every monday. I need desactivate the notifications from this host between 7:00 7:30 every monday.
I think the correct form to do this is create a time period for exemple: define timeperiod{
timeperiod_name nocheck_host
alias No cpu check while backup host
sunday 00:00-24:00
monday 00:00-06:55,07:35-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
} How can aplicate this timeperiod only for this hosts?
Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: desactivate checks from host regular time

Post by slansing »

Hello,

Please see the following documentation for configuring timeperiods for hosts/service checking:

http://nagios.sourceforge.net/docs/3_0/timeperiods.html

http://nagios.sourceforge.net/docs/3_0/ ... ation.html
fran.pastor
Posts: 24
Joined: Tue Nov 22, 2011 3:17 am

Re: desactivate checks from host regular time

Post by fran.pastor »

This is only an example:

Code: Select all

define timeperiod{
        timeperiod_name 24x7_BD
        alias           24 Hours A Day, 7 Days A Week except BDTEMP_NOCHECK
        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-24:00
        saturday        00:00-24:00
        exclude         BDTEMP_NOCHECK
        }

define timeperiod{
        timeperiod_name BDTEMP_NOCHECK
        alias           No check from 22:30 to 05:00
        sunday          22:30-05:00
        monday          22:30-05:00
        tuesday         22:30-05:00
        wednesday       22:30-05:00
        thursday        22:30-05:00
        friday          22:30-05:00
        saturday        22:30-05:00
        }
Now, you can use a timepriod called 24x7_BD for this service checks.. This checks 24x7 except 22:30-05:00
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: desactivate checks from host regular time

Post by slansing »

Yes, that is only the first portion of the document, there are more examples down below specific to what you are looking to do.
runouri
Posts: 3
Joined: Tue Feb 26, 2013 11:36 am

Re: desactivate checks from host regular time

Post by runouri »

Thanks for the reply
But this example desactive all the notificacions for all the hosts. I need desactivate for 1 host only.
I'm reading the examples and investigate
Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: desactivate checks from host regular time

Post by slansing »

Good morning,

You could create a specific time period and apply it to that host, you do not need to use the same time period for all hosts. This would allow you a lot more customization.
runouri
Posts: 3
Joined: Tue Feb 26, 2013 11:36 am

Re: desactivate checks from host regular time

Post by runouri »

Yes but apply to determinate host I apply the specific time period in the file hosts, for exemple:
Hostsmylan.cfg:

Code: Select all

define host{
        use                             "Service"
        host_name                       XXX
        alias                           XXX
        address                         XXX.XXX.XXX.XXX
        contact_groups                  XXX
}
or

Code: Select all

define host{
        use                             XXX
        host_name                       XXX
        alias                           XXX
        address                         XXX.XXX.XXX.XXX
        contact_groups                  XXX
        timeperiod                   nocheck_host
}
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: desactivate checks from host regular time

Post by sreinhardt »

Aside from being a little vague, that looks fine. You may also want to apply the time_period to the service check though.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked