I changed my config slightly to really show what I'm trying to do by putting 
foo2 in groupA.
define hostgroup {
        hostgroup_name  groupA
        }
define hostgroup {
        hostgroup_name  groupB
        }
define host {
        use             generic-host
        host_name       foo
        address         127.0.0.1
        hostgroups      groupA
        }
define host {
        use             generic-host
        host_name       foo2
        address         127.0.0.1
        hostgroups      groupB,groupA
        }

define hostgroup {
        hostgroup_name  groupC
        hostgroup_members       groupA,!groupB
        }

So the end result that I wanted would be that groupC has the members: foo.
My objects.precache file does not show that.

define hostgroup {
        hostgroup_name  groupA
        members foo,foo2
        }

define hostgroup {
        hostgroup_name  groupB
        members foo2
        }

define hostgroup {
        hostgroup_name  groupC
        members foo,foo2
        }

So no, the hostgroup does not contain the members that I expect.

From: Wolfgang [mailto:w...@gmx.net]
Sent: Wednesday, May 16, 2012 10:08 AM
To: icinga-users@lists.sourceforge.net
Subject: Re: [icinga-users] nested hostgroups

Sorry for confusing you.
I just had another look at the lines that scrolled off the screen and I have to 
admit that I have this message too. But I guess that the last lines show no 
errors and the return code (echo $?) is 0 (that was what I was referring to 
when I wrote that I have no errors).
Please run the configuration check using the options -vp which creates a file 
called objects.precache in the var folder and verify that the hostgroup foo 
contains the members you expect.

Am 16.05.2012 17:58, schrieb Lori Adams:
Just saw this.   Interesting that you don't see the issue.  Is there any chance 
of a global config that allows/disallows this?  To me, it's odd how the error 
says it doesn't know of the group, '!hostgroupC', as if the '!' is part of the 
hostgroup name.

Thanks,
-Lori

On May 15, 2012, at 10:36 AM, "Wolfgang" <w...@gmx.net<mailto:w...@gmx.net>> 
wrote:
Am 15.05.2012 18:54, schrieb Lori Adams:
It's not a template and is definitely not empty.

It's pretty easy.  Create two hostgroups with hosts in them.  Then create a 
third hostgroup with hostgroup members where one of them is included, and the 
other excluded.
Notice that the error says "could not find group '!hostgroupC', as if it 
doesn't know how to handle exclusions in the hostgroup_members line.

-Lori

From: Wolfgang [mailto:w...@gmx.net]
Sent: Tuesday, May 15, 2012 9:33 AM
To: 
icinga-users@lists.sourceforge.net<mailto:icinga-users@lists.sourceforge.net>
Subject: Re: [icinga-users] nested hostgroups

Am 15.05.2012 18:09, schrieb Lori Adams:
Icinga 1.4.0

Is it true that I cannot do a hostgroup exclusion while attempting nested 
hostgroups?
define hostgroup {
                hostgroup_name foo
                hostgroup_members hostgroupA,hostgroupB,!hostgroupC
                }

Error: Could not find member group '!hostgroupC' specified in hostgroup

Any chance that this has been corrected in a newer version.  I'm aware that 
1.6.0 is out.

Lori Adams
Director of Operations Architecture
Cloudmark
510 388 8513 (M)

I cannot confirm your problem so please verify that hostgroupC exists (and is 
not a template or maybe an empty hostgroup).

I did create such a setup using Icinga 1.4.0 before writing the other posting 
;-).

Attached a (modified) localhost.cfg containing the following definitions:

define hostgroup{
    hostgroup_name hg1
    members localhost1
}
define hostgroup{
    hostgroup_name hg2
    members localhost2
}
define hostgroup{
    hostgroup_name hg3
    hostgroup_members hg1,!hg2
}

>From what I get that is similar to what you described. Attached an 
>objects.precache containing the following lines:

define hostgroup {
    hostgroup_name    hg1
    members    localhost1
    }

define hostgroup {
    hostgroup_name    hg2
    members    localhost2
    }

define hostgroup {
    hostgroup_name    hg3
    members    localhost1
    }

.../bin/icinga -vp complains about some missing services but there are no 
errors.
<objects.precache>
<localhost.cfg>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to