Merge remote-tracking branch 'origin/develop' into ent-9640-agrupacion-de-graficas-en-periodos-de-tiempo

This commit is contained in:
daniel 2023-12-11 11:09:54 +01:00
commit a418673489
59 changed files with 1421 additions and 373 deletions

View File

@ -234,6 +234,21 @@ module_description Number of cron task files
module_unit files
module_end
# This module /var/log/syslog file, under the module name "syslog"
# And search for "ssh" string into it, sending only that information.
module_begin
module_name Syslog
module_description Search for ssh string into /var/log/syslog file
module_type log
module_regexp /var/log/syslog
module_pattern ssh
module_end
#Hardening plugin for security compliance analysis. Enable to use it.
#module_begin
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
#module_absoluteinterval 7d
#module_end
# Plugin example
@ -241,11 +256,6 @@ module_end
module_plugin pandora_df
# This parses /var/log/syslog file, under the module name "syslog"
# And search for "ssh" string into it, sending only that information.
module_plugin grep_log /var/log/syslog Syslog ssh
# Get disk space free in MB
#module_begin
#module_name disk_root_free
@ -270,7 +280,6 @@ module_plugin grep_log /var/log/syslog Syslog ssh
#module_end
# Plugin for inventory on the agent.
# module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users process ip route
# Example of preconditions
@ -303,4 +312,13 @@ module_plugin grep_log /var/log/syslog Syslog ssh
# This plugin runs several security checks in a Linux system
#module_plugin pandora_security_check
#module_plugin pandora_security_check
# Extraction module example
#module_begin
#module_name Collector
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log
#module_pattern .*
#module_end

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.774
# Version 7.0NG.774
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version
@ -147,22 +147,23 @@ module_max_critical 20
module_end
# Log events
# Get logs from System source.
module_begin
module_name System Events (TermService)
module_type async_string
module_logevent
module_description Log Events coming from Terminal Service
module_type log
module_logevent
module_source System
module_application TermService
module_end
# Get logs from Security source.
module_begin
module_name Security Events (Invalid Login)
module_type async_string
module_description Security log events for invalid login attempt
module_name Security Events
module_description Security log events
module_type log
module_logevent
module_source Security
module_eventcode 529
module_end
# Check if Dhcp service is enabled
@ -219,6 +220,12 @@ module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df.vbs"
# module_description Free space on drive D: (%)
# module_end
# Hardening plugin for security compliance analysis.
# module_begin
# module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_hardening.exe -t 150"
# module_absoluteinterval 7d
# module_end
# Sample of Windows inventory module (ONLY ENTERPRISE)!
#module_begin
#module_name Inventory
@ -344,4 +351,13 @@ module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df.vbs"
#module_condition (3,8) cmd.exe /c echo range >> c:\log.txt
#module_exec echo 5
#module_description Postcondition test module
#module_end
# Example of collector module
#module_begin
#module_name Collector
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log
#module_pattern .*
#module_end

View File

@ -157,12 +157,32 @@ module_exec last | head -1
module_description Last Login
module_end
# Plugin example
#Hardening plugin for security compliance analysis. Enable to use it.
#module_begin
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
#module_absoluteinterval 7d
#module_end
# This parses /var/log/syslog file, under the module name "syslog"
# This module parses /var/log/syslog file, under the module name "syslog"
# And search for "ssh" string into it, sending only that information.
module_begin
module_name Syslog
module_description Search for ssh string into /var/log/syslog file
module_type log
module_regexp /var/log/syslog
module_pattern ssh
module_end
module_plugin grep_log /var/log/syslog Syslog ssh
# Plugin example
# Plugin for inventory on the agent.
# module_plugin inventory 1 cpu ram video nic hd cdrom software
# Extraction module example
#module_begin
#module_name Collector
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log
#module_pattern .*
#module_end

View File

@ -372,13 +372,32 @@ module_end
#module_description XGrid
#module_end
#Hardening plugin for security compliance analysis. Enable to use it.
#module_begin
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
#module_absoluteinterval 7d
#module_end
# This module parses /var/log/syslog file, under the module name "syslog"
# And search for "ssh" string into it, sending only that information.
module_begin
module_name Syslog
module_description Log collection modules
module_type log
module_regexp /var/log/syslog
module_pattern ssh
module_end
# Plugin example
# This parses /var/log/syslog file, under the module name "syslog"
# And search for "ssh" string into it, sending only that information.
#module_plugin grep_log /var/log/syslog Syslog ssh
# Plugin for inventory on the agent.
# module_plugin inventory 1 cpu ram video nic hd cdrom software
# Extraction module example
#module_begin
#module_name Collector
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log
#module_pattern .*
#module_end

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.774-231205
Version: 7.0NG.774-231211
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.774-231205"
pandora_version="7.0NG.774-231211"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -271,11 +271,17 @@ module_plugin pandora_netusage
module_plugin autodiscover --default
# Plugin for inventory on the agent.
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
# module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
# Log collection modules. This will collect log files for forensic analysis and store everything
# This is for LOG monitoring. Different than log monitoring.
#module_plugin grep_log_module /var/log/messages Syslog \.\*
module_begin
module_name Syslog
module_description Log collection modules
module_type log
module_regexp /var/log/messages
module_pattern .*
module_end
# Another samples of monitoring modules
@ -317,9 +323,9 @@ module_plugin autodiscover --default
#module_absoluteinterval 7d
#module_end
# Logs extraction
# Extraction module example
#module_begin
#module_name Syslog
#module_name Collector
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log

View File

@ -1039,7 +1039,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.774';
use constant AGENT_BUILD => '231205';
use constant AGENT_BUILD => '231211';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.774
%define release 231205
%define release 231211
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.774
%define release 231205
%define release 231211
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.774
%define release 231205
%define release 231211
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.774
%define release 231205
%define release 231211
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.774
%define release 231205
%define release 231211
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.774"
PI_BUILD="231205"
PI_BUILD="231211"
OS_NAME=`uname -s`
FORCE=0

View File

@ -179,6 +179,22 @@ module_description Total number of TCP connections active
module_group Networking
module_end
# Get logs from System source.
module_begin
module_name Eventlog_System
module_type log
module_logevent
module_source System
module_end
# Get logs from Security source.
module_begin
module_name Eventlog_Security
module_type log
module_logevent
module_source Security
module_end
# Example plugin to retrieve drive usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent_used.vbs"
@ -273,22 +289,6 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
#module_type generic_data_string
#module_end
# Get logs from System source. Need enterprise version.
#module_begin
#module_name Eventlog_System
#module_type log
#module_logevent
#module_source System
#module_end
# Get logs from Security source. Need enterprise version.
#module_begin
#module_name Eventlog_Security
#module_type log
#module_logevent
#module_source Security
#module_end
# Get logs from Application source. Need enterprise version.
#module_begin
#module_name Eventlog_Application

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231205}
{231211}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.774 Build 231205")
#define PANDORA_VERSION ("7.0NG.774 Build 231211")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.774(Build 231205))"
VALUE "ProductVersion", "(7.0NG.774(Build 231211))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.774-231205
Version: 7.0NG.774-231211
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.774-231205"
pandora_version="7.0NG.774-231211"
package_pear=0
package_pandora=1

View File

@ -183,7 +183,9 @@ if (isset($config['force_instant_logout']) === true
$_SESSION = [];
session_destroy();
header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
if (isset($_COOKIE[session_name()]) === true) {
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
}
if ($config['auth'] === 'saml' && empty($public_hash) === true) {
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';

View File

@ -3,25 +3,31 @@ START TRANSACTION;
ALTER TABLE `tevento`
ADD COLUMN `event_custom_id` TEXT NULL AFTER `module_status`;
-- Telegram and vonage default alerts
UPDATE talert_actions
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
WHERE id=9;
UPDATE talert_actions
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
WHERE id=11;
SET @exist = (SELECT count(*) FROM information_schema.columns WHERE TABLE_NAME='tmetaconsole_agent' AND COLUMN_NAME='transactional_agent' AND table_schema = DATABASE());
SET @sqlstmt = IF (@exist>0, 'ALTER TABLE `tmetaconsole_agent` DROP COLUMN `transactional_agent`', 'SELECT ""');
prepare stmt from @sqlstmt;
execute stmt;
SET @exist = (SELECT count(*) FROM information_schema.columns WHERE TABLE_NAME='tagente' AND COLUMN_NAME='transactional_agent' AND table_schema = DATABASE());
SET @sqlstmt = IF (@exist>0, 'ALTER TABLE `tagente` DROP COLUMN `transactional_agent`', 'SELECT ""');
prepare stmt from @sqlstmt;
execute stmt;
ALTER TABLE `tdashboard`
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,
ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`;
-- Delete table tagent_access
DROP TABLE tagent_access;
DROP TABLE IF EXISTS tagent_access;
ALTER TABLE `tevent_rule` DROP COLUMN `user_comment`;
ALTER TABLE `tevent_rule` DROP COLUMN `operator_user_comment`;
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
ALTER TABLE `tevent_filter`
ADD COLUMN `regex` TEXT NULL AFTER `private_filter_user`;
ALTER TABLE `tevent_filter` ADD COLUMN `regex` TEXT NULL AFTER `private_filter_user`;
-- Update macros for plugin oracle
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle';
SET @id_app := (SELECT `id_app` FROM `tdiscovery_apps` WHERE `short_name` = 'pandorafms.oracle');
@ -35,11 +41,6 @@ UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
-- Update lts updates
UPDATE tconfig SET value='1' WHERE token='lts_updates';
ALTER TABLE `tdashboard`
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,
ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`;
SELECT @generic_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_data";
SELECT @generic_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_proc";
SELECT @async_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_data";
@ -47,4 +48,8 @@ SELECT @async_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_proc
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_data WHERE `tagente_modulo`.`id_tipo_modulo` = @async_data;
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_proc WHERE `tagente_modulo`.`id_tipo_modulo` = @async_proc;
-- Telegram and vonage default alerts
UPDATE talert_actions SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_' WHERE id=9;
UPDATE talert_actions SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_' WHERE id=11;
COMMIT;

View File

@ -243,10 +243,15 @@ switch ($action) {
$map_default_altitude = get_parameter('map_default_altitude');
$map_group_id = get_parameter('map_group_id');
$map_levels_zoom = get_parameter('map_levels_zoom', 16);
$map_connection_list_temp = explode(',', get_parameter('map_connection_list'));
$map_connection_list_temp_string = implode(',', $map_connection_list_temp);
if (strlen($map_connection_list_temp_string) > 0) {
$where_map_connection = ' WHERE id_tmap_connection IN('.$map_connection_list_temp_string.')';
} else {
$where_map_connection = '';
}
$listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection');
$listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection'.$where_map_connection);
foreach ($map_connection_list_temp as $index => $value) {
$cleanValue = trim($value);
@ -256,7 +261,6 @@ switch ($action) {
}
$map_connection_default = get_parameter('map_connection_default');
$map_connection_list = [];
foreach ($listConnectionTemp as $idMapConnection) {
$default = 0;
@ -345,7 +349,7 @@ function deleteConnectionMap(idConnectionMap) {
checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked');
$("#map_connection_" + idConnectionMap).remove();
if (checked) {
//Checked first, but not is index = 0 maybe.
@ -485,7 +489,7 @@ foreach ($listConnectionTemp as $connectionTemp) {
$table->data[1][0] = __('Add Map connection').$iconError;
$table->data[1][1] = "<table class='no-class' border='0' id='map_connection'>
<tr>
<td>".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)."
<td>".html_print_select($listConnection, 'select-map_connection_list', '', '', '', '0', true)."
</td>
<td >
<a href='javascript: addConnectionMap();'>".html_print_image(

View File

@ -111,7 +111,8 @@ if ($delete) {
$alerts_agent_modules = [];
foreach ($agent_alerts['simple'] as $agent_alert) {
if ((in_array($agent_alert['id_alert_template'], $id_alert_templates)) && (in_array($agent_alert['id_agent_module'], $modules_id))) {
$alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module($agent_alert['id_agent_module'], true, false, 'id'));
// $alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module($agent_alert['id_agent_module'], true, false, 'id'));
$alerts_agent_modules[] = $agent_alert['id'];
}
}
@ -126,7 +127,7 @@ if ($delete) {
$agent_module_actions = [];
foreach ($alerts_agent_modules as $alert_agent_module) {
$agent_module_actions = alerts_get_alert_agent_module_actions($alert_agent_module['id'], ['id', 'id_alert_action']);
$agent_module_actions = alerts_get_alert_agent_module_actions($alert_agent_module, ['id', 'id_alert_action']);
foreach ($agent_module_actions as $agent_module_action) {
foreach ($actions as $action) {

View File

@ -478,8 +478,8 @@ if ($access_console_node === true) {
}
}
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('Pandora RC');
$sub2['godmode/setup/setup&section=ehorus']['refr'] = 0;
$sub2['godmode/setup/setup&section=pandorarc']['text'] = __('Pandora RC');
$sub2['godmode/setup/setup&section=pandorarc']['refr'] = 0;
$sub2['godmode/setup/setup&section=ITSM']['text'] = __('ITSM');
$sub2['godmode/setup/setup&section=ITSM']['refr'] = 0;

View File

@ -184,7 +184,7 @@ $buttons['ITSM'] = [
$buttons['ehorus'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=ehorus').'">'.html_print_image(
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=pandorarc').'">'.html_print_image(
'images/RC.png',
true,
[
@ -297,7 +297,7 @@ switch ($section) {
$help_header = 'setup_flow_tab';
break;
case 'ehorus':
case 'pandorarc':
$buttons['ehorus']['active'] = true;
$subpage = __('Pandora RC');
$help_header = 'setup_ehorus_tab';
@ -442,7 +442,7 @@ switch ($section) {
include_once $config['homedir'].'/godmode/setup/setup_visuals.php';
break;
case 'ehorus':
case 'pandorarc':
include_once $config['homedir'].'/godmode/setup/setup_ehorus.php';
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC231205';
$build_version = 'PC231211';
$pandora_version = 'v7.0NG.774';
// Do not overwrite default timezone set if defined.

View File

@ -306,32 +306,48 @@ function format_for_graph(
}
function human_milliseconds_to_string($seconds)
function human_milliseconds_to_string($seconds, $size_text='large')
{
$ret = '';
// get the days
$days = intval(intval($seconds) / (360000 * 24));
if ($days > 0) {
$ret .= "$days days ";
if ($size_text === 'short') {
$ret .= str_replace(' ', '', "$days d").' ';
} else {
$ret .= "$days days ";
}
}
// get the hours
$hours = ((intval($seconds) / 360000) % 24);
if ($hours > 0) {
$ret .= "$hours hours ";
if ($size_text === 'short') {
$ret .= str_replace(' ', '', "$hours h").' ';
} else {
$ret .= "$hours hours ";
}
}
// get the minutes
$minutes = ((intval($seconds) / 6000) % 60);
if ($minutes > 0) {
$ret .= "$minutes minutes ";
if ($size_text === 'short') {
$ret .= str_replace(' ', '', "$minutes m").' ';
} else {
$ret .= "$minutes minutes ";
}
}
// get the seconds
$seconds = ((intval($seconds) / 100) % 60);
if ($seconds > 0) {
$ret .= "$seconds seconds";
if ($size_text === 'short') {
$ret .= str_replace(' ', '', "$seconds s").' ';
} else {
$ret .= "$seconds seconds ";
}
}
return $ret;

View File

@ -459,17 +459,17 @@ function cron_task_start_gotty(bool $restart_mode=true)
// Check prev process running and kill it (only if port changed in setup params).
if (empty($config['restart_gotty_next_cron_port']) === false) {
config_update_value('restart_gotty_next_cron_port', '');
$prevProcessRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
$prevProcessRunning = shell_exec("pgrep -af 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."' | grep -v 'pgrep'");
if (empty($prevProcessRunning) === false) {
shell_exec("pkill -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
}
config_update_value('restart_gotty_next_cron_port', '');
}
// Check if gotty is running on the configured port.
$processRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['gotty_port']."'");
$processRunning = shell_exec("pgrep -af 'pandora_gotty.*-p ".$config['gotty_port']."' | grep -v 'pgrep'");
$start_proc = true;

View File

@ -127,6 +127,58 @@ function events_translate_event_type($event_type)
}
/**
* Module status event_type into descriptive text.
*
* @param integer $event_type Event type.
*
* @return string Module status.
*/
function events_status_module_event_type($event_type)
{
$module_status = '';
switch ($event_type) {
case 'alert_fired':
case 'alert_recovered':
case 'alert_ceased':
case 'alert_manual_validation':
$module_status = AGENT_MODULE_STATUS_CRITICAL_ALERT;
break;
case 'going_down_normal':
case 'going_up_normal':
$module_status = AGENT_MODULE_STATUS_NORMAL;
break;
case 'going_unknown':
case 'unknown':
$module_status = AGENT_MODULE_STATUS_UNKNOWN;
break;
case 'going_up_warning':
case 'going_down_warning':
$module_status = AGENT_MODULE_STATUS_WARNING;
break;
case 'going_up_critical':
case 'going_down_critical':
$module_status = AGENT_MODULE_STATUS_CRITICAL_BAD;
break;
case 'recon_host_detected':
case 'system':
case 'error':
case 'new_agent':
case 'configuration_change':
default:
$module_status = AGENT_MODULE_STATUS_NOT_INIT;
break;
}
return $module_status;
}
/**
* Translates a numeric value event_status into descriptive text.
*

View File

@ -1585,7 +1585,7 @@ function gis_add_conection_maps_in_form($map_connection_list)
<tr class="row_0">
<td>'.html_print_input_text('map_connection_name_'.$mapConnection['id_conection'], $mapConnectionRowDB['conection_name'], '', 20, 40, true, true).'</td>
<td>'.$radioButton.'</td>
<td><a id="delete_row" href="javascript: deleteConnectionMap(\''.$mapConnection['id_conection'].'\')">'.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter']).'</a></td>
<td><a id="delete_row" href="javascript: deleteConnectionMap(\''.$mapConnection['id_conection'].'\')">'.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter main_menu_icon']).'</a></td>
</tr>
</tbody>
<script type="text/javascript">

View File

@ -4770,7 +4770,231 @@ function export_agents_module_csv($filters)
/**
* Check if modules are compatible with MADE server.
* Function to return Mean Time Between Failure, Mean Time To Solution (in seconds)
* and Availability of a module
*
* @param string $datetime_from Start time of the interval.
*
* @param string $datetime_to End time of the interval.
*
* @param string $id_agentmodule id_agentmodule of the module
*
* @return array Returns an array with the data
*/
function service_level_module_data($datetime_from, $datetime_to, $id_agentmodule)
{
$data = [];
$data['mtbf'] = false;
$data['mtrs'] = false;
$data['availability'] = false;
$data['critical_events'] = false;
$data['warning_events'] = false;
$data['last_status_change'] = false;
$data['module_name'] = false;
$availability = 0;
$type = '';
if ((bool) is_metaconsole() === true) {
if (enterprise_include_once('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
$server_id = [];
$server_id['id'] = explode('|', $id_agentmodule)[0];
$id_agentmodule = explode('|', $id_agentmodule)[1];
$server_name = db_get_row_filter('tmetaconsole_setup', $server_id, 'server_name');
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) !== NOERR) {
// Restore db connection.
metaconsole_restore_db();
return $data;
}
}
}
$uncompressed_data = db_uncompress_module_data(
$id_agentmodule,
$datetime_from,
$datetime_to
);
$first_utimestamp = 0;
foreach ($uncompressed_data as $data_module) {
foreach ($data_module['data'] as $subdata) {
if (!empty($subdata['datos'])) {
$first_utimestamp = $subdata['utimestamp'];
if (isset($subdata['type'])) {
$type = $subdata['type'];
}
break;
}
}
}
$interval_time = ($datetime_to - $datetime_from);
$current_time = time();
$sql = 'SELECT utimestamp, event_type FROM tevento
WHERE id_agentmodule = '.$id_agentmodule.'
AND utimestamp >= '.$datetime_from.'
AND utimestamp <= '.$datetime_to.'
ORDER BY utimestamp DESC';
$events_time = db_get_all_rows_sql($sql);
// Count events.
$sql = 'SELECT COUNT(*) as critical_events FROM tevento
WHERE id_agentmodule= '.$id_agentmodule.'
AND utimestamp >= '.$datetime_from.'
AND utimestamp <= '.$datetime_to.'
AND (event_type = "going_up_critical" OR event_type = "going_down_critical")';
$critical_events = db_get_sql($sql);
$sql = 'SELECT COUNT(*) as warning_events FROM tevento
WHERE id_agentmodule= '.$id_agentmodule.'
AND utimestamp >= '.$datetime_from.'
AND utimestamp <= '.$datetime_to.'
AND (event_type = "going_up_warning" OR event_type = "going_down_warning")';
$warning_events = db_get_sql($sql);
if ($events_time !== false && count($events_time) > 0) {
$failed_event = [];
$normal_event = [];
$events_time = array_reverse($events_time);
$mtrs_events = [];
foreach ($events_time as $key => $event) {
if ($event['event_type'] === 'going_up_critical' || $event['event_type'] === 'going_down_critical') {
$failed_event[] = $event['utimestamp'];
$mtrs_events[]['failed_event'] = $event['utimestamp'];
}
if ($event['event_type'] === 'going_up_normal'
|| $event['event_type'] === 'going_down_normal'
|| $event['event_type'] === 'going_up_warning'
|| $event['event_type'] === 'going_down_warning'
) {
$normal_event[] = $event['utimestamp'];
$mtrs_events[]['normal_event'] = $event['utimestamp'];
}
}
$process_mtrs_events = [];
if (empty($mtrs_events) === false) {
$last_event_key = '';
foreach ($mtrs_events as $key => $val) {
if (key($val) !== $last_event_key) {
$last_event_key = key($val);
$process_mtrs_events[] = $val;
}
}
}
$mtrs_array = [];
if (empty($normal_event) === true) {
$mtrs_array[] = ($current_time - $failed_event[0]);
} else if (empty($failed_event) === true) {
$mtrs_array[] = 0;
} else {
$last_value = '';
foreach ($process_mtrs_events as $key => $val) {
$current_value = $val[key($val)];
if ($last_value !== '') {
$mtrs_array[] = ($current_value - $last_value);
}
$last_value = $current_value;
}
$last_mtrs_event = key(end($process_mtrs_events));
if ($last_mtrs_event === 'failed_event') {
$mtrs_array[] = ($current_time - $last_value);
}
}
$mtbf_array = [];
if (!empty($failed_event) === true) {
if (count($failed_event) > 1) {
for ($i = 1; $i <= array_key_last($failed_event); $i++) {
$mtbf_array[] = ($failed_event[$i] - ($failed_event[($i - 1)]));
}
} else {
$mtbf_array[] = 0;
}
} else {
$mtbf_array[] = 0;
}
$total_time_failed = array_sum($mtrs_array);
$total_time_ok = ($interval_time - $total_time_failed);
if (count($events_time) === 1) {
if ((int) $first_utimestamp !== 0) {
$availability = round((($total_time_ok / $interval_time) * 100), 2);
}
} else {
$availability = round((($total_time_ok / $interval_time) * 100), 2);
}
if ($critical_events > 1) {
$mtbf = round(array_sum($mtbf_array) / count($mtbf_array));
} else {
$mtbf = false;
}
if (count($mtrs_array) === 1 && (int) $first_utimestamp !== 0) {
$mtrs = round($total_time_failed / count($mtrs_array));
} else if (count($mtrs_array) > 1 && (int) $first_utimestamp !== 0) {
$mtrs = round((array_sum($mtrs_array) / count($mtrs_array)));
} else {
$mtrs = false;
}
$data['mtbf'] = $mtbf;
$data['mtrs'] = $mtrs;
$data['availability'] = $availability;
} else {
$data['mtbf'] = false;
$data['mtrs'] = false;
$data['availability'] = false;
}
// Get last status change.
$sql = 'SELECT last_status_change FROM tagente_estado
WHERE id_agente_modulo = '.$id_agentmodule.' ';
$last_status_change = db_get_sql($sql);
// Get module name.
/*
$sql = 'SELECT nombre FROM tagente_modulo
WHERE id_agente_modulo = '.$id_agentmodule;*/
$sql = 'SELECT tagente_modulo.nombre as nombre, tagente.alias as alias
FROM tagente_modulo INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
WHERE id_agente_modulo = '.$id_agentmodule.' ';
$sql_query = db_get_all_rows_sql($sql);
$data['critical_events'] = $critical_events;
$data['warning_events'] = $warning_events;
$data['last_status_change'] = $last_status_change;
$data['module_name'] = $sql_query[0]['nombre'];
if ((bool) is_metaconsole() === true) {
$data['agent_alias'] = $server_name['server_name'].' » '.$sql_query[0]['alias'];
} else {
$data['agent_alias'] = $sql_query[0]['alias'];
}
if ((bool) is_metaconsole() === true) {
metaconsole_restore_db();
}
return $data;
}
/*
Check if modules are compatible with MADE server.
*
* @param integer $id_tipo_modulo
* @retur boolean True if compatible, false otherwise.

View File

@ -16039,171 +16039,174 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
return false;
}
$module_interval = modules_get_interval(
$content['id_agent_module']
);
$slice = ($content['period'] / $module_interval);
if ($metaconsole_on && $server_name != '') {
// Restore db connection.
metaconsole_restore_db();
}
$result_sla = reporting_advanced_sla(
$content['id_agent_module'],
($report['datetime'] - $content['period']),
$report['datetime'],
null,
null,
$filter = [
'id_agentmodule' => $content['id_agent_module'],
'group_rep' => EVENT_GROUP_REP_ALL,
'date_to' => date('Y-m-d', ($report['datetime'] - $content['period'])),
'time_to' => date('H:i:s', ($report['datetime'] - $content['period'])),
];
if ($metaconsole_on && $server_name != '') {
$filter['id_server'] = $connection['id'];
}
$previous_event = events_get_all(
['te.event_type, te.timestamp, te.utimestamp'],
$filter,
0,
null,
null,
null,
$slice,
1,
'desc',
'timestamp',
true
);
// Select Warning and critical values.
$agentmodule_info = modules_get_agentmodule($content['id_agent_module']);
$min_value_critical = ($agentmodule_info['min_critical'] == 0) ? null : $agentmodule_info['min_critical'];
$status = '';
if ($previous_event !== false) {
$previous_event = end($previous_event);
$status = $previous_event['event_type'];
}
// Check if module type is string.
$modules_is_string = modules_is_string($agentmodule_info['id_agente_modulo']);
$date_start = ($report['datetime'] - $content['period']);
$filter = [
'id_agentmodule' => $content['id_agent_module'],
'group_rep' => EVENT_GROUP_REP_ALL,
'date_from' => date('Y-m-d', $date_start),
'date_to' => date('Y-m-d', $report['datetime']),
'time_from' => date('H:i:s', $date_start),
'time_to' => date('H:i:s', $report['datetime']),
];
if ($modules_is_string === false) {
if ($agentmodule_info['max_critical'] == 0) {
$max_value_critical = null;
if ($agentmodule_info['min_critical'] == 0) {
if ((bool) $content['dinamic_proc'] === true) {
$max_value_critical = 0.01;
}
if ($metaconsole_on && $server_name != '') {
$filter['id_server'] = $connection['id'];
}
$events = events_get_all(
['te.event_type, te.timestamp, te.utimestamp'],
$filter,
null,
null,
null,
null,
true
);
// Metaconsole connection.
if ($metaconsole_on && $server_name != '') {
$connection = metaconsole_get_connection($server_name);
if (!metaconsole_load_external_db($connection)) {
ui_print_error_message('Error connecting to '.$server_name);
}
}
$not_init_data = [];
$previous_data = [
'event_type' => $status,
'utimestamp' => $date_start,
];
if (empty($status) === true) {
// Si viene de no iniciado busco el primer dato del modulo y si es de histórico.
$first_utimestamp = false;
$search_historydb = false;
$extract_first_data = modules_get_first_date($content['id_agent_module'], 0);
if (empty($extract_first_data) === false) {
$first_utimestamp = $extract_first_data['first_utimestamp'];
$search_historydb = (isset($extract_first_data['search_historydb']) === true) ? $extract_first_data['search_historydb'] : false;
}
// Si se encuentra algun dato.
// Si no hay eventos, la fecha del primer dato no sea mayor al fin del report (seria un bloque completo de no iniciado).
// Se comprueba que si existen eventos el dato no sea previo al evento.
if ($first_utimestamp !== false
&& ((empty($events) === true && $first_utimestamp < $report['datetime']) || (empty($events) === false && $first_utimestamp < $events[0]['utimestamp']))
) {
// Tenemos en cuenta si el modulo es de tipo string.
$module = modules_get_agentmodule($content['id_agent_module']);
$module_type = $module['id_tipo_modulo'];
$module_type_str = modules_get_type_name($module_type);
$table = 'tagente_datos';
if (strstr($module_type_str, 'string') !== false) {
$table = 'tagente_datos_string';
}
$query = sprintf(
'SELECT datos,utimestamp
FROM %s
WHERE id_agente_modulo = %d
AND utimestamp = %d
',
$table,
$content['id_agent_module'],
$first_utimestamp
);
$data = db_get_all_rows_sql($query, $search_historydb);
if ($data !== false) {
$not_init_data = [
'event_type' => $status,
'utimestamp' => $date_start,
];
$previous_data = [
'event_type' => 'going_up_normal',
'utimestamp' => $data[0]['utimestamp'],
];
}
} else {
$max_value_critical = $agentmodule_info['max_critical'];
}
} else {
if ($agentmodule_info['str_critical'] == '') {
$max_value_critical = null;
} else {
$max_value_critical = $agentmodule_info['str_critical'];
}
}
$inverse_critical = $agentmodule_info['critical_inverse'];
$min_value_warning = ($agentmodule_info['min_warning'] == 0) ? null : $agentmodule_info['min_warning'];
if ($modules_is_string === false) {
if ($agentmodule_info['max_warning'] == 0) {
$max_value_warning = null;
} else {
$max_value_warning = $agentmodule_info['max_warning'];
}
} else {
if ($agentmodule_info['str_warning'] == '') {
$max_value_warning = null;
} else {
$max_value_warning = $agentmodule_info['str_warning'];
}
$array_result = [];
$time_total = $content['period'];
$check_total = 0;
$check_ok = 0;
$time_ok = 0;
if (empty($events) === true) {
$events = [];
}
$inverse_warning = $agentmodule_info['warning_inverse'];
// Añadimos el dato previo.
array_unshift($events, $previous_data);
if (empty($not_init_data) === false) {
// Añadimos si viene de no iniciado el no iniciado.
array_unshift($events, $not_init_data);
}
$data = [];
$data['time_total'] = 0;
$data['time_ok'] = 0;
$data['time_error'] = 0;
$data['time_warning'] = 0;
$data['time_unknown'] = 0;
$data['time_not_init'] = 0;
$data['time_downtime'] = 0;
$data['checks_total'] = 0;
$data['checks_ok'] = 0;
$data['checks_error'] = 0;
$data['checks_warning'] = 0;
$data['checks_unknown'] = 0;
$data['checks_not_init'] = 0;
$array_graph = [];
$current_time = time();
$i = 0;
foreach ($result_sla as $value_sla) {
$data['time_total'] += $value_sla['time_total'];
$data['time_ok'] += $value_sla['time_ok'];
$data['time_error'] += $value_sla['time_error'];
$data['time_warning'] += $value_sla['time_warning'];
$data['time_unknown'] += $value_sla['time_unknown'];
$data['time_downtime'] += $value_sla['time_downtime'];
$data['time_not_init'] += $value_sla['time_not_init'];
$data['checks_total'] += $value_sla['checks_total'];
$data['checks_ok'] += $value_sla['checks_ok'];
$data['checks_error'] += $value_sla['checks_error'];
$data['checks_warning'] += $value_sla['checks_warning'];
$data['checks_unknown'] += $value_sla['checks_unknown'];
$data['checks_not_init'] += $value_sla['checks_not_init'];
// Generate raw data for graph.
if ($value_sla['time_total'] != 0) {
if ($value_sla['time_error'] > 0) {
// ERR.
$array_graph[$i]['data'] = 3;
} else if ($value_sla['time_unknown'] > 0) {
// UNKNOWN.
$array_graph[$i]['data'] = 4;
} else if ($value_sla['time_warning'] > 0) {
// Warning.
$array_graph[$i]['data'] = 2;
} else if ($value_sla['time_not_init'] == $value_sla['time_total']) {
// NOT INIT.
$array_graph[$i]['data'] = 6;
} else {
$array_graph[$i]['data'] = 1;
}
foreach ($events as $event) {
$array_result[$i]['data'] = events_status_module_event_type($event['event_type']);
if (isset($events[($i + 1)]) === true) {
$period = ($events[($i + 1)]['utimestamp'] - $event['utimestamp']);
$array_result[$i]['utimestamp'] = $period;
} else {
$array_graph[$i]['data'] = 7;
$period = ($report['datetime'] - $event['utimestamp']);
// El ultimo evento solo lo arrastramos hasta la fecha actual.
// Si pedimos mas fecha sera desconocido.
if ($report['datetime'] > $current_time) {
$period = ($current_time - $event['utimestamp']);
}
$array_result[$i]['utimestamp'] = $period;
}
$array_graph[$i]['utimestamp'] = ($value_sla['date_to'] - $value_sla['date_from']);
if ($array_result[$i]['data'] === AGENT_MODULE_STATUS_NORMAL) {
$check_ok++;
$time_ok += $period;
}
$check_total++;
$i++;
}
$data['sla_value'] = reporting_sla_get_compliance_from_array(
$data
);
$data['sla_fixed'] = sla_truncate(
$data['sla_value'],
$config['graph_precision']
);
$data_init = -1;
$acum = 0;
$sum = 0;
$array_result = [];
$i = 0;
foreach ($array_graph as $value) {
if ($data_init == -1) {
$data_init = $value['data'];
$acum = $value['utimestamp'];
} else {
if ($data_init == $value['data']) {
$acum = ($acum + $value['utimestamp']);
} else {
$array_result[$i]['data'] = $data_init;
$array_result[$i]['utimestamp'] = $acum;
$array_result[$i]['real_data'] = $sum;
$i++;
$data_init = $value['data'];
$acum = $value['utimestamp'];
}
}
// Bloque por si se pide mas fecha.
if ($report['datetime'] > $current_time) {
$array_result[$i]['data'] = AGENT_MODULE_STATUS_UNKNOWN;
$array_result[$i]['utimestamp'] = ($report['datetime'] - $current_time);
}
if (count($array_result) == 0) {
$array_result = $array_graph;
} else {
$array_result[$i]['data'] = $data_init;
$array_result[$i]['utimestamp'] = $acum;
$array_result[$i]['real_data'] = $sum;
}
$time_total = $data['time_total'];
// Slice graphs calculation.
$return['agent'] = modules_get_agentmodule_agent_alias(
$content['id_agent_module']
);
@ -16211,37 +16214,21 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
$content['id_agent_module']
);
$return['max_critical'] = $max_value_critical;
$return['min_critical'] = $min_value_critical;
$return['critical_inverse'] = $inverse_critical;
$return['max_warning'] = $max_value_warning;
$return['min_warning'] = $min_value_warning;
$return['warning_inverse'] = $inverse_warning;
$return['data_not_init'] = $data['checks_not_init'];
$return['data_unknown'] = $data['checks_unknown'];
$return['data_critical'] = $data['checks_error'];
$return['data_warning'] = $data['checks_warning'];
$return['data_ok'] = $data['checks_ok'];
$return['data_total'] = $data['checks_total'];
$return['time_not_init'] = $data['time_not_init'];
$return['time_unknown'] = $data['time_unknown'];
$return['time_critical'] = $data['time_error'];
$return['time_warning'] = $data['time_warning'];
$return['time_ok'] = $data['time_ok'];
if ($data['checks_total'] > 0) {
$return['percent_ok'] = (($data['checks_ok'] * 100) / $data['checks_total']);
$return['data_ok'] = $check_ok;
$return['data_total'] = $check_total;
if ($check_total > 0) {
$return['percent_ok'] = (($time_ok * 100) / $content['period']);
} else {
$return['percent_ok'] = 0;
}
$colors = [
1 => COL_NORMAL,
2 => COL_WARNING,
3 => COL_CRITICAL,
4 => COL_UNKNOWN,
5 => COL_DOWNTIME,
6 => COL_NOTINIT,
7 => COL_IGNORED,
AGENT_MODULE_STATUS_CRITICAL_ALERT => COL_ALERTFIRED,
AGENT_MODULE_STATUS_NORMAL => COL_NORMAL,
AGENT_MODULE_STATUS_UNKNOWN => COL_UNKNOWN,
AGENT_MODULE_STATUS_WARNING => COL_WARNING,
AGENT_MODULE_STATUS_CRITICAL_BAD => COL_CRITICAL,
AGENT_MODULE_STATUS_NOT_INIT => COL_NOTINIT,
];
$width_graph = 100;

View File

@ -4952,7 +4952,7 @@ function reporting_html_value(
$table2->head = [
__('Agent'),
__('Module'),
__('Minimun'),
__('Minimum'),
];
break;
@ -5023,7 +5023,7 @@ function reporting_html_value(
case 'min_value':
$table1->head = [
__('Lapse'),
__('Minimun'),
__('Minimum'),
];
break;

View File

@ -808,8 +808,8 @@ function loadVisualConsoleData(
getVisualConsoleItems: 1,
size: size,
visualConsoleId: vcId,
id_user: typeof id_user == undefined ? id_user : null,
auth_hash: typeof hash == undefined ? hash : null,
id_user: typeof id_user !== undefined ? id_user : null,
auth_hash: typeof hash !== undefined ? hash : null,
mode: mode,
widthScreen: widthScreen
},

View File

@ -466,6 +466,10 @@ class Widget
$className .= '\HeatmapWidget';
break;
case 'service_level':
$className .= '\ServiceLevelWidget';
break;
case 'security_hardening':
if (\enterprise_installed() === false) {
$not_installed = true;

View File

@ -0,0 +1,672 @@
<?php
/**
* Widget Service Level Pandora FMS Console
*
* @category Console Class
* @package Pandora FMS
* @subpackage Widget Service Level
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
namespace PandoraFMS\Dashboard;
use PandoraFMS\Agent;
use PandoraFMS\Module;
/**
* Service Level Widgets
*/
class ServiceLevelWidget extends Widget
{
/**
* Name widget.
*
* @var string
*/
protected $name;
/**
* Title widget.
*
* @var string
*/
protected $title;
/**
* Page widget;
*
* @var string
*/
protected $page;
/**
* Class name widget.
*
* @var [type]
*/
protected $className;
/**
* Values options for each widget.
*
* @var [type]
*/
protected $values;
/**
* Configuration required.
*
* @var boolean
*/
protected $configurationRequired;
/**
* Error load widget.
*
* @var boolean
*/
protected $loadError;
/**
* Width.
*
* @var integer
*/
protected $width;
/**
* Heigth.
*
* @var integer
*/
protected $height;
/**
* Grid Width.
*
* @var integer
*/
protected $gridWidth;
/**
* Construct.
*
* @param integer $cellId Cell ID.
* @param integer $dashboardId Dashboard ID.
* @param integer $widgetId Widget ID.
* @param integer|null $width New width.
* @param integer|null $height New height.
* @param integer|null $gridWidth Grid width.
*/
public function __construct(
int $cellId,
int $dashboardId=0,
int $widgetId=0,
?int $width=0,
?int $height=0,
?int $gridWidth=0
) {
global $config;
include_once $config['homedir'].'/include/functions_agents.php';
include_once $config['homedir'].'/include/functions_modules.php';
// WARNING: Do not edit. This chunk must be in the constructor.
parent::__construct(
$cellId,
$dashboardId,
$widgetId
);
// Width.
$this->width = $width;
// Height.
$this->height = $height;
// Grid Width.
$this->gridWidth = $gridWidth;
// Options.
$this->values = $this->decoders($this->getOptionsWidget());
// Positions.
$this->position = $this->getPositionWidget();
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('Service Level Detail');
// Name.
if (empty($this->name) === true) {
$this->name = 'service_level';
}
// This forces at least a first configuration.
$this->configurationRequired = false;
if (isset($this->values['mModules']) === false) {
$this->configurationRequired = true;
}
$this->overflow_scrollbars = false;
}
/**
* Decoders hack for retrocompability.
*
* @param array $decoder Values.
*
* @return array Returns the values with the correct key.
*/
public function decoders(array $decoder): array
{
$values = [];
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
if (isset($decoder['interval']) === true) {
$values['interval'] = $decoder['interval'];
} else {
$values['interval'] = '28800';
}
if (isset($decoder['show_agents']) === true) {
$values['show_agents'] = $decoder['show_agents'];
} else {
$values['show_agents'] = '0';
}
if (isset($decoder['mTypeShow']) === true) {
$values['mTypeShow'] = $decoder['mTypeShow'];
}
if (isset($decoder['mGroup']) === true) {
$values['mGroup'] = $decoder['mGroup'];
}
if (isset($decoder['mRecursion']) === true) {
$values['mRecursion'] = $decoder['mRecursion'];
}
if (isset($decoder['mModuleGroup']) === true) {
$values['mModuleGroup'] = $decoder['mModuleGroup'];
}
if (isset($decoder['mAgents']) === true) {
$values['mAgents'] = $decoder['mAgents'];
}
if (isset($decoder['mShowCommonModules']) === true) {
$values['mShowCommonModules'] = $decoder['mShowCommonModules'];
}
if (isset($decoder['mModules']) === true) {
$values['mModules'] = $decoder['mModules'];
}
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
$values = $this->values;
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
// Interval.
$fields = [
'604800' => __('1 week'),
'172800' => __('48 hours'),
'86400' => __('24 hours'),
'43200' => __('12 hours'),
'28800' => __('8 hours'),
];
$inputs[] = [
'label' => __('Interval'),
'arguments' => [
'type' => 'select',
'fields' => $fields,
'name' => 'interval-'.$this->cellId,
'selected' => $values['interval'],
'return' => true,
],
];
// Show agent.
$inputs[] = [
'label' => __('Show agents'),
'arguments' => [
'type' => 'switch',
'name' => 'show_agents-'.$this->cellId,
'value' => $values['show_agents'],
'return' => true,
],
];
$return_all_group = false;
if (users_can_manage_group_all('RM') || $this->values['mGroup'] == 0) {
$return_all_group = true;
}
$mgroup = '';
if (isset($this->values['mGroup']) === false) {
$sql = sprintf(
'SELECT id_group FROM tdashboard WHERE id = %d',
$this->dashboardId
);
$group_dahsboard = db_get_value_sql($sql);
if ($group_dahsboard > 0) {
$mgroup = $group_dahsboard;
}
}
if (is_metaconsole() === true) {
$this->values['mAgents'] = $this->getIdCacheAgent($this->values['mAgents']);
}
$inputs[] = [
'class' => 'flex flex-row',
'id' => 'select_multiple_modules_filtered',
'arguments' => [
'type' => 'select_multiple_modules_filtered',
'uniqId' => $this->cellId,
'mGroup' => (isset($this->values['mGroup']) === true) ? $this->values['mGroup'] : $mgroup,
'mRecursion' => (isset($this->values['mRecursion']) === true) ? $this->values['mRecursion'] : '',
'mModuleGroup' => (isset($this->values['mModuleGroup']) === true) ? $this->values['mModuleGroup'] : '',
'mAgents' => (isset($this->values['mAgents']) === true) ? $this->values['mAgents'] : '',
'mShowCommonModules' => (isset($this->values['mShowCommonModules']) === true) ? $this->values['mShowCommonModules'] : '',
'mModules' => (isset($this->values['mModules']) === true) ? $this->values['mModules'] : '',
'mShowSelectedOtherGroups' => true,
'mReturnAllGroup' => $return_all_group,
'mMetaFields' => ((bool) is_metaconsole()),
'commonModulesSwitch' => true,
],
];
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost():array
{
// Retrieve global - common inputs.
$values = parent::getPost();
$values['interval'] = \get_parameter('interval-'.$this->cellId, '28800');
$values['show_agents'] = \get_parameter('show_agents-'.$this->cellId, '0');
$values['mTypeShow'] = \get_parameter(
'filtered-type-show-'.$this->cellId
);
$values['mGroup'] = \get_parameter(
'filtered-module-group-'.$this->cellId
);
$values['mRecursion'] = \get_parameter_switch(
'filtered-module-recursion-'.$this->cellId
);
$values['mModuleGroup'] = \get_parameter(
'filtered-module-module-group-'.$this->cellId
);
$values['mAgents'] = \get_parameter(
'filtered-module-agents-'.$this->cellId
);
if (is_metaconsole() === true) {
$values['mAgents'] = $this->getRealIdAgentNode($values['mAgents']);
}
$values['mShowCommonModules'] = \get_parameter(
'filtered-module-show-common-modules-'.$this->cellId
);
$values['mModules'] = explode(
',',
\get_parameter(
'filtered-module-modules-'.$this->cellId
)
);
return $values;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
global $config;
$output = '';
if (check_acl($config['id_user'], 0, 'AR') === 0) {
$output .= '<div class="container-center">';
$output .= ui_print_error_message(
__('You don\'t have access'),
'',
true
);
$output .= '</div>';
return $output;
}
$interval_range = [];
$current_timestamp = time();
$interval_range['start'] = ($current_timestamp - $this->values['interval']);
$interval_range['end'] = $current_timestamp;
$reduceAllModules = array_reduce(
$this->values['mModules'],
function ($carry, $item) {
if ($item === null) {
return $carry;
}
if (is_metaconsole() === true) {
$item = explode('|', $item);
$serverId = $item[0];
$fullname = $item[1];
if ($this->values['mShowCommonModules'] !== 'on') {
$item = explode('&#x20;&raquo;&#x20;', $fullname);
$name = $item[1];
$carry['modules_selected'][$serverId][$name] = null;
$carry['modules'][$name] = null;
} else {
$carry['modules'][$fullname] = null;
}
} else {
$carry['modules'][$item] = null;
}
return $carry;
}
);
$allModules = $reduceAllModules['modules'];
$visualData = [];
// Extract info agents selected.
$target_agents = explode(',', $this->values['mAgents']);
foreach ($target_agents as $agent_id) {
try {
if (is_metaconsole() === true && str_contains($agent_id, '|') === true) {
$server_agent = explode('|', $agent_id);
} else {
$id_agente = $agent_id;
}
if ((bool) is_metaconsole() === true) {
if (isset($server_agent) === true) {
$id_agente = $server_agent[1];
$tserver = $server_agent[0];
} else {
$tmeta_agent = db_get_row_filter(
'tmetaconsole_agent',
[ 'id_agente' => $id_agente ]
);
$id_agente = $tmeta_agent['id_tagente'];
$tserver = $tmeta_agent['id_tmetaconsole_setup'];
}
if (metaconsole_connect(null, $tserver) !== NOERR) {
continue;
}
}
$agent = new Agent((int) $id_agente);
$visualData[$agent_id]['agent_status'] = $agent->lastStatus();
$visualData[$agent_id]['agent_name'] = $agent->name();
$visualData[$agent_id]['agent_alias'] = $agent->alias();
$visualData[$agent_id]['modules'] = [];
if (empty($allModules) === false) {
if (is_metaconsole() === true && $this->values['mShowCommonModules'] !== 'on') {
if (isset($reduceAllModules['modules_selected'][$tserver]) === true) {
$modules = $agent->searchModules(
['nombre' => array_keys($reduceAllModules['modules_selected'][$tserver])]
);
} else {
$modules = null;
}
} else {
$modules = $agent->searchModules(
['nombre' => array_keys($allModules)]
);
}
}
$visualData[$agent_id]['modules'] = $allModules;
if ((bool) is_metaconsole() === true) {
metaconsole_restore_db();
}
foreach ($modules as $module) {
if ($module === null) {
continue;
}
$data_module_array = $module->toArray();
$visualData[$agent_id]['modules'][$module->name()] = [];
$last_status = $module->getStatus()->toArray();
$visualData[$agent_id]['modules'][$module->name()]['last_status_change'] = $last_status['last_status_change'];
// Mean Time Between Failure.
// Mean Time To Solution.
// Availability.
if ((bool) is_metaconsole() === true) {
$module_id = $tserver.'|'.$data_module_array['id_agente_modulo'];
} else {
$module_id = $data_module_array['id_agente_modulo'];
}
$module_data = service_level_module_data($interval_range['start'], $interval_range['end'], $module_id);
$visualData[$agent_id]['modules'][$module->name()]['mtrs'] = ($module_data['mtrs'] !== false) ? human_milliseconds_to_string(($module_data['mtrs'] * 100), 'short') : '-';
$visualData[$agent_id]['modules'][$module->name()]['mtbf'] = ($module_data['mtbf'] !== false) ? human_milliseconds_to_string(($module_data['mtbf'] * 100), 'short') : '-';
$visualData[$agent_id]['modules'][$module->name()]['availability'] = ($module_data['availability'] !== false) ? $module_data['availability'] : '100';
$visualData[$agent_id]['modules'][$module->name()]['critical_events'] = ($module_data['critical_events'] !== false) ? $module_data['critical_events'] : '';
$visualData[$agent_id]['modules'][$module->name()]['warning_events'] = ($module_data['warning_events'] !== false) ? $module_data['warning_events'] : '';
$visualData[$agent_id]['modules'][$module->name()]['last_status_change'] = ($module_data['last_status_change'] !== false) ? $module_data['last_status_change'] : '';
$visualData[$agent_id]['modules'][$module->name()]['agent_alias'] = ($module_data['agent_alias'] !== false) ? $module_data['agent_alias'] : '';
$visualData[$agent_id]['modules'][$module->name()]['module_name'] = ($module_data['module_name'] !== false) ? $module_data['module_name'] : '';
}
} catch (\Exception $e) {
echo 'Error: ['.$agent_id.']'.$e->getMessage();
}
}
$table = new \stdClass();
$table->width = '100%';
$table->class = 'databox filters filter-table-adv';
$table->head = [];
$show_agents = $this->values['show_agents'];
if ($show_agents === 'on') {
$table->head[0] = __('Agent / Modules');
} else {
$table->head[0] = __('Modules');
}
$table->head[1] = __('% Av.');
$table->head[2] = __('MTBF');
$table->head[3] = __('MTRS');
$table->head[4] = __('Crit. Events').ui_print_help_tip(__('Counted only critical events generated automatic by the module'), true);
$table->head[5] = __('Warn. Events').ui_print_help_tip(__('Counted only warning events generated automatic by the module'), true);
$table->head[6] = __('Last change');
$table->data = [];
$table->cellstyle = [];
$row = 0;
foreach ($visualData as $agent_id => $data) {
foreach ($data['modules'] as $module_name => $module_data) {
if (isset($module_data) === true) {
if ($show_agents === 'on') {
$table->data[$row][0] = $module_data['agent_alias'].' / '.$module_data['module_name'];
$table->cellstyle[$row][0] = 'text-align:left';
} else {
$table->data[$row][0] = $module_data['module_name'];
$table->cellstyle[$row][0] = 'text-align:left';
}
$table->data[$row][1] = $module_data['availability'].'%';
$table->data[$row][2] = $module_data['mtbf'];
$table->data[$row][3] = $module_data['mtrs'];
$table->data[$row][4] = $module_data['critical_events'];
$table->data[$row][5] = $module_data['warning_events'];
$table->data[$row][6] = date(TIME_FORMAT, $module_data['last_status_change']);
}
$row++;
}
}
$height = (count($table->data) * 32);
$style = 'min-width:400px; min-height:'.$height.'px;';
$output = '<div class="container-top" style="'.$style.'">';
$output .= html_print_table($table, true);
$output .= '</div>';
return $output;
}
/**
* Get description.
*
* @return string.
*/
public static function getDescription()
{
return __('Service Level Detail');
}
/**
* Get Name.
*
* @return string.
*/
public static function getName()
{
return 'service_level';
}
/**
* Get size Modal Configuration.
*
* @return array
*/
public function getSizeModalConfiguration(): array
{
$size = [
'width' => 800,
'height' => 270,
];
return $size;
}
/**
* Return array with the real id agent and server.
*
* @param string $id_agents_cache String with the agents cache id.
*
* @return string $agents_servers with the real id agent and server.
*/
public function getRealIdAgentNode($id_agents_cache)
{
$agents_servers = [];
$target_agents = explode(',', $id_agents_cache);
foreach ($target_agents as $agent_id) {
$id_agente = $agent_id;
$tmeta_agent = db_get_row_filter(
'tmetaconsole_agent',
['id_agente' => $id_agente]
);
$id_agente = $tmeta_agent['id_tagente'];
$tserver = $tmeta_agent['id_tmetaconsole_setup'];
$agents_servers[] = $tserver.'|'.$id_agente;
}
return implode(',', $agents_servers);
}
/**
* Return string with the cache id agent in metaconsole.
*
* @param string $id_agents String with the agents and server id.
*
* @return string $cache_id_agents with the cache id agent.
*/
public function getIdCacheAgent($id_agents)
{
$target_agents = explode(',', $id_agents);
$cache_id_agents = [];
foreach ($target_agents as $agent_id) {
if (str_contains($agent_id, '|') === false) {
$cache_id_agents[] = $agent_id;
continue;
}
$server_agent = explode('|', $agent_id);
$tmeta_agent = db_get_row_filter(
'tmetaconsole_agent',
[
'id_tagente' => $server_agent[1],
'id_tmetaconsole_setup' => $server_agent[0],
]
);
$cache_id_agents[] = $tmeta_agent['id_agente'];
}
return implode(',', $cache_id_agents);
}
}

View File

@ -1196,7 +1196,7 @@ class Item extends CachedModel
'operation/visual_console/view',
['id' => $vcId],
// No autologin from the public view.
!$config['public_view'],
!$config['public_access'],
$mobile_navigation,
[
'page' => 'visualmap',
@ -1302,7 +1302,7 @@ class Item extends CachedModel
'enterprise/operation/services/services',
['id_service' => $serviceId],
// No autologin from the public view.
!$config['public_view']
!$config['public_access']
);
} else {
// A regular module.
@ -1312,7 +1312,7 @@ class Item extends CachedModel
'operation/agentes/status_monitor',
['id_module' => $moduleId],
// No autologin from the public view.
!((isset($config['public_view']) === true) ? $config['public_view'] : false),
!((isset($config['public_access']) === true) ? $config['public_access'] : false),
$mobile_navigation,
[
'id' => $moduleId,
@ -1377,7 +1377,7 @@ class Item extends CachedModel
'operation/agentes/ver_agente',
['id_agente' => $agentId],
// No autologin from the public view.
!$config['public_view'],
!$config['public_access'],
$mobile_navigation,
[
'id' => $agentId,

View File

@ -120,6 +120,23 @@ final class EventsHistory extends Item
$moduleId = static::parseIntOr($linkedModule['moduleId'], null);
$legendColor = static::extractLegendColor($data);
$metaconsoleId = $linkedModule['metaconsoleId'];
// Maybe connect to node.
$nodeConnected = false;
if (\is_metaconsole() === true && $metaconsoleId !== null) {
$nodeConnected = \metaconsole_connect(
null,
$metaconsoleId
) === NOERR;
if ($nodeConnected === false) {
throw new \InvalidArgumentException(
'error connecting to the node'
);
}
}
if ($agentId === null) {
throw new \InvalidArgumentException('missing agent Id');
}
@ -166,6 +183,11 @@ final class EventsHistory extends Item
$data['html'] = $html;
// Restore connection.
if ($nodeConnected === true) {
\metaconsole_restore_db();
}
return $data;
}

View File

@ -286,6 +286,11 @@ li#div-textarea label {
margin: 0 auto;
}
.content-widget .container-top {
height: 100%;
width: 99%;
}
.widget-groups-status {
display: flex;
flex-direction: row;

View File

@ -784,6 +784,11 @@ form ul.form_flex {
width: 100%;
}
.content-widget .container-top {
height: 100%;
width: 99%;
}
.container-layout {
border-radius: 5px;
border: 3px dashed #fff;

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.774';
$build = '231205';
$build = '231211';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -1205,57 +1205,6 @@ if (is_ajax() === true) {
return;
}
if ($get_agents_in_group) {
$id = (int) get_parameter('id', 0);
$group = (int) get_parameter('group', -1);
$return = [];
$return['correct'] = false;
if ($group != -1) {
$where_id_agente = ' 1=1 ';
$agents_in_networkmap = db_get_all_rows_filter(
'titem',
[
'id_map' => $id,
'deleted' => 0,
]
);
if ($agents_in_networkmap !== false) {
$ids = [];
foreach ($agents_in_networkmap as $agent) {
if ($agent['type'] == 0) {
$ids[] = $agent['source_data'];
}
}
$where_id_agente = ' id_agente NOT IN ('.implode(',', $ids).')';
}
$sql = 'SELECT id_agente, alias
FROM tagente
WHERE id_grupo = '.$group.' AND '.$where_id_agente.'
ORDER BY alias ASC';
$agents = db_get_all_rows_sql($sql);
if ($agents !== false) {
$return['agents'] = [];
foreach ($agents as $agent) {
$return['agents'][$agent['id_agente']] = $agent['alias'];
}
$return['correct'] = true;
}
}
echo json_encode($return);
return;
}
if ($get_agent_info) {
$id_agent = (int) get_parameter('id_agent');

View File

@ -33,7 +33,7 @@ require_once $config['homedir'].'/vendor/autoload.php';
ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true);
// ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
@ -47,7 +47,7 @@ global $vc_public_view;
global $config;
$vc_public_view = true;
$config['public_view'] = true;
$config['public_access'] = true;
// This starts the page head. In the call back function,
// things from $page['head'] array will be processed into the head.
@ -62,12 +62,6 @@ require_once 'include/functions_visual_map.php';
$hash = (string) get_parameter('hash');
// For public link issue.
$force_instant_logout = true;
if (isset($config['id_user']) === true) {
$force_instant_logout = false;
}
// Check input hash.
// DO NOT move it after of get parameter user id.
if (User::validatePublicHash($hash) !== true) {
@ -256,17 +250,17 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
if (menuLinks !== null) {
menuLinks.forEach(function (menuLink) {
menuLink.href = menuLink.href.replace(regex, replacement);
menuLink.href = menuLink.href.replace(
regex_hash,
replacement_hash
);
//menuLink.href = menuLink.href.replace(
// regex_hash,
// replacement_hash
//);
});
}
// Change the URL (if the browser has support).
if ("history" in window) {
var href = window.location.href.replace(regex, replacement);
href = href.replace(regex_hash, replacement_hash);
//href = href.replace(regex_hash, replacement_hash);
window.history.replaceState({}, document.title, href);
}
}
@ -321,20 +315,24 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
}
}
});
<?php if ($force_instant_logout === true) { ?>
// No click enabled when user not logged.
$( "a" ).on( "click", function( event ) {
event.preventDefault();
$('#visual-console-container').removeClass('is-updating');
$('.div-visual-console-spinner').remove();
});
<?php } ?>
</script>
<?php
if ($force_instant_logout === true) {
unset($userAccessMaintenance, $config['id_user'], $hash);
// Clean session to avoid direct access.
if ($config['force_instant_logout'] === true) {
// Force user logout.
$iduser = $_SESSION['id_usuario'];
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$_SESSION = [];
session_destroy();
header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
if (isset($_COOKIE[session_name()]) === true) {
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
}
}
while (ob_get_length() > 0) {
ob_end_flush();
}

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
%define release 231205
%define release 231211
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
%define release 231205
%define release 231211
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.774
%define release 231205
%define release 231211
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -290,16 +290,6 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- snmp_oid is also used for WMI query
-- -----------------------------------------------------
-- Table `tagent_access`
-- -----------------------------------------------------
-- CREATE TABLE IF NOT EXISTS `tagent_access` (
-- `id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
-- `utimestamp` BIGINT NOT NULL DEFAULT 0,
-- KEY `agent_index` (`id_agent`),
-- KEY `idx_utimestamp` USING BTREE (`utimestamp`)
-- ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- -----------------------------------------------------
-- Table `talert_snmp`
-- -----------------------------------------------------

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.774-231205
Version: 7.0NG.774-231211
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.774-231205"
pandora_version="7.0NG.774-231211"
package_cpan=0
package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.774";
my $pandora_build = "231205";
my $pandora_build = "231211";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -1836,6 +1836,34 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
. $base64_data . "\n";
}
# Image that comes from module macro substitution.
if ($field3 =~ /cid:moduledata_/) {
$content_type = 'multipart/related; boundary="'.$boundary.'"';
$boundary = "--" . $boundary;
$field3 = $boundary . "\n"
. "Content-Type: " . $html_content_type . "\n\n"
# "Content-Transfer-Encoding: quoted-printable\n\n"
. $field3 . "\n";
my @matches = ($field3 =~ /cid:moduledata_(\d+)/g);
foreach my $module_id (@matches) {
# Get base64 Image for the module.
my $module_data = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $module_id);
my $base64_data = substr($module_data, 23); # remove first 23 characters: 'data:image/png;base64, '
$cid = 'moduledata_'.$module_id;
my $filename = $cid . ".png";
$field3 .= $boundary . "\n"
. "Content-Type: image/png; name=\"" . $filename . "\"\n"
. "Content-Disposition: inline; filename=\"" . $filename . "\"\n"
. "Content-Transfer-Encoding: base64\n"
. "Content-ID: <" . $cid . ">\n"
. "Content-Location: " . $filename . "\n\n"
. $base64_data . "\n";
}
}
if ($pa_config->{"mail_in_separate"} != 0){
foreach my $address (split (',', $field1)) {
# Remove blanks
@ -5154,6 +5182,11 @@ sub on_demand_macro($$$$$$;$) {
elsif (defined($unit_mod) && $unit_mod ne '') {
$field_value .= $unit_mod;
}
if ($field_value =~ /^data:image\/png;base64, /) {
# macro _data_ substitution in case is image.
$field_value = '<img style="height: 150px;" src="cid:moduledata_' . $id_mod . '"/>';
}
return(defined($field_value)) ? $field_value : '';
} elsif ($macro eq '_secondarygroups_') {

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.774";
my $pandora_build = "231205";
my $pandora_build = "231211";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.774
%define release 231205
%define release 231211
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.774
%define release 231205
%define release 231211
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.774"
PI_BUILD="231205"
PI_BUILD="231211"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.774 Build 231205";
my $version = "7.0NG.774 Build 231211";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.774 Build 231205";
my $version = "7.0NG.774 Build 231211";
# save program name for logging
my $progname = basename($0);