Exclude hosts from a service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
fogier
Posts: 66
Joined: Fri Jul 13, 2012 12:53 am

Exclude hosts from a service

Post by fogier »

I saw a thread from about a year ago without a solution. Thought, I try again.

We have Nagios XI 2012 v2.3 running on the Nagios vm (centos 64bit) that you guys created.

I've got a lot of hosts where we check for diskspace (service for diskspace is linked to a hostgroup). However, I've got one hosts that need different thresholds. In the config-files you can normally use !hostname. XI creates them everytime you apply the configuration and the data is overwritten.

Is there a way in the webgui to do this? Can I exclude a host from a service.
I know there is a way to add a host to a service with and -, null, standard host option but I don't know what they mean.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Exclude hosts from a service

Post by abrist »

The negation (!) option does not currently work through the XI web ui. In order to utilize the negation feature, you will need to create a static config for the check. This config should be placed in the /usr/local/nagios/etc/static folder and managed by hand from the cli.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Exclude hosts from a service

Post by BanditBBS »

Is there any particular reason the negate function is not coded into XI? There have been cases where that would have really helped me out and I'd definitely prefer to use the Web UI and not static files. If there is no real reason, I'll go throw in a feature request.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Exclude hosts from a service

Post by sreinhardt »

No good reason that I can think of, request away!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Exclude hosts from a service

Post by BanditBBS »

Hey Fogier,

Go +1 my request :)

http://tracker.nagios.com/view.php?id=478
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Exclude hosts from a service

Post by scottwilkerson »

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.

I know this has been on the feature request list for a quite a while, there just hasn't been a good way to get it implemented within the confines of what we have to work with and might require major reworking of the CCM.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Exclude hosts from a service

Post by BanditBBS »

Ahh, I don't know about the fogier, but that actually will solve the issue 90% of the time for me.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
fogier
Posts: 66
Joined: Fri Jul 13, 2012 12:53 am

Re: Exclude hosts from a service

Post by fogier »

BanditBBS wrote:Hey Fogier,

Go +1 my request :)

http://tracker.nagios.com/view.php?id=478
You've got your +1! :D
fogier
Posts: 66
Joined: Fri Jul 13, 2012 12:53 am

Re: Exclude hosts from a service

Post by fogier »

We only work with hostgroups so I'm going to give this one a try.. Thanks Scott.

Edit: Works like a charm!
Locked