Page 1 of 1

hostgroup_name name1, !name2 config test fails on name2

Posted: Wed Jul 13, 2016 3:02 pm
by jlwilkinson
I've got a configuration that works as expected in Core 3.5.1
In one .cfg file, I define a host group, call it name2.
in another .cfg file, I define a service with hostgroup_name name1, !name2

Indeed, the service is only defined for hosts in hostgroup name1 but not for hosts in hostgroup name2.

But under core 4.1.1, same configuration files, I get an error on that 2nd file, saying name2 could not be found.

I tried rearranging the order of specification of the separate configuration files in nagios.cfg, but no evident change.

Thoughts?

Re: hostgroup_name name1, !name2 config test fails on nam

Posted: Wed Jul 13, 2016 3:24 pm
by bwallace
This is odd, since it looks like you're doing this correctly. From our Core 4 Documentation....
https://assets.nagios.com/downloads/nag ... ricks.html
Excluding Hosts:
If you want to create identical host escalations on numerous hosts or hostgroups, but would like to exclude some hosts from the definition, this can be accomplished by preceding the host or hostgroup with a ! symbol.

Code: Select all

define hostescalation{
		host_name             HOST1,HOST2,!HOST3,!HOST4,...,HOSTN
		hostgroup_name                HOSTGROUP1,HOSTGROUP2,!HOSTGROUP3,!HOSTGROUP4,...,HOSTGROUPN
		other escalation directives ...
		}

Could you post the problematic cfg file here for us to review?

Re: hostgroup_name name1, !name2 config test fails on nam

Posted: Wed Jul 13, 2016 3:24 pm
by tgriep
We would have to see how the configuration files are setup to so can view the settings.
Can you post your nagios.cfg file and the other config files as well?

Also, in your example, you have a space between the , and the !, try removing that if is actually in your config file and see if that fixes it.

Re: hostgroup_name name1, !name2 config test fails on nam

Posted: Wed Jul 13, 2016 3:28 pm
by ssax
I'm using Core 4.1.1 and I've validated that it works properly on my system, PM one of us your configs and we'll take a look.