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

Author: Lars Michelsen <[email protected]>
Date:   Sat Oct  2 00:46:47 2010 +0200

#364 Add better error handling to the automap graphviz calls

---

 share/server/core/classes/NagVisAutoMap.php |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/share/server/core/classes/NagVisAutoMap.php 
b/share/server/core/classes/NagVisAutoMap.php
index c763534..9b31760 100644
--- a/share/server/core/classes/NagVisAutoMap.php
+++ b/share/server/core/classes/NagVisAutoMap.php
@@ -340,7 +340,16 @@ class NagVisAutoMap extends GlobalMap {
                        fclose($fh);
                        
                        // Parse map
-                       
exec($this->CORE->getMainCfg()->getValue('automap','graphvizpath').$binary.' 
-Tpng -o \''.$this->CORE->getMainCfg()->getValue('paths', 
'sharedvar').$this->name.'.png\' -Tcmapx 
'.$this->CORE->getMainCfg()->getValue('paths', 'var').$this->name.'.dot', 
$arrMapCode);
+                       $cmd = 
$this->CORE->getMainCfg()->getValue('automap','graphvizpath').$binary
+                              .' -Tpng -o 
\''.$this->CORE->getMainCfg()->getValue('paths', 
'sharedvar').$this->name.'.png\''
+                              .' -Tcmapx 
'.$this->CORE->getMainCfg()->getValue('paths', 'var').$this->name.'.dot 2>&1';
+
+                       exec($cmd, $arrMapCode, $returnCode);
+
+                       if($returnCode !== 0)
+                               new GlobalMessage('ERROR',
+                                      
$this->CORE->getLang()->getText('Graphviz call failed ([CODE]): [OUTPUT]<br 
/><br >Command was: "[CMD]"',
+                                      Array('CODE' => $returnCode, 'OUTPUT' => 
implode("\n",$arrMapCode), 'CMD' => $cmd)));
                        
                        $this->mapCode = implode("\n", $arrMapCode);
                }
@@ -765,7 +774,7 @@ class NagVisAutoMap extends GlobalMap {
         */
        private function fetchHostObjectByName($hostName) {
                $hostObject = new NagVisHost($this->CORE, $this->BACKEND, 
$this->backend_id, $hostName);
-               
$hostObject->setConfiguration($this->MAPCFG->getObjectConfiguration($hostName));
+               
$hostObject->setConfiguration($this->MAPCFG->getObjectConfiguration());
                $hostObject->setObjectId(0);
                $this->rootObject = $hostObject;
        }


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to