[dev.icinga.com #2619] unable to exclude hostgroups when using nested hostgroups #978
Comments
Updated by mfriedrich on 2012-07-31 19:19:33 +00:00
|
Updated by mfriedrich on 2012-08-01 02:26:00 +00:00 exclusions are not possible when recursing down into subgroups of host/service/contactgroup and their members. xdata/xodtemplate.c
as well as recursing all subgroup members down then.
the error is a bit misleading, as it's the function xodtemplate_find_real_hostgroup not finding the !hostname. either way, i do not really have an idea how to make exclusions work in this sector of the configs, especially since i do not know what other irritations such an exclusions could cause. |
Updated by mfriedrich on 2012-08-01 02:28:25 +00:00
using the attached config, one might test this diff - which requires rework for service and contact groups as well. still, i do not know what other troubles this might cause, so i won't put that into my git dev trees, but leave it here for testers feedback only.
|
Updated by ladams on 2012-08-01 03:32:02 +00:00 May I ask about the Warning? We use exclusions all over the place and don't see any warnings about them. Why would there be one here? |
Updated by mfriedrich on 2012-08-01 12:12:07 +00:00 that's debug output i left in the diff, intentionally. especially to see if you tested it, when providing output ;-) |
Updated by mfriedrich on 2012-08-11 19:19:57 +00:00
so, any updates on your tests? |
Updated by lcho@cloudmark.com on 2012-08-13 03:42:22 +00:00 I'm not going to be able to run these tests. We are on an older version still, and I don't have the time to take this on right now. I reported the bug because I saw an issue and that's what the forums said to do. If there are other developers/testers out there, I would prefer that they actually run this test. |
Updated by mfriedrich on 2012-08-22 18:12:46 +00:00
well, then find someone else wanting that feature as well. if that's so minor audience, i won't apply and maintain that upstream. though, once you are in the lucky position to upgrade you can probably test that as well. |
Updated by Animux on 2012-10-30 02:17:55 +00:00
I have tested the proposed patch and it does not work. The patch simply skips the hostgroup_members prefixed by a ! and does no rejection. I have reworked the hostgroup_member parsing and I could confirm that it works with my patch. The current design does not have the possibility to reject members, because every member is instantaneously appended to the member string and could there for not be removed later. My patch changes the parsing, so that the hostgroup_members are now parsed into two xodtemplate_memberlist (one for members and one for rejects) and all rejected elements get filtered out. The member string is only calculated at the end of the processing of the hostgroup. After applying my patch the listed config on top results in the following hostgroup definitions:
So it seems it works. I use this patch to specify services for some hosts, that are in two hostgroups:
Using my patch, the service is available for the hosts some and bar. |
Updated by mfriedrich on 2012-10-30 18:23:40 +00:00
very nice, thank you. let's see when i get time to test that one. who should the kudos be given to in case? |
Updated by Animux on 2012-10-30 20:46:10 +00:00 Alexander Sulfrian <alexander@sulfrian.net> |
Updated by mfriedrich on 2013-03-10 19:54:49 +00:00 hm, tried to apply the patch against my 1.9 tree, and it is not clean. nor is it for 1.8 ... on which basis is this one built against? |
Updated by Animux on 2013-03-13 20:21:56 +00:00 As specified the patch was based on icinga-1.7.1 from debian squeeze-backports. Should I rebase it in 1.9? |
Updated by mfriedrich on 2013-03-13 20:23:27 +00:00 would be great if you could rebase it against current git 'next' branch which will be the source for 1.9 then. |
Updated by Animux on 2013-03-21 10:07:38 +00:00
Here is the patch, rebased on top of next. |
Updated by mfriedrich on 2013-04-06 23:25:26 +00:00
without the patch
with the patch it works like a charm. thanks. |
Updated by mfriedrich on 2013-04-09 12:16:26 +00:00 patch lives in next now, anyone willing to test? |
Updated by mfriedrich on 2013-04-10 18:47:57 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/2619
Created by ladams on 2012-05-17 18:31:21 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2013-04-10 18:47:57 +00:00)
Target Version: 1.9
Last Update: 2013-04-10 18:47:57 +00:00 (in Redmine)
Below is a dummy config that illustrates the issue with Icinga 1.4.
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
}
When running verify, Error: Could not find member group '!groupB' specified in hostgroup
Since exclusions are allowed at all, I really feel like exclusions should be allowed here as well.
Attachments
Changesets
2013-04-06 23:24:33 +00:00 by (unknown) df5047f
The text was updated successfully, but these errors were encountered: