[icinga-checkins] icinga.org: icinga-core/master: core: fix services with empty hostgroups aren' t processed even if it has host_name specified (allow_empty_hostgroups=1) ( thx Viranch Metha) #3736

git at icinga.org git at icinga.org
Thu Mar 21 17:12:37 CET 2013


Module: icinga-core
Branch: master
Commit: 739287b6f7742d951248724300f8410312dda539
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=739287b6f7742d951248724300f8410312dda539

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sun Mar 10 15:13:24 2013 +0100

core: fix services with empty hostgroups aren't processed even if it has host_name specified (allow_empty_hostgroups=1) (thx Viranch Metha) #3736

refs #3736

---

 Changelog           |    1 +
 xdata/xodtemplate.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index 7681952..5262f77 100644
--- a/Changelog
+++ b/Changelog
@@ -41,6 +41,7 @@ FIXES
 * core: fix keep_unknown_macros still exposes wrong warnings to logs #3725 - MF
 * core: fix host_check, last_check == next_check wrong in scheduling queue #2195 - MF
 * core: fix triggered downtimes for child hosts are missing after icinga restart (thx Michael Lucka) #3390 - MF
+* core: fix services with empty hostgroups aren't processed even if it has host_name specified (allow_empty_hostgroups=1) (thx Viranch Metha) #3736 - MF
 
 * idoutils: fix many memory leaks in ido2db on dbi_result_free and others (thx Klaus Wagner) #3406 - MF
 * idoutils: fix ido2db crashes when Oracle queries fail #3324 - GB
diff --git a/xdata/xodtemplate.c b/xdata/xodtemplate.c
index 4ef5281..a21ddcb 100644
--- a/xdata/xodtemplate.c
+++ b/xdata/xodtemplate.c
@@ -4058,7 +4058,9 @@ int xodtemplate_duplicate_services(void) {
 				} else {
 					/* User is ok with hostgroup -> service mappings with no hosts */
 					if (allow_empty_hostgroup_assignment == 1) {
-						continue;
+						/* skip the service only if it doesn't have host_name entry either */
+						if (temp_service->host_name == NULL)
+							continue;
 					}
 				}
 			}





More information about the icinga-checkins mailing list