Service definition 'time-saving tips' possible bug

Tom Lichti tom at redpepperracing.com
Wed Oct 30 08:19:59 CET 2002


Well, after seeing how I could 'save time' with the tips, I spent a day 
re-organizing my services file into templates and multi-host services. And 
it didn't work. So much for saving time. Any service that has multiple 
hosts in the host_name line seem to be completely ignored, and do not 
generate errors with the nagios -v test.

The problem was that I had a host in the list of 'host_name' that didn't 
exist in the hosts definition. It didn't give a warning to that effect 
though, it just stopped processing the hosts after that. For example, I had

define service{
	use				generic-websrvr-service
	host_name 
	websrvr-100,websrvr-101,websrvr-102,websrvr-103,websrvr-104,websrvr-105,we
bsrvr-106,websrvr-107,websrvr-108,websrvr-109,websrvr-110,websrvr-112,websr
vr-113,websrvr-114,websrvr-115,websrvr-116,websrvr-117,websrvr-118,websrvr-
119
	service_description		Disk Space
        check_command                   check_all_disks_r!!85!95
	}

But websrvr-107 did not exist in the hosts file, so it appears that it 
stops processing the list of hosts if it finds one that does not exist in 
the hosts definitions. Ok, fine, except that there was no warning! Argh.

Anyway, I've fixed my services file, but that was a bit of pain to find.

Tom


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list