All but 1 Hostgroup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mdennis
Posts: 1
Joined: Tue Sep 29, 2015 10:37 am

All but 1 Hostgroup

Post by mdennis »

My company is using Nagios XI, so I'm wondering how I get a *,!hostgroup relation through the UI. I know I could just add all hostgroups and then remove the undesired group, but with template inheritance and hostgroups being assigned in multiple places, I'm looking for an overriding way to add all but a certain hostgroup to a host.

Thanks!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: All but 1 Hostgroup

Post by jolson »

Unfortunately there's no way to negate a hostgroup via the Web GUI. The workaround at this time is to make use of that static directory: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: All but 1 Hostgroup

Post by Box293 »

I believe it can be done using a free variable.

There is actually a way to do this in the CCM but it is a hack and does have one caveat I will explain...

You can negate hosts using the free variables settings on the Misc Settings tab.

Add a free variable

Variable Name = host_name
Variable value = !YOUR-HOST.COM,!YOUR-OTHER-HOST.COM


Now for the caveat....

This works perfectly fine if you have a service definition where you are adding hostgroups and want to just exclude a couple hosts. This will fail miserably if you also are adding individual hosts (in addition to hostgroups) because the free variable you set will in fact overwrite the individual hosts you have.


Does this work for you?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked