[pkg-nagios-changes] [Git][nagios-team/nagvis][upstream] New upstream version 1.9.35
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Tue May 9 13:52:07 BST 2023
Bas Couwenberg pushed to branch upstream at Debian Nagios Maintainer Group / nagvis
Commits:
c97e48e6 by Bas Couwenberg at 2023-05-09T14:28:50+02:00
New upstream version 1.9.35
- - - - -
11 changed files:
- ChangeLog
- docs/de_DE/about.html
- docs/en_US/about.html
- share/server/core/classes/CoreAuthModPDO.php
- share/server/core/classes/CoreLogonMultisite.php
- share/server/core/classes/CoreModMultisite.php
- share/server/core/classes/CorePDOHandler.php
- share/server/core/classes/GlobalBackendmklivestatus.php
- share/server/core/classes/GlobalMainCfg.php
- share/server/core/classes/objects/NagVisStatefulObject.php
- share/server/core/defines/global.php
Changes:
=====================================
ChangeLog
=====================================
@@ -1,3 +1,19 @@
+1.9.35
+Core
+ * FIX: Fix PHP 8.2 various incompatibilities
+ * FIX: Fix PHP 8.1 fsockopen incompatibility (#337 Thanks to loocars)
+ * FIX: Fix Checkmk Snapin displaying status output when hovering the state icon
+ * FIX: Disable state preview for worldmaps in Checkmk snapin. The state
+ previews do not work correctly for worldmaps. To be able to calculate the
+ state preview, we would need the area of the map the user would see when
+ opening the map. To be able to do so, we need this information when
+ rendering the snapin: a) the viewport size and b) the NagVis javascript
+ code. Both is not available in this situation, so we can not correctly
+ render it. In the past the computation was done based on information cached
+ in NagVis, which could produce aggregated states, but these might be
+ misleading as they did not necessarily represent the state of the objects
+ you see in the map.
+
1.9.34
Core:
* Checkmk BI backend: Add verify_peer, ca_path and verify_depth options to configure
=====================================
docs/de_DE/about.html
=====================================
@@ -35,7 +35,7 @@
<ul>
<li><a href="http://mathias-kettner.de/checkmk_livestatus.html">mklivestatus</a> (Default seit NagVis 1.5)</li>
<li><a href="http://www.nagios.org/download/addons">NDOUtils</a> / <a href="http://docs.icinga.org/latest/en/ch12">IDOUtils</a> (erfordert MySQL)</li>
- <li><a href="http://www.op5.org/community/projects/merlin">merlin</a> (erfordert MySQL)</li>
+ <li><a href="https://github.com/ITRS-Group/monitor-merlin">merlin</a> (erfordert MySQL)</li>
</ul>
Das Backend bekommt die Informationen vom Nagios-Prozess (mklivestatus) oder von einer Datenbank (NDOUtils/IDOUtils, merlin).
<p>Sie können alle Nagios-Objekte (Hosts, Services, Hostgroups, Servicegroups) zu so genannten Maps hinzufügen.
=====================================
docs/en_US/about.html
=====================================
@@ -27,7 +27,7 @@
<ul>
<li><a href="http://mathias-kettner.de/checkmk_livestatus.html">mklivestatus</a> (default since NagVis 1.5)</li>
<li><a href="http://www.nagios.org/download/addons">NDOUtils</a> / <a href="http://docs.icinga.org/latest/en/ch12">IDOUtils</a> (requires MySQL)</li>
- <li><a href="http://www.op5.org/community/projects/merlin">merlin</a> (requires MySQL)</li>
+ <li><a href="https://github.com/ITRS-Group/monitor-merlin">merlin</a> (requires MySQL)</li>
</ul>
The backend gets the information from the Nagios process (mklivestatus) or from a database (NDOUtils/IDOUtils, merlin).
<p>You can place all objects from Nagios (Host, Services, Hostgroups, Servicegroups) on so called maps. Each map can be configured through its own
=====================================
share/server/core/classes/CoreAuthModPDO.php
=====================================
@@ -24,6 +24,7 @@
class CoreAuthModPDO extends CoreAuthModule {
private $USERCFG;
+ private $DB;
private $iUserId = -1;
private $sUsername = '';
=====================================
share/server/core/classes/CoreLogonMultisite.php
=====================================
@@ -27,13 +27,14 @@ class CoreLogonMultisite extends CoreLogonModule {
private $htpasswdPath;
private $serialsPath;
private $secretPath;
+ private $cookieVersion;
private $authFile;
public function __construct() {
$this->htpasswdPath = cfg('global', 'logon_multisite_htpasswd');
$this->serialsPath = cfg('global', 'logon_multisite_serials');
$this->secretPath = cfg('global', 'logon_multisite_secret');
- $this->cookieVersion = cfg('global', 'logon_multisite_cookie_version');
+ $this->cookieVersion = intval(cfg('global', 'logon_multisite_cookie_version'));
// When the auth.serial file exists, use this instead of the htpasswd
// for validating the cookie. The structure of the file is equal, so
@@ -67,7 +68,7 @@ class CoreLogonMultisite extends CoreLogonModule {
}
private function loadSecret() {
- return trim(file_get_contents($this->secretPath));
+ return file_get_contents($this->secretPath);
}
private function generateHash($username, $session_id, $user_secret) {
=====================================
share/server/core/classes/CoreModMultisite.php
=====================================
@@ -93,6 +93,7 @@ class CoreModMultisite extends CoreModule {
"alias" => $map['alias'],
"url" => cfg('paths', 'htmlbase').'/index.php?mod=Map&act=view&show='.$map['name'],
"summary_state" => $map["summary_state"],
+ "summary_output" => $map["summary_output"],
"summary_in_downtime" => $map['summary_in_downtime'],
"summary_problem_has_been_acknowledged" => $map['summary_problem_has_been_acknowledged'],
"summary_stale" => $map['summary_stale'],
@@ -158,49 +159,77 @@ class CoreModMultisite extends CoreModule {
);
$MAP->MAPOBJ->setConfiguration($objConf);
+ $sources = $MAPCFG->getValue(0, 'sources') !== false ? $MAPCFG->getValue(0, 'sources') : array();
+ $is_worldmap = in_array('worldmap', $sources);
+
+ $state = null;
if($config_error !== null) {
- $MAP->MAPOBJ->clearMembers();
- $MAP->MAPOBJ->setState(array(
+ $state = array(
ERROR,
l('Map Configuration Error: ').$config_error,
null,
null,
null,
- ));
- $MAP->MAPOBJ->fetchIcon();
+ );
} elseif($error !== null) {
- $MAP->MAPOBJ->clearMembers();
- $MAP->MAPOBJ->setState(array(
+ $state = array(
ERROR,
l('Error: ').$error,
null,
null,
null,
- ));
- $MAP->MAPOBJ->fetchIcon();
- } elseif($MAP->MAPOBJ->checkMaintenance(0)) {
- $MAP->MAPOBJ->fetchIcon();
- } else {
- $MAP->MAPOBJ->clearMembers();
- $MAP->MAPOBJ->setState(array(
- UNKNOWN,
+ );
+ } elseif($is_worldmap) {
+ // To give the correct state aggregation for the area of the
+ // worldmap the user would see when opening the worldmap, we would
+ // need this:
+ //
+ // 1. Viewport resolution of the users browser
+ // 2. Code needed to compute the bbox (LeafletJS)
+ //
+ // The first could be provided by the Checkmk frontend code. But
+ // the later one is not available there. We also don't have code
+ // to compute it in the PHP code. So, instead of doing things that
+ // would surprise users, we just skip the state computation for
+ // worldmaps here.
+ //
+ // The NagVis internal overview page needs something similar, but
+ // there we have everything we need. See the function addMap() in
+ // share/frontend/nagvis-js/js/ViewOverview.js.
+ $state = array(
+ PENDING,
+ l('Worldmaps don\'t support state preview'),
+ null,
+ null,
+ null,
+ );
+ } elseif(!$MAP->MAPOBJ->checkMaintenance(0)) {
+ $state = array(
+ PENDING,
l('mapInMaintenance'),
null,
null,
null
- ));
- $MAP->MAPOBJ->fetchIcon();
+ );
+ } else {
+ $MAP->MAPOBJ->queueState(GET_STATE, GET_SINGLE_MEMBER_STATES);
}
- $MAP->MAPOBJ->queueState(GET_STATE, GET_SINGLE_MEMBER_STATES);
- $aObjs[] = $MAP->MAPOBJ;
+ $aObjs[] = array($MAP->MAPOBJ, $state);
}
$_BACKEND->execute();
$aMaps = Array();
- foreach($aObjs AS $MAP) {
- $MAP->applyState();
+ foreach($aObjs AS list($MAP, $state)) {
+ if ($state !== null) {
+ $MAP->clearMembers();
+ $MAP->setState($state);
+ $MAP->setSummary($state);
+ } else {
+ $MAP->applyState();
+ }
+
$MAP->fetchIcon();
$aMaps[] = $MAP->getObjectInformation();
=====================================
share/server/core/classes/CorePDOHandler.php
=====================================
@@ -44,6 +44,12 @@ class CorePDOHandler {
private $file = null;
private $dsn = null;
+ private $driver = null;
+ private $data = null;
+ private $updating = false;
+ private $lastErrorInfo = null;
+ private $inTrans = false;
+
// needs to be initialized after class declaration because directly
// initializing it here is a syntax error in PHP 5.3
private static $DRIVERS = null;
=====================================
share/server/core/classes/GlobalBackendmklivestatus.php
=====================================
@@ -193,7 +193,7 @@ class GlobalBackendmklivestatus implements GlobalBackendInterface {
// errors later with an own error message
// FIXME: Maybe use pfsockopen in the future to use persistent connections
if($this->socketType === 'unix') {
- $this->SOCKET = fsockopen('unix://'.$this->socketPath, NULL, $errno, $errstr, (float) cfg('backend_'.$this->backendId, 'timeout'));
+ $this->SOCKET = fsockopen('unix://'.$this->socketPath, -1, $errno, $errstr, (float) cfg('backend_'.$this->backendId, 'timeout'));
} elseif($this->socketType === 'tcp-tls') {
if (cfg('backend_'.$this->backendId, 'verify_tls_peer') == true) {
=====================================
share/server/core/classes/GlobalMainCfg.php
=====================================
@@ -40,6 +40,7 @@ function listAvailableLanguages() {
class GlobalMainCfg {
private $useCache = true;
private $CACHE;
+ private $PUCACHE;
protected $config = Array();
protected $preUserConfig = null;
=====================================
share/server/core/classes/objects/NagVisStatefulObject.php
=====================================
@@ -211,6 +211,15 @@ class NagVisStatefulObject extends NagVisObject {
return 'normal';
}
+ /**
+ * PUBLIC setSummary()
+ *
+ * Set the summary object
+ */
+ public function setSummary($s) {
+ $this->sum = $s;
+ }
+
/**
* PUBLIC setSummaryState()
*
=====================================
share/server/core/defines/global.php
=====================================
@@ -23,7 +23,7 @@
*****************************************************************************/
// NagVis Version
-define('CONST_VERSION', '1.9.34');
+define('CONST_VERSION', '1.9.35');
// Set PHP error handling to standard level
// Different levels for php versions below 5.1 because PHP 5.1 reports
View it on GitLab: https://salsa.debian.org/nagios-team/nagvis/-/commit/c97e48e6028480aa824115ab8126c3c51ffb145d
--
View it on GitLab: https://salsa.debian.org/nagios-team/nagvis/-/commit/c97e48e6028480aa824115ab8126c3c51ffb145d
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/20230509/0b127a47/attachment-0001.htm>
More information about the pkg-nagios-changes
mailing list