[icinga-checkins] icinga.org: icinga-web/master: * Bugfix in summary count

git at icinga.org git at icinga.org
Wed Feb 8 09:41:07 CET 2012


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Feb  8 09:40:26 2012 +0100

* Bugfix in summary count

---

 .../models/Provider/StatusSummaryModel.class.php   |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/modules/Cronks/models/Provider/StatusSummaryModel.class.php b/app/modules/Cronks/models/Provider/StatusSummaryModel.class.php
index c2b8f0b..524fbdf 100644
--- a/app/modules/Cronks/models/Provider/StatusSummaryModel.class.php
+++ b/app/modules/Cronks/models/Provider/StatusSummaryModel.class.php
@@ -142,9 +142,11 @@ class Cronks_Provider_StatusSummaryModel extends CronksBaseModel {
             
             $out[$state]['count'] += $record['x_count'];
             
-            $out[$state]['working'] = $out[$state]['count'] - $out[$state]['disabled'];
-            
-            $out[$state]['unacknowledged'] = $out[$state]['count'] - $out[$state]['acknowledged'] - $out[$state]['handled'];
+        }
+        
+        foreach ($out as $state=>$array) {
+            $out[$state]['working'] = ($g=(int)$out[$state]['count'] - (int)$out[$state]['disabled']) > 0 ? $g : 0;
+            $out[$state]['unacknowledged'] = ($g=(int)$out[$state]['count'] - (int)$out[$state]['acknowledged'] - (int)$out[$state]['handled']) > 0 ? $g : 0;
         }
         
         $sum = $this->createStateDescriptor(100, 'TOTAL', $type);





More information about the icinga-checkins mailing list