nagios passive check and check period

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
steph007
Posts: 177
Joined: Mon Jul 24, 2017 12:00 pm

nagios passive check and check period

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagios passive check and check period

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
steph007
Posts: 177
Joined: Mon Jul 24, 2017 12:00 pm

Re: nagios passive check and check period

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagios passive check and check period

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked