Found bugs in 1.1

Jason Martin jhmartin at toger.us
Fri Nov 21 20:53:30 CET 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello, I've found a few bugs in 1.1 that may be a bit troublesome.

One of them is that the 'notification_period' clause of a host is not
required. I had a template that was missing this clause and several hosts
that used the template.  When I tried running a Nagios compiled w/debug
enabled it coredumped when it tried to print out the host definition.

Another is that if a service dependency has neither of the 
execution_failure_criteria or notification_failure_criteria defined it is 
silently ignored.  I think a warning indicating that this 'lame' 
servicedependency exists should be thrown; I've attached a patch to effect 
this.

A third is that the following causes a coredump; I think the servicedep 
duplication function should detect when its trying to set up an 
immediately circular depedency. 

define servicedependency{
                hostgroup_name                  HOSTGROUP1
                service_description             Oracle
                dependent_hostgroup_name  	HOSTGROUP1
                dependent_service_description   *
       		execution_failure_criteria      n
       		notification_failure_criteria   w,u,c
                }


- -Jason Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.3 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/

iD8DBQE/vm1Kl2ODWuqVSBMRAoKwAKCCZYLsz8hneU5XbGVZMkJoro0rSACgkewS
ezmdnoSS5vLrJ2OfwENrDHc=
=/gO5
-----END PGP SIGNATURE-----
-------------- next part --------------
*** xodtemplate1.c	Fri Nov 21 10:32:57 2003
--- xodtemplate.c	Fri Nov 21 11:41:08 2003
***************
*** 5711,5716 ****
--- 5711,5722 ----
  			return ERROR;
  		        }
  	        }
+ 	    /* Throw a warning on servicedeps that have no options */
+ 	    if (this_servicedependency->have_notification_dependency_options==FALSE && this_servicedependency->have_execution_dependency_options==FALSE){
+ 	        snprintf(temp_buffer,sizeof(temp_buffer)-1,"Warning: Could not register lame service dependency (config file '%s', line %d)\n",xodtemplate_config_file_name(this_servicedependency->_config_file),this_servicedependency->_start_line);
+             temp_buffer[sizeof(temp_buffer)-1]='\x0';
+             write_to_logs_and_console(temp_buffer,NSLOG_CONFIG_ERROR,TRUE);
+ 	        }
  
  #ifdef DEBUG0
  	printf("xodtemplate_register_servicedependency() end\n");


More information about the Developers mailing list