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

Author: LaMi <[email protected]>
Date:   Wed Jan 13 10:07:34 2010 +0100

Fixed latest change in graphviz checks: dont redirect stdout; Changed parsing 
regex for generating the object positions on the automap in some graphviz 
versions

---

 share/server/core/classes/NagVisAutoMap.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/share/server/core/classes/NagVisAutoMap.php 
b/share/server/core/classes/NagVisAutoMap.php
index 9933cc0..cffa64e 100644
--- a/share/server/core/classes/NagVisAutoMap.php
+++ b/share/server/core/classes/NagVisAutoMap.php
@@ -364,11 +364,11 @@ class NagVisAutoMap extends GlobalMap {
                foreach($aMapCode AS $sLine) {
                        // Extract the area objects
                        // Only parsing rect/polys at the moment
-                       
if(preg_match('/^<area\sshape="(rect|poly)"\shref="\/nagios\/cgi-bin\/status\.cgi\?host=([^"]+)"\starget="_self"\stitle="[^"]+"\salt=""\scoords="([^"]+)"\/>$/i',
 $sLine, $aMatches)) {
-                               if(isset($aMatches[1]) && isset($aMatches[2]) 
&& isset($aMatches[3])) {
+                       
if(preg_match('/^<area\sshape="(rect|poly)"\s(id="[^"]+"\s)?href="\/nagios\/cgi-bin\/status\.cgi\?host=([^"]+)"\starget="_self"\stitle="[^"]+"\salt=""\scoords="([^"]+)"\/>$/i',
 $sLine, $aMatches)) {
+                               if(isset($aMatches[1]) && isset($aMatches[2]) 
&& isset($aMatches[3]) && isset($aMatches[4])) {
                                        $type = $aMatches[1];
-                                       $name1 = trim($aMatches[2]);
-                                       $coords = trim($aMatches[3]);
+                                       $name1 = trim($aMatches[3]);
+                                       $coords = trim($aMatches[4]);
                                        
                                        switch($type) {
                                                case 'rect':
@@ -507,7 +507,7 @@ class NagVisAutoMap extends GlobalMap {
                 * configured path
                 */
                // Check if dot can be found in path (If it is there 
$returnCode is 0, if not it is 1)
-               exec('which '.$binary.' >/dev/null 2>&1', $arrReturn, 
$returnCode1);
+               exec('which '.$binary.' 2>&1', $arrReturn, $returnCode1);
                
                if(!$returnCode1) {
                        
$this->CORE->getMainCfg()->setValue('automap','graphvizpath',str_replace($binary,'',$arrReturn[0]));


------------------------------------------------------------------------------
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