Author: Lars Michelsen <[email protected]>
Date: Fri Jul 8 12:41:34 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Fri Jul 8 12:41:34 2011 +0200
Misc automap changes - see changelog
---
ChangeLog | 9 ++++++++-
etc/automaps/__automap.cfg | 8 ++++----
share/server/core/classes/CoreModAutoMap.php | 2 +-
share/server/core/classes/NagVisAutoMap.php | 3 ++-
share/server/core/classes/NagVisAutomapCfg.php | 6 ++++--
5 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 66a8a21..61d7121 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1.6b3
+Automap
+ * Improved coordinate parsing regex to match graphviz output of more versions
+ * Commented out __dummy__ host in sample automap config to prevent
+ confusions with the automaps host urls
+
+
1.6b2
Core
@@ -13,7 +20,7 @@ Core
* Bugfix: Added missing permissions for User/setOption
* Bugfix: Fixed javascript error "getSidebarWidth() not definied" when
header menu is disable by config
-* Automap
+Automap
* Added new context menu action "make root" to automap nodes to change the
root of the automap on-the-fly (Thanks to Oliver Graf)
* Bugfix: Fixed parent calculation in automap (Thanks to Oliver Graf)
diff --git a/etc/automaps/__automap.cfg b/etc/automaps/__automap.cfg
index ed070d2..dd1a8a6 100644
--- a/etc/automaps/__automap.cfg
+++ b/etc/automaps/__automap.cfg
@@ -20,10 +20,10 @@ label_border=transparent
#
# The settings of the first host will be used for all objects on the map.
#
-define host {
-host_name=__dummy__
-url=[htmlcgi]/status.cgi?host=[host_name]
-}
+#define host {
+#host_name=__dummy__
+#url=[htmlcgi]/status.cgi?host=[host_name]
+#}
################################################################################
# Custom object settings
diff --git a/share/server/core/classes/CoreModAutoMap.php
b/share/server/core/classes/CoreModAutoMap.php
index 85c83bb..ba132f7 100644
--- a/share/server/core/classes/CoreModAutoMap.php
+++ b/share/server/core/classes/CoreModAutoMap.php
@@ -281,4 +281,4 @@ class CoreModAutoMap extends CoreModule {
return $MAP->parseObjectsJson($aVals['ty']);
}
}
-?>
\ No newline at end of file
+?>
diff --git a/share/server/core/classes/NagVisAutoMap.php
b/share/server/core/classes/NagVisAutoMap.php
index efb9c79..aceb613 100644
--- a/share/server/core/classes/NagVisAutoMap.php
+++ b/share/server/core/classes/NagVisAutoMap.php
@@ -477,6 +477,7 @@ 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"/>
*
* Coord description:
* For a rectangle, you map the top left and bottom right corners. All
@@ -492,7 +493,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="([^"]+)"\/>$/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]));
diff --git a/share/server/core/classes/NagVisAutomapCfg.php
b/share/server/core/classes/NagVisAutomapCfg.php
index 94326bb..ef5f847 100644
--- a/share/server/core/classes/NagVisAutomapCfg.php
+++ b/share/server/core/classes/NagVisAutomapCfg.php
@@ -78,10 +78,12 @@ class NagVisAutomapCfg extends GlobalMapCfg {
$this->defaultConf = Array();
$keys = array_keys($this->getMapObjects());
+ // Use either the __dummy__ host or the global section for
gathering
+ // the default configuration
if(isset($keys[1]))
$objectId = $keys[1];
else
- return $this->defaultConf;
+ $objectId = 0;
/*
* Get object default configuration from configuration file
@@ -172,4 +174,4 @@ class NagVisAutomapCfg extends GlobalMapCfg {
return file_put_contents($this->objIdFile, json_encode($a)) !== false;
}
}
-?>
\ No newline at end of file
+?>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins