I’m setting up distributed monitoring and I’ve configured a service to receive passive checks like so:
define service {
use passive-service
active_checks_enabled 0
check_freshness 1
hostgroup_name no-nagios-ssh
service_description CPU load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}
I have the same definition on a remote nagios server, except with ‘active_checks_enabled 1’. NSCA is set up between them, which works fine. However, I shut down my remove nagios server as well as the nsca daemon and the service continued to be updated (per the active check time), which tells me that this check is getting executed on my NAGIOS SERVER rather than on the machine I’m trying to monitor via passive checks.
What gives? Shouldn’t ‘active_checks_enabled 0’ prevent this?
I know the active_checks_enabled setting is in force because the GUI confirms that ‘Active Checks: Disabled’ on the page for that service.
I’m using Nagios 3.0.6-4-lenny2 (Debian Lenny package).
I figured it out. I enabled freshness checking thinking that this meant Nagios would flag passive checks that were out of date. Instead it means that Nagios will force an active check if a service is out of date even if active_checks_enabled is set to 0.
That said, how am I supposed to have Nagios flag out-of-date passive checks? One way would be to set the check_command on the server to a check_dummy that always returned UNKNOWN. However, I’ve got a scheme set up that uses perl’s Nagios::Config to read the server’s config files and write out special config files for a bunch of distributed servers (basically copies part of the config and sets passive checks to active). I’d rather not have to write more code mess with the check_command too.
Is there any magic “flag as unknown if last check time > 10 minutes” setting somewhere?
i dont’ remeber the details but you need check_freshness so it executes a check which tells you the results are out of date… i dont’ remebr the definitions sorry, not using passive checks anymore.
Check freshness is it, but that forces it to perform an active check even if active checks are disabled. This means you have to set up active checks for every service which use check_dummy to send an Unknown status. This works fine, but it’s just a pain to set up all the active checks. I’m also auto generating configs for my remote nagios instances (which are submitting the passive checks via NSCA) using perl Nagios::Config. The problem was that I was configuring check_command for my passive checks and then just flipping the active checks on with Nagios::Config before dumping the check for the client’s config. What I ended up doing was using a custom directive (_remote_check_command) which Nagios allows but ignores. I then use Nagios::Config to put that command in the check_command field before dumping the client config. It works pretty slick too. All my configuring is in one place on the server! I’ll upload some code if I ever get it stable enough for the masses.