hostgroup_name name1, !name2 config test fails on name2

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
jlwilkinson
Posts: 7
Joined: Wed Jul 13, 2016 9:03 am

hostgroup_name name1, !name2 config test fails on name2

Post 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?
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

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

Post 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?
Be sure to check out the Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

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