Re: [Nagios-devel] Null hostgroups

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.
Locked
Guest

Re: [Nagios-devel] Null hostgroups

Post by Guest »

Moshe Hyzon wrote:
> hey all,
>
> I had written this up a few months ago, and I just recently noticed
> that someone has the same itch via the nagioscommunity.org Nagios
> Daemon Wishlist page. This patch issues a warning if a host group to
> has no members. I suppose one could do the same for service groups.
>
> It is a patch against 2.9, I've not updated to 2.10 yet.
>
> =======SNIP=======
> --- xdata/xodtemplate.c.orig 2007-05-10 10:48:38.000000000 -0400
> +++ xdata/xodtemplate.c 2007-05-10 10:53:11.000000000 -0400
> @@ -7708,11 +7708,10 @@
> /* add all members to hostgroup */
> if(this_hostgroup->members==NULL){
> #ifdef NSCORE
> - snprintf(temp_buffer,sizeof(temp_buffer)-1,"Error:
> Hostgroup has no members (config file '%s', starting on line
> %d)\n",xodtemplate_config_file_name(this_hostgroup->_config_file),this_hostgroup->_start_line);
> + snprintf(temp_buffer,sizeof(temp_buffer)-1,"Warning:
> Hostgroup has no explicit members (config file '%s', starting on line
> %d)\n",xodtemplate_config_file_name(this_hostgroup->_config_file),this_hostgroup->_start_line);
> temp_buffer[sizeof(temp_buffer)-1]='\x0';
> - write_to_logs_and_console(temp_buffer,NSLOG_CONFIG_ERROR,TRUE);
> +
> write_to_logs_and_console(temp_buffer,NSLOG_CONFIG_WARNING,TRUE);
> #endif
> - return ERROR;
> }
> for(host_name=strtok(this_hostgroup->members,",");host_name!=NULL;host_name=strtok(NULL,",")){
> strip(host_name);
> =======SNIP=======
>
>
> Moshe Hyzon
>
> ------------------------------------------------------------------------

This is certainly a debatable topic. I removed the warning messages
quite a while back because people didn't want to receive warnings when
they intended to have empty groups for future expansion...


Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked