Merge remote-tracking branch 'origin/develop' into ent-6000-operaciones-masivas-de-servicios

This commit is contained in:
fbsanchez 2020-07-09 16:51:50 +02:00
commit 009d5c7bc0
29 changed files with 175 additions and 109 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.747-200707 Version: 7.0NG.747-200709
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.747 %define version 7.0NG.747
%define release 200707 %define release 200709
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.747 %define version 7.0NG.747
%define release 200707 %define release 200709
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.747" PI_VERSION="7.0NG.747"
PI_BUILD="200707" PI_BUILD="200709"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{200707} {200709}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.747(Build 200707))" VALUE "ProductVersion", "(7.0NG.747(Build 200709))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.747-200707 Version: 7.0NG.747-200709
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -53,8 +53,8 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus
<?php <?php
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
echo "<div id='create_master_window'></div>"; echo "<div id='create_master_window' style='display:none;'></div>";
echo "<div id='msg'></div>"; echo "<div id='msg' style='display:none;'></div>";
?> ?>
<input style="margin-bottom:20px;" onclick="show_create_ha_cluster();" type="submit" class="button_task" value="<?php echo __('Add new node'); ?>" /> <input style="margin-bottom:20px;" onclick="show_create_ha_cluster();" type="submit" class="button_task" value="<?php echo __('Add new node'); ?>" />
<?php <?php

View File

@ -117,7 +117,7 @@ if ($save_alert || $modify_alert) {
$al_field7 = (string) get_parameter_post('field7_value'); $al_field7 = (string) get_parameter_post('field7_value');
$al_field8 = (string) get_parameter_post('field8_value'); $al_field8 = (string) get_parameter_post('field8_value');
$al_field9 = (string) get_parameter_post('field9_value'); $al_field9 = (string) get_parameter_post('field9_value');
$al_field10 = (string) get_parameter_post('al_field10'); $al_field10 = (string) get_parameter_post('field10_value');
$al_field11 = (string) get_parameter_post('field11_value'); $al_field11 = (string) get_parameter_post('field11_value');
$al_field12 = (string) get_parameter_post('field12_value'); $al_field12 = (string) get_parameter_post('field12_value');
$al_field13 = (string) get_parameter_post('field13_value'); $al_field13 = (string) get_parameter_post('field13_value');

View File

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

View File

@ -1275,9 +1275,22 @@ function graphic_combined_module(
} }
if ($count_modules > 0) { if ($count_modules > 0) {
$sources = true; foreach ($module_list as $key => $value) {
$sources[$key]['id_server'] = $value['server'];
$sources[$key]['id_agent_module'] = $value['module'];
$sources[$key]['weight'] = $weights[$key];
$sources[$key]['label'] = $params_combined['labels'];
}
} }
} else { } else {
if (is_metaconsole()) {
metaconsole_restore_db();
$server = metaconsole_get_connection_by_id($params['server_id']);
if (metaconsole_connect($server) != NOERR) {
return false;
}
}
$sources = db_get_all_rows_field_filter( $sources = db_get_all_rows_field_filter(
'tgraph_source', 'tgraph_source',
'id_graph', 'id_graph',
@ -1285,8 +1298,18 @@ function graphic_combined_module(
'field_order' 'field_order'
); );
if (is_metaconsole()) {
if (isset($sources) && is_array($sources)) {
foreach ($sources as $key => $value) {
$sources[$key]['id_server'] = $params['server_id'];
}
}
}
$series = db_get_all_rows_sql( $series = db_get_all_rows_sql(
'SELECT summatory_series,average_series, modules_series 'SELECT summatory_series,
average_series,
modules_series
FROM tgraph FROM tgraph
WHERE id_graph = '.$params_combined['id_graph'] WHERE id_graph = '.$params_combined['id_graph']
); );
@ -1295,45 +1318,76 @@ function graphic_combined_module(
$average = $series[0]['average_series']; $average = $series[0]['average_series'];
$modules_series = $series[0]['modules_series']; $modules_series = $series[0]['modules_series'];
if (is_metaconsole()) {
metaconsole_restore_db();
}
}
if (isset($sources) && is_array($sources)) {
$weights = []; $weights = [];
$labels = []; $labels = [];
$modules = []; $modules = [];
foreach ($sources as $source) {
if (isset($sources) && is_array($sources)) { if (is_metaconsole() === true) {
foreach ($sources as $source) { $server = metaconsole_get_connection_by_id($source['id_server']);
array_push($modules, $source['id_agent_module']); if (metaconsole_connect($server) != NOERR) {
array_push($weights, $source['weight']); continue;
if ($source['label'] != '' || $params_combined['labels']) {
$id_agent = agents_get_module_id(
$source['id_agent_module']
);
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
$agent_alias = agents_get_alias($id_agent);
$module_name = modules_get_agentmodule_name(
$source['id_agent_module']
);
$module_description = modules_get_agentmodule_descripcion(
$source['id_agent_module']
);
$items_label = [
'type' => 'custom_graph',
'id_agent' => $id_agent,
'id_agent_module' => $source['id_agent_module'],
'agent_description' => $agent_description,
'agent_group' => $agent_group,
'agent_address' => $agent_address,
'agent_alias' => $agent_alias,
'module_name' => $module_name,
'module_description' => $module_description,
];
$labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($items_label, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
} }
} }
$modulepush = [
'server' => (isset($source['id_server']) === true) ? $source['id_server'] : 0,
'module' => $source['id_agent_module'],
];
array_push($modules, $modulepush);
array_push($weights, $source['weight']);
if ($source['label'] != '' || $params_combined['labels']) {
$id_agent = agents_get_module_id(
$source['id_agent_module']
);
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
$agent_alias = agents_get_alias($id_agent);
$module_name = modules_get_agentmodule_name(
$source['id_agent_module']
);
$module_description = modules_get_agentmodule_descripcion(
$source['id_agent_module']
);
$items_label = [
'type' => 'custom_graph',
'id_agent' => $id_agent,
'id_agent_module' => $source['id_agent_module'],
'agent_description' => $agent_description,
'agent_group' => $agent_group,
'agent_address' => $agent_address,
'agent_alias' => $agent_alias,
'module_name' => $module_name,
'module_description' => $module_description,
];
if ($source['label'] != '') {
$lab = reporting_label_macro(
$items_label,
$source['label']
);
} else {
$lab = reporting_label_macro(
$items_label,
$params_combined['labels']
);
}
$labels[$source['id_agent_module']] = $lab;
}
if (is_metaconsole() === true) {
metaconsole_restore_db();
}
} }
} }
@ -1429,15 +1483,17 @@ function graphic_combined_module(
continue; continue;
} }
if (is_metaconsole() && $params_combined['type_report'] == 'automatic_graph') { if (is_metaconsole()) {
$server = metaconsole_get_connection_by_id($agent_module_id['server']); $server = metaconsole_get_connection_by_id(
$agent_module_id['server']
);
if (metaconsole_connect($server) != NOERR) { if (metaconsole_connect($server) != NOERR) {
continue; continue;
} }
$agent_module_id = $agent_module_id['module'];
} }
$agent_module_id = $agent_module_id['module'];
$module_data = db_get_row_sql( $module_data = db_get_row_sql(
'SELECT * FROM tagente_modulo 'SELECT * FROM tagente_modulo
WHERE id_agente_modulo = '.$agent_module_id WHERE id_agente_modulo = '.$agent_module_id
@ -1516,7 +1572,12 @@ function graphic_combined_module(
if ($config['fixed_graph'] == false) { if ($config['fixed_graph'] == false) {
$water_mark = [ $water_mark = [
'file' => $config['homedir'].'/images/logo_vertical_water.png', 'file' => $config['homedir'].'/images/logo_vertical_water.png',
'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false), 'url' => ui_get_full_url(
'images/logo_vertical_water.png',
false,
false,
false
),
]; ];
} }
@ -1525,9 +1586,7 @@ function graphic_combined_module(
$i++; $i++;
if (is_metaconsole() if (is_metaconsole()) {
&& $params_combined['type_report'] == 'automatic_graph'
) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
} }

View File

@ -7766,18 +7766,6 @@ function reporting_custom_graph(
include_once $config['homedir'].'/include/functions_graph.php'; include_once $config['homedir'].'/include/functions_graph.php';
if ($type_report == 'custom_graph') {
if (is_metaconsole()) {
$id_meta = metaconsole_get_id_server($content['server_name']);
$server = metaconsole_get_connection_by_id($id_meta);
if (metaconsole_connect($server) != NOERR) {
return false;
}
}
}
$graph = db_get_row('tgraph', 'id_graph', $content['id_gs']);
$return = []; $return = [];
$return['type'] = 'custom_graph'; $return['type'] = 'custom_graph';
@ -7791,10 +7779,47 @@ function reporting_custom_graph(
} }
} }
$id_meta = 0;
if ($type_report == 'custom_graph') { if ($type_report == 'custom_graph') {
$graphs = db_get_all_rows_field_filter('tgraph', 'id_graph', $content['id_gs']);
$id_graph = $content['id_gs']; $id_graph = $content['id_gs'];
if (is_metaconsole()) {
$id_meta = metaconsole_get_id_server($content['server_name']);
$server = metaconsole_get_connection_by_id($id_meta);
if (metaconsole_connect($server) != NOERR) {
return false;
}
}
$graphs = db_get_all_rows_field_filter(
'tgraph',
'id_graph',
$content['id_gs']
);
$module_source = db_get_all_rows_sql(
'SELECT id_agent_module
FROM tgraph_source
WHERE id_graph = '.$content['id_gs']
);
if (isset($module_source) && is_array($module_source)) {
$modules = [];
foreach ($module_source as $key => $value) {
$modules[$key]['module'] = $value['id_agent_module'];
$modules[$key]['server'] = $id_meta;
}
}
if (is_metaconsole()) {
metaconsole_restore_db();
}
} else if ($type_report == 'automatic_graph') { } else if ($type_report == 'automatic_graph') {
$graphs = db_get_all_rows_field_filter(
'tgraph',
'id_graph',
$content['id_gs']
);
$graphs[0]['stacked'] = ''; $graphs[0]['stacked'] = '';
$graphs[0]['summatory_series'] = ''; $graphs[0]['summatory_series'] = '';
$graphs[0]['average_series'] = ''; $graphs[0]['average_series'] = '';
@ -7805,8 +7830,8 @@ function reporting_custom_graph(
if (is_metaconsole()) { if (is_metaconsole()) {
$module_source = db_get_all_rows_sql( $module_source = db_get_all_rows_sql(
'SELECT id_agent_module, id_server 'SELECT id_agent_module, id_server
FROM tgraph_source FROM tgraph_source
WHERE id_graph = '.$content['id_gs'] WHERE id_graph = '.$content['id_gs']
); );
if (isset($module_source) && is_array($module_source)) { if (isset($module_source) && is_array($module_source)) {
@ -7823,21 +7848,6 @@ function reporting_custom_graph(
$content['name'] = __('Simple graph'); $content['name'] = __('Simple graph');
} }
if ($type_report != 'automatic_graph') {
$module_source = db_get_all_rows_sql(
'SELECT id_agent_module
FROM tgraph_source
WHERE id_graph = '.$content['id_gs']
);
if (isset($module_source) && is_array($module_source)) {
$modules = [];
foreach ($module_source as $key => $value) {
$modules[$key] = $value['id_agent_module'];
}
}
}
$agent_description = agents_get_description($id_agent); $agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent); $agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent); $agent_address = agents_get_address($id_agent);
@ -7853,7 +7863,7 @@ function reporting_custom_graph(
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['landscape'] = $content['landscape']; $return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak']; $return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $graph['name']; $return['subtitle'] = $graphs[0]['name'];
$return['agent_name'] = $agent_alias; $return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name; $return['module_name'] = $module_name;
$return['description'] = $content['description']; $return['description'] = $content['description'];
@ -7933,12 +7943,6 @@ function reporting_custom_graph(
break; break;
} }
if ($type_report == 'custom_graph') {
if (is_metaconsole()) {
metaconsole_restore_db();
}
}
return reporting_check_structure_content($return); return reporting_check_structure_content($return);
} }

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.747'; $version = '7.0NG.747';
$build = '200707'; $build = '200709';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.747 %define version 7.0NG.747
%define release 200707 %define release 200709
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.747 %define version 7.0NG.747
%define release 200707 %define release 200709
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.747-200707 Version: 7.0NG.747-200709
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.747 %define version 7.0NG.747
%define release 200707 %define release 200709
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.747 %define version 7.0NG.747
%define release 200707 %define release 200709
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.747 PS200707"; my $version = "7.0NG.747 PS200709";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;
@ -1054,6 +1054,9 @@ sub pandoradb_main ($$$) {
# Recalculating dynamic intervals. # Recalculating dynamic intervals.
enterprise_hook("update_min_max", [$dbh, $conf]); enterprise_hook("update_min_max", [$dbh, $conf]);
# Metaconsole database cleanup.
enterprise_hook("metaconsole_database_cleanup", [$dbh, $conf]);
log_message ('', "Ending at ". strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "\n"); log_message ('', "Ending at ". strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "\n");
} }

View File

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