diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 373014b910..354bf7f3ad 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.747-200707 +Version: 7.0NG.747-200709 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 052a7087aa..fa60844ff5 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -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 diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index b8d5e84f3e..2b4997bdae 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -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; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index f6c6abff8c..5e99081b48 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -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} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index e211466e31..d433e1a044 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -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} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 47edf0ad22..e4b36860cc 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200707" +PI_BUILD="200709" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7ffa6255d9..f0a94269d3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200707} +{200709} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2fe2f97f6e..2a5c0c2a9b 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -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; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index aaa7968984..ad99d96840 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -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 diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5722e12060..47fcb444e0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.747-200707 +Version: 7.0NG.747-200709 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index ecf1d8567c..293812e3e6 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -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 diff --git a/pandora_console/general/first_task/HA_cluster_builder.php b/pandora_console/general/first_task/HA_cluster_builder.php index 7ae56a4287..8261ee5c08 100644 --- a/pandora_console/general/first_task/HA_cluster_builder.php +++ b/pandora_console/general/first_task/HA_cluster_builder.php @@ -53,8 +53,8 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus "; - echo "
"; + echo ""; + echo ""; ?> 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(); } } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 65724000f2..5e11cf7aba 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -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); } diff --git a/pandora_console/install.php b/pandora_console/install.php index fe844c035e..a934a29f26 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index de52b15f3b..2d65be7c85 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -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} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8c40980a8e..4d7659df46 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -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} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 28ccc20a95..509b440293 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200707" +PI_BUILD="200709" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2fc70454fe..34aa4f2895 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -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"); } diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 335f4b1804..0d16a98d24 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -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);