Page 1 of 1

Check Freshness does not work as expected

Posted: Thu May 10, 2018 4:23 am
by termcap
Hi,

Check freshness does not work for me as described in the documentation for some reason.

I have a service template wherein i've set the following params

Code: Select all

define service {
name snmptrap-service
event_handler_enabled 0
check_freshness 1
freshness_threshold 120
check_command report-stale
active_checks_enabled 0
passive checks_enabled 1
is_volatile 1
obsess 0
check_period 24x7
max_check_attempts 1
retain_status_information 1
retain_nonstatus_information 1
register 0
}
Then I go ahead and use this for one of my service as below

Code: Select all

define service {
use snmptrap-service
host_name my_server
service_description my_service
}
What I expect from the above setup is for Nagios to run the report-stale command if the service is not updated for more than 2 minutes, but, this never happens, infact the check_command is never invoked by Nagios even if I wait for hours together.

Can someone please point out where I am making a mistake in this setup.

Thanks,
Termcap

Re: Check Freshness does not work as expected

Posted: Thu May 10, 2018 4:52 pm
by tgriep
I don't know if what you copied to the post was corrupted but the passive checks enabled option is missing the underscore in it.
Make sure it it set.

Code: Select all

passive_checks_enabled 1
What version of Nagios are you running?

Can you enable passive check logging in the nagios.cfg file

Code: Select all

log_passive_checks=1
Save and restart the Nagios daemon

Code: Select all

service nagios restart
Then check the nagios.log file to see if that service is reporting that it is stale and it is forcing an immediate check.
Warning: The results of service ' passive1' on host 'localhost' are stale by 0d 0h 0m 15s (threshold=0d 0h 0m 45s). I'm forcing an immediate check of the service.

Re: Check Freshness does not work as expected

Posted: Sun May 13, 2018 1:41 am
by termcap
Hi,

1. I checked there is a '_' after passive, I copied the text incorrectly.

2. passive check logging is already enabled, but I can't any 'stale' logs for the service in question.

3. Yep, restarted nagios many times over :)

Re: Check Freshness does not work as expected

Posted: Mon May 14, 2018 10:01 am
by tgriep
What version of Nagios are you running?

Can you post the status.dat file from the server so we can view that service's current status and configuration?

Thanks