Page 1 of 1

nagios passive check and check period

Posted: Sat Jan 26, 2019 9:44 am
by steph007
Hi,

I realized that when I used passive script for monitoring, the state of the service change even if it's not in the check period. That cause my event handler to be launched and send alert to my external paging/ticketing system even if the service is not into the check period!

Is there a way to avoid this? Why we can specify a check period if it's not taking in count for passive service?
Is there a macro I can use into my event handler script to validate if the service is in the check period or not?

Re: nagios passive check and check period

Posted: Mon Jan 28, 2019 2:14 pm
by lmiltchev
The check period directive applies to active checks only. Quote from our official documentation:
Service - check period

This directive is used to specify the short name of the time period during which active checks of this service can be made.

Parameter name: check_period
Required: yes
Passive checks are NOT initiated by nagios. They are usually run on some kind of schedule on the remote box, e.g. cron. The best was to solve the issue would be to set up a schedule on the remove machine that would use your desired "check period".

Note: This will not work for all passive checks. For example, some of the passive checks, e.g. SNMP traps for security events, may trigger at any time.

Re: nagios passive check and check period

Posted: Tue Jan 29, 2019 5:02 pm
by steph007
Hi,

Thanks for the answer.
But this will not be simple to me.
I monitor 900+ servers and half of them have a passive script that is launched by crontab every 10 minutes.
Controlling when the passive script can send status to Nagios will not be easy!
I have to take in count special holiday that can be vary over time.
Would be much more simple to controlling the check period by Nagios with Time Period.

Re: nagios passive check and check period

Posted: Tue Jan 29, 2019 5:23 pm
by scottwilkerson
steph007 wrote:Hi,

Thanks for the answer.
But this will not be simple to me.
I monitor 900+ servers and half of them have a passive script that is launched by crontab every 10 minutes.
Controlling when the passive script can send status to Nagios will not be easy!
I have to take in count special holiday that can be vary over time.
Would be much more simple to controlling the check period by Nagios with Time Period.
Nagios can only control the time of the checks with time periods if it is scheduling the active check.

Nagios cannot control the time of the check if it is being triggered by some remote crontab