Servicegroup Negate

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Servicegroup Negate

Post by BanditBBS »

Wanted to create a static config file and define a servicegroup in it, like so:

Code: Select all

define servicegroup{
         servicegroup_name non_system
         alias everything except system
         members *
         servicegroup_members !system
}
What the end result is, I want every service to belong to this servicegroup EXCEPT the services that belong to "system" servicegroup. When I verify it says

Code: Select all

Error: Could not find member group '!system' specified in servicegroup 'non_system' (config file '/usr/local/nagios/etc/static/non_system.cfg', starting on line 1) 
I get the same thing if I instead try and ! the individual services. I know I could go through and add every defined service to the service group I want, but I would rather it be automatic like I was trying. When the datacenter isn't primary they want to disable notifications for all services in this new service group. Can anyone think of what I am doing wrong or suggest another method. From what I am seeing, doesn't look like you can use ! in servicegroup definitions.
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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Servicegroup Negate

Post by Box293 »

Have a read of this thread and see if it helps your cause.

http://support.nagios.com/forum/viewtop ... =7&t=25137
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Servicegroup Negate

Post by BanditBBS »

Box293 wrote:Have a read of this thread and see if it helps your cause.

http://support.nagios.com/forum/viewtop ... =7&t=25137
Box, that thread is saved in my favorites, it's one I refer to often and what gave me the idea I had in this case. It works fine with services and hosts, but not when trying to exclude services or servicegroups from a servicegroup. As I said in the opening post, it is like the servicegroup definition doesn't obey the ! and thinks it is part of the service or servicegroup name and errors out.

Thanks for the input though!

EDIT: Actually, after I read it further, that isn't the thread i have saved, but same content, lol
Last edited by BanditBBS on Fri Jun 13, 2014 8:10 am, edited 1 time in total.
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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Servicegroup Negate

Post by Box293 »

Yeah I get what you're saying.

I just went and had a play in Core 4.x and 3.5.x and it seems the same behaviour is exhibited there. It does not look like you can perform exclusions in servicegroups or hostgroups.

Also, I found in servicegroups you cannot have members with the * wildcard. You need to specify host,service in pairs. You can use a wildcard for the service though. Example:

Code: Select all

members                 E4300,*,Test CentOS,*,localhost,*
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Servicegroup Negate

Post by BanditBBS »

I just went and edited all but one template and added the service group to them. It wasn't too bad, luckily only have about 35 templates.

Feel free to close this up and/or to tell me what I was doing wrong :|
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
Locked