[icinga-checkins] icinga.org: icinga-web/master: Fixed service downtimes not retrieving host ids (fixes #3290)

git at icinga.org git at icinga.org
Mon Oct 15 11:30:48 CEST 2012


Module: icinga-web
Branch: master
Commit: 4c18d4079d94d30e3cad7826602314b078eedfae
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=4c18d4079d94d30e3cad7826602314b078eedfae

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Mon Oct 15 11:26:29 2012 +0200

Fixed service downtimes not retrieving host ids (fixes #3290)

---

 app/modules/Api/config/views/misc.xml |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/modules/Api/config/views/misc.xml b/app/modules/Api/config/views/misc.xml
old mode 100644
new mode 100755
index 5e9451f..1956afa
--- a/app/modules/Api/config/views/misc.xml
+++ b/app/modules/Api/config/views/misc.xml
@@ -45,7 +45,7 @@
                     d.scheduleddowntime_id   AS DOWNTIME_ID,
                     d.internal_downtime_id AS DOWNTIME_INTERNAL_DOWNTIME_ID,
                     d.downtime_type AS DOWNTIME_DOWNTIME_TYPE,
-                    h.host_object_id   AS HOST_OBJECT_ID,
+                    COALESCE(h.host_object_id,sh.host_object_id)   AS HOST_OBJECT_ID,
                     o.name1 AS HOST_NAME,
                     hs.current_state AS HOST_CURRENT_STATE,
                     s.service_object_id AS SERVICE_OBJECT_ID,
@@ -61,6 +61,7 @@
                INNER JOIN d.instance as i
                INNER JOIN d.object as o
                LEFT JOIN o.service as s
+               LEFT JOIN s.host as sh
                LEFT JOIN s.status as ss
                LEFT JOIN o.host as h
                LEFT JOIN h.status as hs                    
@@ -84,7 +85,7 @@
                     d.downtimehistory_id   AS DOWNTIME_ID,
                     d.internal_downtime_id AS DOWNTIME_INTERNAL_DOWNTIME_ID,
                     d.downtime_type AS DOWNTIME_DOWNTIME_TYPE,
-                    h.host_object_id   AS HOST_OBJECT_ID,
+                    COALESCE(h.host_object_id,sh.host_object_id)   AS HOST_OBJECT_ID,
                     o.name1 AS HOST_NAME,
                     hs.current_state AS HOST_CURRENT_STATE,
                     s.service_object_id AS SERVICE_OBJECT_ID,
@@ -102,6 +103,7 @@
                LEFT JOIN o.service as s
                LEFT JOIN s.status as ss
                LEFT JOIN o.host as h
+               LEFT JOIN s.host as sh
                LEFT JOIN h.status as hs                    
                WHERE (s.config_type = '${retained_flag}'
                OR h.config_type = '${retained_flag}')





More information about the icinga-checkins mailing list