Merge branch 'develop' into ent-11537-bug-en-cuadros-de-busqueda-con-los-caracteres-2-y-0

This commit is contained in:
miguel angel rasteu 2023-09-06 09:54:45 +02:00
commit fd94a4ff69
36 changed files with 1577 additions and 79 deletions

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773.3
# Version 7.0NG.773.3
# 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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-230905
Version: 7.0NG.773.3-230906
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.773.3-230905"
pandora_version="7.0NG.773.3-230906"
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

@ -1031,7 +1031,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.773.3';
use constant AGENT_BUILD => '230905';
use constant AGENT_BUILD => '230906';
# 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.773.3
%define release 230905
%define release 230906
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.773.3
%define release 230905
%define release 230906
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.773.3
%define release 230905
%define release 230906
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773.3"
PI_BUILD="230905"
PI_BUILD="230906"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230905}
{230906}
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.773.3 Build 230905")
#define PANDORA_VERSION ("7.0NG.773.3 Build 230906")
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.773.3(Build 230905))"
VALUE "ProductVersion", "(7.0NG.773.3(Build 230906))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-230905
Version: 7.0NG.773.3-230906
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.773.3-230905"
pandora_version="7.0NG.773.3-230906"
package_pear=0
package_pandora=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -1486,27 +1486,53 @@ if (check_login()) {
metaconsole_connect($server);
}
if ($params['histogram'] === true) {
$params['id_agent_module'] = $params['agent_module_id'];
$params['dinamic_proc'] = 1;
if ($params['enable_projected_period'] === '1') {
$params_graphic = [
'period' => $params['period'],
'date' => strtotime(date('Y-m-d H:i:s')),
'only_image' => false,
'homeurl' => ui_get_full_url(false, false, false, false).'/',
'ttl' => false,
'height' => $config['graph_image_height'],
'landscape' => $content['landscape'],
'return_img_base_64' => true,
];
$params_combined = [
'projection' => $params['period_projected'],
];
$return['chart'] = graphic_combined_module(
[$params['agent_module_id']],
$params_graphic,
$params_combined
);
$output .= '<div class="stat_win_histogram">';
if ($params['compare'] === 'separated') {
$output .= $return['chart'];
$output .= '</div>';
} else {
if ($params['histogram'] === true) {
$params['id_agent_module'] = $params['agent_module_id'];
$params['dinamic_proc'] = 1;
$output .= '<div class="stat_win_histogram">';
if ($params['compare'] === 'separated') {
$graph = \reporting_module_histogram_graph(
['datetime' => ($params['begin_date'] - $params['period'])],
$params
);
$output .= $graph['chart'];
}
$graph = \reporting_module_histogram_graph(
['datetime' => ($params['begin_date'] - $params['period'])],
['datetime' => $params['begin_date']],
$params
);
$output .= $graph['chart'];
$output .= '</div>';
} else {
$output .= grafico_modulo_sparse($params);
}
$graph = \reporting_module_histogram_graph(
['datetime' => $params['begin_date']],
$params
);
$output .= $graph['chart'];
$output .= '</div>';
} else {
$output .= grafico_modulo_sparse($params);
}
if (is_metaconsole() === true && empty($server_id) === false) {

View File

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

View File

@ -143,6 +143,10 @@ function menu_print_menu(&$menu)
if (empty($new_msg) === false) {
$sec2 = 'operation/messages/message_edit&new_msg='.$new_msg;
}
} else if ($sec2 === 'enterprise/godmode/servers/credential_boxes_satellite'
|| $sec2 === 'enterprise/godmode/servers/manage_credential_boxes'
) {
$sec2 = 'enterprise/godmode/servers/list_satellite';
} else {
$sec2 = (string) get_parameter('sec2');
}

View File

@ -1613,3 +1613,12 @@ function type_change() {
break;
}
}
// Show/Hide period for projection on agent module graph.
function show_projection_period() {
if ($("#projection_switch").is(":checked")) {
$("#div_projection_period").show();
} else {
$("#div_projection_period").hide();
}
}

View File

@ -416,6 +416,10 @@ class Widget
$className .= '\WuxWidget';
break;
case 'inventory':
$className .= '\InventoryWidget';
break;
case 'os_quick_report':
$className .= '\OsQuickReportWidget';
break;

File diff suppressed because it is too large Load Diff

View File

@ -269,6 +269,14 @@ class SingleGraphWidget extends Widget
$values['showLegend'] = $decoder['showLegend'];
}
if (isset($decoder['projection_switch']) === true) {
$values['projection_switch'] = $decoder['projection_switch'];
}
if (isset($decoder['period_projection']) === true) {
$values['period_projection'] = $decoder['period_projection'];
}
return $values;
}
@ -357,6 +365,33 @@ class SingleGraphWidget extends Widget
],
];
// Projection.
$inputs[] = [
'label' => __('Projection Graph'),
'arguments' => [
'name' => 'projection_switch',
'id' => 'projection_switch',
'type' => 'switch',
'value' => $values['projection_switch'],
'onclick' => 'show_projection_period()',
],
];
// Period Projection.
$display_projection = ($values['projection_switch'] === true) ? '' : 'display:none';
$inputs[] = [
'label' => __('Period Projection'),
'id' => 'div_projection_period',
'style' => $display_projection,
'arguments' => [
'name' => 'period_projection',
'type' => 'interval',
'value' => $values['period_projection'],
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];
return $inputs;
}
@ -376,6 +411,8 @@ class SingleGraphWidget extends Widget
$values['moduleId'] = \get_parameter('moduleId', 0);
$values['period'] = \get_parameter('period', 0);
$values['showLegend'] = \get_parameter_switch('showLegend');
$values['projection_switch'] = (boolean) get_parameter_switch('projection_switch');
$values['period_projection'] = \get_parameter('period_projection', 0);
return $values;
}
@ -405,23 +442,46 @@ class SingleGraphWidget extends Widget
$trickHight = 40;
}
$params = [
'agent_module_id' => $this->values['moduleId'],
'width' => '100%',
'height' => ((int) $size['height'] - $trickHight),
'period' => $this->values['period'],
'title' => $module_name,
'unit' => $units_name,
'homeurl' => $config['homeurl'],
'backgroundColor' => 'transparent',
'show_legend' => $this->values['showLegend'],
'show_title' => $module_name,
'menu' => false,
'dashboard' => true,
];
$output = '<div class="container-center widget-mrgn-0px">';
$output .= \grafico_modulo_sparse($params);
if ($this->values['projection_switch'] === true) {
$params_graphic = [
'period' => $this->values['period'],
'date' => strtotime(date('Y-m-d H:i:s')),
'only_image' => false,
'homeurl' => ui_get_full_url(false, false, false, false).'/',
'height' => ((int) $size['height'] - $trickHight),
'landscape' => $content['landscape'],
'return_img_base_64' => true,
];
$params_combined = [
'projection' => $this->values['period_projection'],
];
$return['chart'] = graphic_combined_module(
[$this->values['moduleId']],
$params_graphic,
$params_combined
);
$output .= $return['chart'];
} else {
$params = [
'agent_module_id' => $this->values['moduleId'],
'width' => '100%',
'height' => ((int) $size['height'] - $trickHight),
'period' => $this->values['period'],
'title' => $module_name,
'unit' => $units_name,
'homeurl' => $config['homeurl'],
'backgroundColor' => 'transparent',
'show_legend' => $this->values['showLegend'],
'show_title' => $module_name,
'menu' => false,
'dashboard' => true,
];
$output .= \grafico_modulo_sparse($params);
}
$output .= '</div>';
return $output;
}

View File

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

View File

@ -197,6 +197,8 @@ ui_print_message_dialog(
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
$histogram = (bool) get_parameter('histogram', 0);
$enable_projected_period = get_parameter('enable_projected_period', 0);
$period_projected = get_parameter('period_projected', 300);
// FORM TABLE.
$table = html_get_predefined_table('transparent', 2);
@ -406,12 +408,35 @@ ui_print_message_dialog(
true
);
$table->data[6][3] = html_print_checkbox_switch(
'fullscale',
'fullscalee',
1,
(bool) $fullscale,
true,
false
);
$table->data[7][0] = __('Projection graph');
$table->data[7][0] .= ui_print_help_tip(
__('Projection graph take as begin date the current time'),
true
);
$table->data[7][1] = html_print_checkbox_switch(
'enable_projected_period',
1,
(bool) $enable_projected_period,
true
);
$table->data[7][2] = __('Projection period');
$table->data[7][3] = '<div class="small-input-select2">'.html_print_extended_select_for_time(
'period_projected',
$period_projected,
'',
'',
0,
7,
true
).'</div>';
} else {
$table->data[0][0] = __('Begin date');
$table->data[0][1] = html_print_input_text(
@ -514,27 +539,29 @@ ui_print_message_dialog(
);
$params = [
'agent_module_id' => $id,
'period' => $period,
'show_events' => $draw_events,
'title' => $label,
'unit_name' => $unit,
'show_alerts' => $draw_alerts,
'date' => $date,
'unit' => $unit,
'baseline' => $baseline,
'homeurl' => $urlImage,
'adapt_key' => 'adapter_'.$graph_type,
'compare' => $time_compare,
'show_unknown' => $unknown_graph,
'percentil' => (($show_percentil) ? $config['percentil'] : null),
'type_graph' => $config['type_module_charts'],
'fullscale' => $fullscale,
'zoom' => $zoom,
'height' => 300,
'type_mode_graph' => $type_mode_graph,
'histogram' => $histogram,
'begin_date' => strtotime($start_date.' '.$start_time),
'agent_module_id' => $id,
'period' => $period,
'show_events' => $draw_events,
'title' => $label,
'unit_name' => $unit,
'show_alerts' => $draw_alerts,
'date' => $date,
'unit' => $unit,
'baseline' => $baseline,
'homeurl' => $urlImage,
'adapt_key' => 'adapter_'.$graph_type,
'compare' => $time_compare,
'show_unknown' => $unknown_graph,
'percentil' => (($show_percentil) ? $config['percentil'] : null),
'type_graph' => $config['type_module_charts'],
'fullscale' => $fullscale,
'zoom' => $zoom,
'height' => 300,
'type_mode_graph' => $type_mode_graph,
'histogram' => $histogram,
'begin_date' => strtotime($start_date.' '.$start_time),
'enable_projected_period' => $enable_projected_period,
'period_projected' => $period_projected,
];
// Graph.

View File

@ -69,6 +69,8 @@ if (is_ajax()) {
$id_group = (int) get_parameter('id_group');
$pendingdelete = (bool) get_parameter('pendingdelete');
$get_node_agent = (bool) get_parameter('get_node_agent', false);
$get_agent_inventory_modules = (bool) get_parameter('get_agent_inventory_modules', false);
$get_agent_inventory_dates = (bool) get_parameter('get_agent_inventory_dates', false);
$refresh_contact = get_parameter('refresh_contact', 0);
@ -1328,6 +1330,102 @@ if (is_ajax()) {
}
}
if ($get_agent_inventory_modules) {
$inventory_id_agent = get_parameter('id_agent');
$id_node = (int) get_parameter('id_node');
$sql = 'SELECT DISTINCT(`name`)
FROM tmodule_inventory, tagent_module_inventory
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
if ($inventory_id_agent > 0) {
$sql .= ' AND id_agente = '.$inventory_id_agent;
}
$fields = [];
// Get results from all nodes if id_node equals to 0.
if ($id_node === 0 && is_metaconsole() === true) {
$result = [];
$nodes_connection = metaconsole_get_connections();
foreach ($nodes_connection as $key => $server) {
$id_node = $server['id'];
try {
if (is_metaconsole() === true) {
$node = new Node($id_node);
$node->connect();
}
$node_result = db_get_all_rows_sql($sql);
if ($node_result === false) {
continue;
}
$result = array_merge(
$result,
$node_result
);
if (is_metaconsole() === true) {
$node->disconnect();
}
} catch (Exception $e) {
if ($node !== null) {
$node->disconnect();
}
return;
}
}
} else {
try {
if (is_metaconsole() === true) {
$node = new Node($id_node);
$node->connect();
}
$result = db_get_all_rows_sql($sql);
if (is_metaconsole() === true) {
$node->disconnect();
}
} catch (Exception $e) {
if ($node !== null) {
$node->disconnect();
}
return;
}
}
if ($result === false) {
$result = [];
}
echo json_encode($result);
return;
}
if ($get_agent_inventory_dates) {
$inventory_module = get_parameter('module', 0);
$inventory_id_agent = (int) get_parameter('id_agent', 0);
$inventory_id_group = (int) get_parameter('id_group', 0);
$dates = inventory_get_dates(
$inventory_module,
$inventory_id_agent,
$inventory_id_group
);
echo json_encode($dates);
return;
}
return;
}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.773.3
%define release 230905
%define release 230906
# 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.773.3
%define release 230905
%define release 230906
# 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.773.3
%define release 230905
%define release 230906
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.773.3-230905
Version: 7.0NG.773.3-230906
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.773.3-230905"
pandora_version="7.0NG.773.3-230906"
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.773.3";
my $pandora_build = "230905";
my $pandora_build = "230906";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

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.773.3";
my $pandora_build = "230905";
my $pandora_build = "230906";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 230905
%define release 230906
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.773.3
%define release 230905
%define release 230906
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.773.3 Build 230905";
my $version = "7.0NG.773.3 Build 230906";
# 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.773.3 Build 230905";
my $version = "7.0NG.773.3 Build 230906";
# save program name for logging
my $progname = basename($0);