Check Freshness does not work as expected

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
termcap
Posts: 27
Joined: Sun Nov 27, 2016 3:09 pm

Check Freshness does not work as expected

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check Freshness does not work as expected

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
termcap
Posts: 27
Joined: Sun Nov 27, 2016 3:09 pm

Re: Check Freshness does not work as expected

Post 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 :)
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check Freshness does not work as expected

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked