[pkg-nagios-changes] [Git][nagios-team/pkg-nagvis][upstream] New upstream version 1.9.26

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Mon Jul 5 15:33:12 BST 2021



Bas Couwenberg pushed to branch upstream at Debian Nagios Maintainer Group / pkg-nagvis


Commits:
1d211e01 by Bas Couwenberg at 2021-07-05T16:26:39+02:00
New upstream version 1.9.26
- - - - -


10 changed files:

- ChangeLog
- docs/en_US/worldmap.html
- omd_install.sh
- share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php
- share/server/core/classes/CoreAuthModPDO.php
- share/server/core/classes/CoreAuthorisationModPDO.php
- share/server/core/classes/CorePDOHandler.php
- share/server/core/defines/global.php
- share/server/core/sources/filter.php
- share/server/core/sources/worldmap.php


Changes:

=====================================
ChangeLog
=====================================
@@ -1,4 +1,13 @@
+1.9.26
+Core:
+  * FIX: Fix PHP 8 incompatibilites
+
+Worldmap:
+  * Add new option filter_group for filtering host objects on a worldmap based
+    on the membership of hosts in a host group.
+
 1.9.25
+Core:
   * FIX: Fix map corruption regression introduced with 1.9.24
   This issue was triggered by objects on a map having a numeric "object_id"
   attribute. The issue resulted in map configuration files without "define
@@ -6,11 +15,14 @@
   show an error like "Error: (0) in_array() expects parameter 2 to be array, bool given".
   You will have to find the problematic map config (.cfg) and readd the global
   section.
-  * FIX: Fix editing map options when object_id not set in global section object
   * FIX: Fix possible map corruption caused by object ID cleanup (#280)
   * FIX: Fix missing socket string in some livestatus backend error messages
 
+Frontend:
+  * FIX: Fix editing map options when object_id not set in global section object
+
 1.9.24
+Core:
   * FIX: Fix more PHP 7.4 incompatibilites (#265)
     (This fixes one issue related to the PDO auth module and one issue related
     to map configurations with numeric object_id attributes.)


=====================================
docs/en_US/worldmap.html
=====================================
@@ -50,24 +50,28 @@
     worldmap_center=50.86837814203458,10.21728515625
     worldmap_zoom=6
     worldmap_tiles_saturate=33
+
+    filter_group=my_group
 }</pre>
 
-        <p>Only the last three attributes are worldmap specific definitions, all of them are mandatory for
-        worldmaps.</p>
+        <p>The attributes after <code>icon_size=32</code> are worldmap specific definitions.</p>
 
-        <p>The <code>sources=worldmap</code> line tells the map to use the worldmap source, which cares about
+        <p>The <code>sources=worldmap</code> (mandatory) line tells the map to use the worldmap source, which cares about
         putting all the objects having geographical coordinates, for rendering the map.</p>
 
-        <p>The <code>worldmap_center=50.86837814203458,10.21728515625</code> specifies the latitude and longitude
+        <p>The <code>worldmap_center=50.86837814203458,10.21728515625</code> (mandatory) specifies the latitude and longitude
         coordinates to use as initial center for the worldmaps viewport.</p>
 
-        <p>The <code>worldmap_zoom=6</code> specifies the initial zoom level to be used when rendering the worldmap.
+        <p>The <code>worldmap_zoom=6</code> (mandatory) specifies the initial zoom level to be used when rendering the worldmap.
         NagVis allows zoom levels from 2 (world) to 20 (building, detail).</p>
 
 
-        <p>The <code>worldmap_tiles_saturate=33</code> dims the colors of default OpenStreetMap so that red motorways or
+        <p>The <code>worldmap_tiles_saturate=33</code> (optional) dims the colors of default OpenStreetMap so that red motorways or
         large green forests don't interfere with actual map objects. Possible values are 0 (no colors, grayscale) through 100 (full colors).</p>
 
+        <p>The <code>filter_group=my_group</code> (optional) is an attribute for filtering the host objects on a worldmap by their
+        memberships in the given host group. Only members of the group will be shown on the worldmap.</p>
+
         <h2>Create your own worldmap</h2>
 
         <p>You can start creating your own worldmap by using the way you use for other maps too. Select


=====================================
omd_install.sh
=====================================
@@ -194,9 +194,9 @@ patch -s $OMD_ROOT/local/share/nagvis/htdocs/server/core/defines/global.php <<EO
  
 +\$_path_parts = explode('/', dirname(\$_SERVER["SCRIPT_FILENAME"]));
 +if(\$_path_parts[count(\$_path_parts) - 6] == 'local') // handle OMD local/ hierarchy
-+    \$_base_dir = join(array_slice(explode('/' ,dirname(\$_SERVER["SCRIPT_FILENAME"])), 0, -6), '/');
++    \$_base_dir = join('/', array_slice(explode('/' ,dirname(\$_SERVER["SCRIPT_FILENAME"])), 0, -6));
 +else
-+    \$_base_dir = join(array_slice(explode('/' ,dirname(\$_SERVER["SCRIPT_FILENAME"])), 0, -5), '/');
++    \$_base_dir = join('/', array_slice(explode('/' ,dirname(\$_SERVER["SCRIPT_FILENAME"])), 0, -5));
 +
  /**
   * Set the search path for included files


=====================================
share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php
=====================================
@@ -3006,14 +3006,14 @@ class Dwoo_Compiler implements Dwoo_ICompiler
 		}
 
 		$out = array();
-		foreach ($ref->getParameters() as $param) {
-			if (($class = $param->getClass()) !== null && $class->name === 'Dwoo') {
+                foreach ($ref->getParameters() as $param) {
+			if ($param->getType() && !$param->getType()->isBuiltin() && $param->getType()->getName() === 'Dwoo') {
 				continue;
 			}
-			if (($class = $param->getClass()) !== null && $class->name === 'Dwoo_Compiler') {
+			if ($param->getType() && !$param->getType()->isBuiltin() && $param->getType()->getName() === 'Dwoo_Compiler') {
 				continue;
 			}
-			if ($param->getName() === 'rest' && $param->isArray() === true) {
+			if ($param->getName() === 'rest' && $param->getType() && $param->getType()->getName() === 'array') {
 				$out[] = array('*', $param->isOptional(), null);
 			}
 			$out[] = array($param->getName(), $param->isOptional(), $param->isOptional() ? $param->getDefaultValue() : null);


=====================================
share/server/core/classes/CoreAuthModPDO.php
=====================================
@@ -55,7 +55,7 @@ class CoreAuthModPDO extends CoreAuthModule {
         $config = $this->getConfig();
         if(!$this->DB->open($config['driver'], $config['params'], $config['username'], $config['password'])) {
             throw new NagVisException(l('Unable to open auth database ([DB]): [MSG]',
-                Array('DB' => $this->DB->dsn,
+                Array('DB' => $this->DB->getDSN(),
                       'MSG' => json_encode($this->DB->error()))));
         } else {
             // Create initial db scheme if needed


=====================================
share/server/core/classes/CoreAuthorisationModPDO.php
=====================================
@@ -33,7 +33,7 @@ class CoreAuthorisationModPDO extends CoreAuthorisationModule {
         $config = $this->getConfig();
         if(!$this->DB->open($config['driver'], $config['params'], $config['username'], $config['password'])) {
             throw new NagVisException(l('Unable to open auth database ([DB]): [MSG]',
-                Array('DB' => $this->DB->dsn,
+                Array('DB' => $this->DB->getDSN(),
                       'MSG' => json_encode($this->DB->error()))));
         } else {
             // Create initial db scheme if needed


=====================================
share/server/core/classes/CorePDOHandler.php
=====================================
@@ -301,6 +301,10 @@ class CorePDOHandler {
         return true;
     }
 
+    public function getDSN() {
+        return $this->dsn;
+    }
+
     public function getRegularExpressionOperator() {
         return $this->data['re_op'];
     }


=====================================
share/server/core/defines/global.php
=====================================
@@ -23,7 +23,7 @@
  *****************************************************************************/
  
 // NagVis Version
-define('CONST_VERSION', '1.9.25');
+define('CONST_VERSION', '1.9.26');
 
 // Set PHP error handling to standard level
 // Different levels for php versions below 5.1 because PHP 5.1 reports


=====================================
share/server/core/sources/filter.php
=====================================
@@ -75,7 +75,7 @@ function process_filter($MAPCFG, $map_name, &$map_config, $params = null) {
     if($params === null)
         $params = $MAPCFG->getSourceParams();
 
-    //filter_hostgroup($map_config, $params);
+    filter_hostgroup($map_config, $params);
     return true; // allow caching
 }
 


=====================================
share/server/core/sources/worldmap.php
=====================================
@@ -15,6 +15,7 @@ $viewParams = array(
         'backend_id',
         'worldmap_center',
         'worldmap_zoom',
+        'filter_group',
     )
 );
 
@@ -168,7 +169,7 @@ function worldmap_init_db() {
     $DB = new CorePDOHandler();
     if (!$DB->open('sqlite', array('filename' => cfg('paths', 'cfg').'worldmap.db'), null, null))
         throw new NagVisException(l('Unable to open worldmap database ([DB]): [MSG]',
-            Array('DB' => $DB->dsn,
+            Array('DB' => $DB->getDSN(),
                   'MSG' => json_encode($DB->error()))));
 
     worldmap_init_schema();
@@ -442,6 +443,7 @@ function process_worldmap($MAPCFG, $map_name, &$map_config) {
 
             $map_config[$object_id] = $obj;
         }
+
         return true;
     }
     elseif ($clone_id !== null)



View it on GitLab: https://salsa.debian.org/nagios-team/pkg-nagvis/-/commit/1d211e01995739ad566f9a283f1d4b93c19801e6

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-nagvis/-/commit/1d211e01995739ad566f9a283f1d4b93c19801e6
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20210705/0156b132/attachment-0001.htm>


More information about the pkg-nagios-changes mailing list