Excluding Hosts from HostGroup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Excluding Hosts from HostGroup

Post 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 ...
		}
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Excluding Hosts from HostGroup

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Excluding Hosts from HostGroup

Post 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
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Excluding Hosts from HostGroup

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Excluding Hosts from HostGroup

Post 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?
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Excluding Hosts from HostGroup

Post by Box293 »

If the template also used a template then it would combine that templates objects and it's own objects.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked