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

Author: LaMi <[email protected]>
Date:   Wed Dec 16 20:05:45 2009 +0100

 #176 Fixed parsing of warning/critical ranges

---

 share/userfiles/gadgets/gadgets_core.php |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/share/userfiles/gadgets/gadgets_core.php 
b/share/userfiles/gadgets/gadgets_core.php
index 96f3d2e..03c8e05 100644
--- a/share/userfiles/gadgets/gadgets_core.php
+++ b/share/userfiles/gadgets/gadgets_core.php
@@ -116,16 +116,20 @@ function parsePerfdata($sPerfdata) {
                if(isset($aTmp[4])) {
                        $aSet['warning'] = $aTmp[4];
                        preg_match_all('/([\d\.]+):([\d\.]+)/',$aTmp[4], 
$matches);
-                       $aSet['warning_min'] = $matches[1][0];
-                       $aSet['warning_max'] = $matches[2][0];
+                       if(isset($matches[0]) && isset($matches[0][0])) {
+                               $aSet['warning_min'] = $matches[1][0];
+                               $aSet['warning_max'] = $matches[2][0];
+                       }
                } else {
                        $aSet['warning'] = null;
                }
                if(isset($aTmp[5])) {
                        $aSet['critical'] = $aTmp[5];
                        preg_match_all('/([\d\.]+):([\d\.]+)/',$aTmp[5], 
$matches);
-                       $aSet['critical_min'] = $matches[1][0];
-                       $aSet['critical_max'] = $matches[2][0];
+                       if(isset($matches[0]) && isset($matches[0][0])) {
+                               $aSet['critical_min'] = $matches[1][0];
+                               $aSet['critical_max'] = $matches[2][0];
+                       }
                } else {
                        $aSet['critical'] = null;
                }


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to