Author: Lars Michelsen <[email protected]>
Date: Fri Oct 28 01:24:57 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Fri Oct 28 01:24:57 2011 +0200
automap: Improved coord parsing code to make it graphviz-2.6-22.2 compatible
---
ChangeLog | 3 +++
share/server/core/classes/NagVisAutoMap.php | 5 ++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 941051f..b901a68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@ Core
* Bugfix: Fixed problem with some PHP 5.1.2 installations while reading the
map configuration files
+Automap
+ * Improved coord parsing code to make it graphviz-2.6-22.2 compatible
+
1.6rc3
Core
* Bugfix: Fixed problem in summary state detection of downtime (resulted
diff --git a/share/server/core/classes/NagVisAutoMap.php
b/share/server/core/classes/NagVisAutoMap.php
index 2a72a71..399472c 100644
--- a/share/server/core/classes/NagVisAutoMap.php
+++ b/share/server/core/classes/NagVisAutoMap.php
@@ -467,6 +467,9 @@ class NagVisAutoMap extends GlobalMap {
* It might happen that there are html entities used in the url
* <area shape="rect"
href="/check_mk/view.py?view_name=host&site=&host=localhost"
target="_self" title="host_0" alt="" coords="4,4,20,20"/>
* <area shape="rect" id="node1"
href="/nv16/check_mk/view.py?view_name=host&site=&host=omd-nv16"
title="host_013612" alt="" coords="5,5,27,27"/>
+ *
+ * And there might also be a space after the coords parameter
+ * <area shape="rect"
href="/test1/check_mk/view.py?view_name=host&site=&host=test"
target="_self" title="host_a94a8f" alt="" coords="5,5,21,21" />
*
* Coord description:
* For a rectangle, you map the top left and bottom right corners. All
@@ -482,7 +485,7 @@ class NagVisAutoMap extends GlobalMap {
$sLine = str_replace('-', '-', $sLine);
// Extract the area objects
// Only parsing rect/polys at the moment
-
if(preg_match('/^<area\sshape="(rect|poly)"\s(id="[^"]+"\s)?href=".+[?&;]host=([^"]+)"(?:\starget="[a-zA-Z-_]*")?\stitle="[^"]+"\salt=""\scoords="([^"]+)"\/>$/i',
$sLine, $aMatches)) {
+
if(preg_match('/^<area\sshape="(rect|poly)"\s(id="[^"]+"\s)?href=".+[?&;]host=([^"]+)"(?:\starget="[a-zA-Z-_]*")?\stitle="[^"]+"\salt=""\scoords="([^"]+)"\s?\/>$/i',
$sLine, $aMatches)) {
if(isset($aMatches[1]) && isset($aMatches[2]) &&
isset($aMatches[3]) && isset($aMatches[4])) {
$type = $aMatches[1];
$name1 = str_replace('-', '-', trim($aMatches[3]));
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins