[icinga-checkins] icinga.org: icinga-web/master: * Fixed max_attempt fields in templates ( fixes #2459)

git at icinga.org git at icinga.org
Tue Apr 24 15:01:14 CEST 2012


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

Author: root <root at ws-jmosshammer-vm.(none)>
Date:   Fri Mar 23 09:07:36 2012 +0100

* Fixed max_attempt fields in templates (fixes #2459)

---

 app/modules/Api/config/views/host.xml              |    9 ++++++---
 app/modules/Api/config/views/service.xml           |    1 +
 .../xml/grid/icinga-unhandled-host-problems.xml    |   17 +++++++++++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/app/modules/Api/config/views/host.xml b/app/modules/Api/config/views/host.xml
index 53e9117..9aa34cd 100644
--- a/app/modules/Api/config/views/host.xml
+++ b/app/modules/Api/config/views/host.xml
@@ -20,6 +20,7 @@
                 hs.output AS HOST_OUTPUT,
                 hs.current_check_attempt AS HOST_CURRENT_CHECK_ATTEMPT,
                 hs.max_check_attempts AS HOST_MAX_CHECK_ATTEMPT,
+                hs.max_check_attempts AS max_attempt,
                 i.instance_id AS HOST_INSTANCE_ID,
                 h.host_id AS HOST_ID,
                 hs.notifications_enabled as notifications_enabled,
@@ -93,17 +94,19 @@
             <query>
             <![CDATA[
             SELECT DISTINCT
-                h.icon_image HOST_ICON_IMAGE,
+                   h.icon_image AS SERVICE_ICON_IMAGE,
                 i.instance_name AS INSTANCE_NAME,
                 h.host_object_id AS HOST_OBJECT_ID,
                 oh.name1 AS HOST_NAME,
                 h.alias AS HOST_ALIAS,
                 h.display_name AS HOST_DISPLAY_NAME,
                 hs.current_state AS HOST_CURRENT_STATE,
+                COALESCE(hs.last_state_change,ps.program_start_time) AS DURATION_START,
                 hs.last_check AS HOST_LAST_CHECK,
+                ps.program_start_time AS HOST_PROGRAM_START_TIME,
                 hs.output AS HOST_OUTPUT,
                 hs.current_check_attempt AS HOST_CURRENT_CHECK_ATTEMPT,
-                hs.max_check_attempts AS HOST_MAX_CHECK_ATTEMPTS,
+                hs.max_check_attempts AS HOST_MAX_CHECK_ATTEMPT,
                 i.instance_id AS HOST_INSTANCE_ID,
                 h.host_id AS HOST_ID,
                 hs.notifications_enabled as notifications_enabled,
@@ -119,7 +122,7 @@
                 hs.scheduled_downtime_depth = 0
             )
             INNER JOIN h.object oh
-
+            INNER JOIN i.programstatus as ps
             ]]>
             </query>
 
diff --git a/app/modules/Api/config/views/service.xml b/app/modules/Api/config/views/service.xml
index 0bd7012..7025c8d 100644
--- a/app/modules/Api/config/views/service.xml
+++ b/app/modules/Api/config/views/service.xml
@@ -134,6 +134,7 @@
                 ss.output AS SERVICE_OUTPUT,
                 ss.current_check_attempt AS SERVICE_CURRENT_CHECK_ATTEMPT,
                 ss.max_check_attempts AS SERVICE_MAX_CHECK_ATTEMPTS,
+                ss.max_check_attempts AS service_max_attempt,
                 i.instance_id AS SERVICE_INSTANCE_ID,
                 s.service_id AS SERVICE_ID,
                 ss.notifications_enabled as notifications_enabled,
diff --git a/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml b/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml
index 5c4fbcd..3fbab43 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml
@@ -1071,6 +1071,23 @@
                 <parameter name="default">false</parameter>
             </order>
         </field>
+        <field name="max_attempt">
+            <datasource>
+                <parameter name="field">HOST_MAX_CHECK_ATTEMPT</parameter>
+            </datasource>
+            <display>
+                <parameter name="visible">false"</parameter>
+                <parameter name="label">Max attempt</parameter>
+            </display>
 
+            <filter>
+                <parameter name="enabled">false</parameter>
+            </filter>
+
+            <order>
+                <parameter name="enabled">false</parameter>
+                <parameter name="default">false</parameter>
+            </order>
+        </field>
     </fields>
 </template>





More information about the icinga-checkins mailing list