Page 1 of 1

Excluding Hosts from HostGroup

Posted: Mon Aug 04, 2014 5:45 am
by rajasegar
xi 2014R1.2

How do I configure this using the XI UI?

Code: Select all


 Excluding Hosts:
If you want to create identical services 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.

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

Re: Excluding Hosts from HostGroup

Posted: Mon Aug 04, 2014 12:02 pm
by lmiltchev
This is not exactly "straight forward" process in XI (if you want to use the Web UI instead of manually creating the configs and importing them)...

You can go to:

CCM->Services->Manage Hosts->and remove ALL of the assigned hosts. You will add them as a free variable instead, so go to the "Misc Settings" tab->"Manage Variable Definitions" and add:

Variable name = "host_name"
Variable value = "HOST1,HOST2,!HOST3,!HOST4,...,HOSTN"

Save, and Apply Configuration.

Re: Excluding Hosts from HostGroup

Posted: Mon Aug 04, 2014 6:14 pm
by rajasegar
lmiltchev wrote:This is not exactly "straight forward" process in XI (if you want to use the Web UI instead of manually creating the configs and importing them)...

You can go to:

CCM->Services->Manage Hosts->and remove ALL of the assigned hosts. You will add them as a free variable instead, so go to the "Misc Settings" tab->"Manage Variable Definitions" and add:

Variable name = "host_name"
Variable value = "HOST1,HOST2,!HOST3,!HOST4,...,HOSTN"

Save, and Apply Configuration.
I will explore other solutions. This will be a management problem in the long run.
Thanks.

BTW, what is this for? I can see the + which seems to be adding it in front of the hostnames
05-08-2014 07-12-34 AM.png

Re: Excluding Hosts from HostGroup

Posted: Mon Aug 04, 2014 8:39 pm
by Box293
This has to do with how objects coming through templates are handled.

+ = Additive, template objects and locally defined objects are combined
null = the option is not set
standard = local defined objects are used

Check out the documentation here which explains it with examples:

http://nagios.sourceforge.net/docs/3_0/ ... add_string

Re: Excluding Hosts from HostGroup

Posted: Mon Aug 04, 2014 8:53 pm
by rajasegar
Box293 wrote:This has to do with how objects coming through templates are handled.

+ = Additive, template objects and locally defined objects are combined
null = the option is not set
standard = local defined objects are used

Check out the documentation here which explains it with examples:

http://nagios.sourceforge.net/docs/3_0/ ... add_string
The template object also has the +, null and standard. What happens if I choose + in the template itself?

Re: Excluding Hosts from HostGroup

Posted: Mon Aug 04, 2014 10:05 pm
by Box293
If the template also used a template then it would combine that templates objects and it's own objects.