Module: nagvis
Branch: master
Commit: b3413f7d13b60d2f3b0796ccd72b336699760249
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=b3413f7d13b60d2f3b0796ccd72b336699760249

Author: LaMi <[email protected]>
Date:   Tue Nov 17 12:50:46 2009 +0100

Fixed downtime detection when counting objects

---

 .../core/classes/GlobalBackendmklivestatus.php     |   54 ++++++++++---------
 1 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/share/server/core/classes/GlobalBackendmklivestatus.php 
b/share/server/core/classes/GlobalBackendmklivestatus.php
index 7d42ef6..107209b 100644
--- a/share/server/core/classes/GlobalBackendmklivestatus.php
+++ b/share/server/core/classes/GlobalBackendmklivestatus.php
@@ -287,8 +287,10 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
         * @author  Lars Michelsen <[email protected]>
         */
        private function queryLivestatusSingleRow($query) {
+               echo $query."\n";
                $l = $this->queryLivestatus($query);
                if(isset($l[0])) {
+                       print_r($l[0])."\n";
                        return $l[0];
                } else {
                        return Array();
@@ -1004,8 +1006,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count WARNING(DOWNTIME)
                   "Stats: ".$stateAttr." = 1\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n" .
                   // Count CRITICAL
@@ -1023,8 +1025,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count CRITICAL(DOWNTIME)
                   "Stats: ".$stateAttr." = 2\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n" .
                   // Count UNKNOWN
@@ -1042,8 +1044,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count UNKNOWN(DOWNTIME)
                   "Stats: ".$stateAttr." = 3\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n");
                
@@ -1110,8 +1112,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                         "StatsAnd: 2\n" .
                         // Count WARNING(DOWNTIME)
                         "Stats: ".$stateAttr." = 1\n" .
-                        "Stats: scheduled_downtime_depth = 1\n" .
-                        "Stats: host_scheduled_downtime_depth = 1\n" .
+                        "Stats: scheduled_downtime_depth > 0\n" .
+                        "Stats: host_scheduled_downtime_depth > 0\n" .
                         "StatsOr: 2\n" .
                         "StatsAnd: 2\n" .
                         // Count CRITICAL
@@ -1129,8 +1131,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                         "StatsAnd: 2\n" .
                         // Count CRITICAL(DOWNTIME)
                         "Stats: ".$stateAttr." = 2\n" .
-                        "Stats: scheduled_downtime_depth = 1\n" .
-                        "Stats: host_scheduled_downtime_depth = 1\n" .
+                        "Stats: scheduled_downtime_depth > 0\n" .
+                        "Stats: host_scheduled_downtime_depth > 0\n" .
                         "StatsOr: 2\n" .
                         "StatsAnd: 2\n" .
                         // Count UNKNOWN
@@ -1148,8 +1150,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                         "StatsAnd: 2\n" .
                         // Count UNKNOWN(DOWNTIME)
                         "Stats: ".$stateAttr." = 3\n" .
-                        "Stats: scheduled_downtime_depth = 1\n" .
-                        "Stats: host_scheduled_downtime_depth = 1\n" .
+                        "Stats: scheduled_downtime_depth > 0\n" .
+                        "Stats: host_scheduled_downtime_depth > 0\n" .
                         "StatsOr: 2\n" .
                         "StatsAnd: 2\n" .
                         "StatsGroupBy: host_name\n";
@@ -1218,7 +1220,7 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count DOWN(DOWNTIME)
                   "Stats: ".$stateAttr." = 1\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
                   "StatsAnd: 2\n" .
                   // Count UNREACHABLE
                   "Stats: ".$stateAttr." = 2\n" .
@@ -1231,7 +1233,7 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count UNREACHABLE(DOWNTIME)
                   "Stats: ".$stateAttr." = 2\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
                   "StatsAnd: 2\n");
                
                $aReturn['PENDING']['normal'] = $hosts[0];
@@ -1271,8 +1273,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count WARNING(DOWNTIME)
                   "Stats: ".$stateAttr." = 1\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n" .
                   // Count CRITICAL
@@ -1290,8 +1292,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count CRITICAL(DOWNTIME)
                   "Stats: ".$stateAttr." = 2\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n" .
                   // Count UNKNOWN
@@ -1309,8 +1311,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count UNKNOWN(DOWNTIME)
                   "Stats: ".$stateAttr." = 3\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n");
                
@@ -1377,8 +1379,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count WARNING(DOWNTIME)
                   "Stats: ".$stateAttr." = 1\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n" .
                   // Count CRITICAL
@@ -1396,8 +1398,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count CRITICAL(DOWNTIME)
                   "Stats: ".$stateAttr." = 2\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n" .
                   // Count UNKNOWN
@@ -1415,8 +1417,8 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                   "StatsAnd: 2\n" .
                   // Count UNKNOWN(DOWNTIME)
                   "Stats: ".$stateAttr." = 3\n" .
-                  "Stats: scheduled_downtime_depth = 1\n" .
-                  "Stats: host_scheduled_downtime_depth = 1\n" .
+                  "Stats: scheduled_downtime_depth > 0\n" .
+                  "Stats: host_scheduled_downtime_depth > 0\n" .
                   "StatsOr: 2\n" .
                   "StatsAnd: 2\n");
                


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to