Author:   Lars Michelsen <[email protected]>
Date:     Thu Aug  1 15:11:53 2013 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Thu Aug  1 15:11:53 2013 +0200

Fixed error when summarizing counts for hostgroup objects

---

 share/frontend/nagvis-js/js/ajax.js                |    2 +-
 .../core/classes/GlobalBackendmklivestatus.php     |   11 ++++++-----
 share/userfiles/templates/default.css              |    7 +++++++
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/share/frontend/nagvis-js/js/ajax.js 
b/share/frontend/nagvis-js/js/ajax.js
index 4c1a2f8..65830de 100644
--- a/share/frontend/nagvis-js/js/ajax.js
+++ b/share/frontend/nagvis-js/js/ajax.js
@@ -344,7 +344,7 @@ function handleJsonResponse(sUrl, responseText) {
         oResponse = eval('( '+responseText+')');
         frontendMessageRemove('jsonError');
     } catch(e) {
-        jsonError("Invalid json response:\nTime:" + iNow + "\nURL: " + sUrl + 
"\nResponse: " + responseText);
+        jsonError("Invalid json response<div class=details>\nTime: " + iNow + 
"<br />\nURL: " + sUrl + "<br />\nResponse: <code>" + responseText + 
'</code></div>');
         return '';
     }
 
diff --git a/share/server/core/classes/GlobalBackendmklivestatus.php 
b/share/server/core/classes/GlobalBackendmklivestatus.php
index b6a33c1..a3fc8c5 100644
--- a/share/server/core/classes/GlobalBackendmklivestatus.php
+++ b/share/server/core/classes/GlobalBackendmklivestatus.php
@@ -1091,7 +1091,7 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
             $stateAttr = 'state';
 
         // Get host information
-        $l = $this->queryLivestatus("GET hosts".$host_suffix."\n" .
+        $q = "GET hosts".$host_suffix."\n" .
             $host_filter.
             // Count UNCHECKED
             "Stats: has_been_checked = 0\n" .
@@ -1131,7 +1131,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
             "Stats: ".$stateAttr." = 2\n" .
             "Stats: scheduled_downtime_depth > 0\n" .
             "StatsAnd: 2\n".
-            $host_grouping);
+            $host_grouping;
+        $l = $this->queryLivestatus($q);
 
         // If the method should fetch several objects and did not find
         // any object, don't return anything => The message
@@ -1153,9 +1154,9 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                         'downtime'  => intval($e[2+$hoffset]),
                     ),
                     DOWN => Array(
-                        'normal'    => intval($e[3]+$hoffset),
-                        'ack'       => intval($e[4]+$hoffset),
-                        'downtime'  => intval($e[5]+$hoffset),
+                        'normal'    => intval($e[3+$hoffset]),
+                        'ack'       => intval($e[4+$hoffset]),
+                        'downtime'  => intval($e[5+$hoffset]),
                     ),
                     UNREACHABLE => Array(
                         'normal'    => intval($e[6+$hoffset]),
diff --git a/share/userfiles/templates/default.css 
b/share/userfiles/templates/default.css
index a4a648a..4c87687 100644
--- a/share/userfiles/templates/default.css
+++ b/share/userfiles/templates/default.css
@@ -381,6 +381,13 @@ div.infopage a:hover {
     display: block;
     text-align: left;
     font-size: 10px;
+    width: 560px;
+    overflow: scroll;
+}
+
+#messageBoxDiv div.details {
+    text-align: left;
+    font-size: 10px;
 }
 
 /*


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to