Freshness threshold in passive host checks

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.
sneaky
Posts: 5
Joined: Mon Aug 15, 2011 10:38 am

Freshness threshold in passive host checks

Post by sneaky »

Hello. I am currently implementing a distrubuted Nagios setup. Whereas the service checks seem to work nicely, I am having some problems with the passive host checks.

In the non-distributed system hosts were checked with an interval of 5 minutes. I added the following settings in the host definition enabling passive checks:

active_checks_enabled 0
passive_checks_enabled 0
check_freshness 1
freshness_threshold 600

The central server receives data successfully from the distributed server, however:

If I stop nagios on the distributed server (or set obsess_over_hosts to 0), the central server does not seem to force active checks against the hosts when the freshness_threshold is exceeded (by hours/days).

Any idea what could be causing this? The fallback for the services is not a problem, just the hosts.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Freshness threshold in passive host checks

Post by mguthrie »

Try setting:

passive_checks_enabled 1

Also take a look a the Core docs on checking freshness
http://nagios.sourceforge.net/docs/3_0/freshness.html
sneaky
Posts: 5
Joined: Mon Aug 15, 2011 10:38 am

Re: Freshness threshold in passive host checks

Post by sneaky »

Sorry, totally my bad - gave you the wrong settings! These are the current settings:

active_checks_enabled 0
passive_checks_enabled 1
check_freshness 1
freshness_threshold 600

The passive checks are working, but when the central system is not receiving passive checks (if I disable them, or stop Nagios on the distributed server), the central server will not force checks even with the freshness_threshhold set.

I've read up on the docs, but I have yet to find the cause of this problem.

Thank you for the quick reply, and sorry again for posting the wrong settings. Any further hints would be greatly appreciated.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Freshness threshold in passive host checks

Post by mguthrie »

No worries ; )

Do you have:

Code: Select all

check_host_freshness=1
check_service_freshness=1
In the main nagios.cfg file? It might be turned off by default.
sneaky
Posts: 5
Joined: Mon Aug 15, 2011 10:38 am

Re: Freshness threshold in passive host checks

Post by sneaky »

Thank you so much! The central setting for host freshness had totally passed me by.

You really saved me a lot of debugging time. Awesome! :)
sneaky
Posts: 5
Joined: Mon Aug 15, 2011 10:38 am

Re: Freshness threshold in passive host checks

Post by sneaky »

Got another minor issue as well, though..

When disabling active checks (for hosts/services), the disabled.gif is showing. When enabling passive checks for services, this GIF is replaced with passiveonly.gif. However, this is not the case for hosts, so without adding the passive icon, you have really no idea wheter the "disabled" host is checked passively or not checked at all.

Any idea of how to get the same behaviour for the hosts? At the moment I am displaying the passive GIF next to disabled.gif, but would be nice not showing disabled.gif at all.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Freshness threshold in passive host checks

Post by mguthrie »

Good deal!

The icon issue may be a little more tricky, I think the change might need to take place in the actual cgi (and need to be recompiled). However, there are still a lot of tricks with Core that I don't know yet, so there could be a solution out there for that.

I think for Nagios V-Shell I used the logic that you're describing, and it only shows an icon if passive checks are enabled and active checks are disabled, but V-Shell doesn't have every feature that the Core cgi's have yet, so it may or may not get you what you need.
http://exchange.nagios.org/directory/Ad ... ll/details
sneaky
Posts: 5
Joined: Mon Aug 15, 2011 10:38 am

Re: Freshness threshold in passive host checks

Post by sneaky »

Sorry for the late response, I have been away the last few days.

Thanks for the V-Shell tip! Will definitely check it out.

The icon problem is just a minor "issue" I guess, as long as people know about it. :)
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: Freshness threshold in passive host checks

Post by SDohmen »

I am not sure if this will be helpfull but i solved this icon issue by using the ochp_command command to send over the passive results for the hosts. On the main server i disabled active checks for the hosts aswell which then gave me a red cross on the host itself because it doesn't have a active check anymore.
crfriend
Posts: 61
Joined: Thu Sep 01, 2011 7:53 am
Location: Central New England (USA)
Contact:

Re: Freshness threshold in passive host checks

Post by crfriend »

mguthrie wrote:The icon issue may be a little more tricky, I think the change might need to take place in the actual cgi (and need to be recompiled). However, there are still a lot of tricks with Core that I don't know yet, so there could be a solution out there for that.
This, in all probability will be a change to the actual CGI.

Passive host checks are a relatively new feature in Nagios so it may just be that the detection and display of passive checks for hosts just hasn't been put into the status.cgi executable. I've made tweaks to the actual CGIs in the past (primarily for changing the default for setting scheduled downtime on child hosts) but don't like doing so as the changes revert every time a new version of Nagios is released. Likely, displaying the "passive" icon for passive hosts can be fairly simply done by adapting the code for services (it's a half-dozen lines at most), but that's something that should go into the formal source-tree instead of folks making random one-offs of.
I think for Nagios V-Shell I used the logic that you're describing, and it only shows an icon if passive checks are enabled and active checks are disabled, but V-Shell doesn't have every feature that the Core cgi's have yet, so it may or may not get you what you need.
V-Shell is pretty cool, but it required me to change the maximum memory allocation in PHP from 128 megs to 512 (I have a large instance with many hosts and lots of services per host).
Locked