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
Version: 7.0NG.747-200707
Version: 7.0NG.747-200709
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.747-200707"
pandora_version="7.0NG.747-200709"
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

@ -55,7 +55,7 @@ my $Sem = undef;
my $ThreadSem = undef;
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
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{200707}
{200709}
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.747(Build 200707)")
#define PANDORA_VERSION ("7.0NG.747(Build 200709)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
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"
END
END

View File

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

View File

@ -53,8 +53,8 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus
<?php
if (check_acl($config['id_user'], 0, 'PM')) {
echo "<div id='create_master_window'></div>";
echo "<div id='msg'></div>";
echo "<div id='create_master_window' style='display:none;'></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'); ?>" />
<?php

View File

@ -117,7 +117,7 @@ if ($save_alert || $modify_alert) {
$al_field7 = (string) get_parameter_post('field7_value');
$al_field8 = (string) get_parameter_post('field8_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_field12 = (string) get_parameter_post('field12_value');
$al_field13 = (string) get_parameter_post('field13_value');

View File

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

View File

@ -1275,9 +1275,22 @@ function graphic_combined_module(
}
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 {
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(
'tgraph_source',
'id_graph',
@ -1285,8 +1298,18 @@ function graphic_combined_module(
'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(
'SELECT summatory_series,average_series, modules_series
'SELECT summatory_series,
average_series,
modules_series
FROM tgraph
WHERE id_graph = '.$params_combined['id_graph']
);
@ -1295,45 +1318,76 @@ function graphic_combined_module(
$average = $series[0]['average_series'];
$modules_series = $series[0]['modules_series'];
if (is_metaconsole()) {
metaconsole_restore_db();
}
}
if (isset($sources) && is_array($sources)) {
$weights = [];
$labels = [];
$modules = [];
if (isset($sources) && is_array($sources)) {
foreach ($sources as $source) {
array_push($modules, $source['id_agent_module']);
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,
];
$labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($items_label, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
foreach ($sources as $source) {
if (is_metaconsole() === true) {
$server = metaconsole_get_connection_by_id($source['id_server']);
if (metaconsole_connect($server) != NOERR) {
continue;
}
}
$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;
}
if (is_metaconsole() && $params_combined['type_report'] == 'automatic_graph') {
$server = metaconsole_get_connection_by_id($agent_module_id['server']);
if (is_metaconsole()) {
$server = metaconsole_get_connection_by_id(
$agent_module_id['server']
);
if (metaconsole_connect($server) != NOERR) {
continue;
}
$agent_module_id = $agent_module_id['module'];
}
$agent_module_id = $agent_module_id['module'];
$module_data = db_get_row_sql(
'SELECT * FROM tagente_modulo
WHERE id_agente_modulo = '.$agent_module_id
@ -1516,7 +1572,12 @@ function graphic_combined_module(
if ($config['fixed_graph'] == false) {
$water_mark = [
'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++;
if (is_metaconsole()
&& $params_combined['type_report'] == 'automatic_graph'
) {
if (is_metaconsole()) {
metaconsole_restore_db();
}
}

View File

@ -7766,18 +7766,6 @@ function reporting_custom_graph(
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['type'] = 'custom_graph';
@ -7791,10 +7779,47 @@ function reporting_custom_graph(
}
}
$id_meta = 0;
if ($type_report == 'custom_graph') {
$graphs = db_get_all_rows_field_filter('tgraph', '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') {
$graphs = db_get_all_rows_field_filter(
'tgraph',
'id_graph',
$content['id_gs']
);
$graphs[0]['stacked'] = '';
$graphs[0]['summatory_series'] = '';
$graphs[0]['average_series'] = '';
@ -7805,8 +7830,8 @@ function reporting_custom_graph(
if (is_metaconsole()) {
$module_source = db_get_all_rows_sql(
'SELECT id_agent_module, id_server
FROM tgraph_source
WHERE id_graph = '.$content['id_gs']
FROM tgraph_source
WHERE id_graph = '.$content['id_gs']
);
if (isset($module_source) && is_array($module_source)) {
@ -7823,21 +7848,6 @@ function reporting_custom_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_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
@ -7853,7 +7863,7 @@ function reporting_custom_graph(
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $graph['name'];
$return['subtitle'] = $graphs[0]['name'];
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
$return['description'] = $content['description'];
@ -7933,12 +7943,6 @@ function reporting_custom_graph(
break;
}
if ($type_report == 'custom_graph') {
if (is_metaconsole()) {
metaconsole_restore_db();
}
}
return reporting_check_structure_content($return);
}

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.747
%define release 200707
%define release 200709
# 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.747
%define release 200707
%define release 200709
# 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.747
%define release 200707
%define release 200709
%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.747-200707
Version: 7.0NG.747-200709
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.747-200707"
pandora_version="7.0NG.747-200709"
package_cpan=0
package_pandora=1

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.747"
PI_BUILD="200707"
PI_BUILD="200709"
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.747 PS200707";
my $version = "7.0NG.747 PS200709";
# Pandora server configuration
my %conf;
@ -1054,6 +1054,9 @@ sub pandoradb_main ($$$) {
# Recalculating dynamic intervals.
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");
}

View File

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