[icinga-users] Icinga Configuration Check - Passive Service

Zachary McGibbon zachary.mcgibbon at gmail.com
Tue Mar 26 14:41:47 CET 2013


I'm not sure if anyone else is doing this but I thought I'd share a
neat little trick I did.  Our Icinga setup is quite large, 7300+ hosts
and 16000 services and they mostly all come from an Oracle database.
We run scripts that pulls the data every 4 hours and reloads Icinga
automatically.  Of course, there are often inconsistencies (mostly
child/parent relationships) so we need to know when something is
broken.  Since I get over 100+ emails from Icinga per day, I
automatically put them in a folder that I don't look at very often, so
even when my script runs every 4 hours, these failure emails go into
this folder too.

To remedy this situation, I created a passive service for my Icinga
host called 'Icinga Config'.  When my script runs to update my config,
at the end it checks if there were any errors and then sends a passive
check to this service.  Since I run Nagstamon on my desktop, I see the
alert right away when it breaks.

Examples:

define service{
	use						server_icinga
	service_description			Icinga Config
	active_checks_enabled		0
	notifications_enabled			1
	flap_detection_enabled		0
	check_freshness			0
	check_command			check_icinga_stats!0
	hostgroup_name			server_icinga
	servicegroups				icinga
}

Then my shell script that runs every 4 hours (just the last part):

# Event handler to submit check results
EVENTHANDLER="/usr/lib64/icinga/eventhandlers/submit_check_result"

# Set ICINGACHK
ICINGACHK="/var/spool/icinga/icinga.chk"

if [ -f $ICINGACHK ]; then
        $EVENTHANDLER etna "Icinga Config" 2 "CRITICAL - Please Verify
Icinga Config"
else
        $EVENTHANDLER etna "Icinga Config" 0 "OK - Icinga Config is Good"
fi

Enjoy!

- Zachary




More information about the icinga-users mailing list