From 0dc669178ba9800918536ef6df979372d3371cb2 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 20 May 2015 00:01:17 +0200 Subject: [PATCH 01/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ae7fd3d7fc..9c1c489abb 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150519 +Version: 6.0dev-150520 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 c587519336..cffe8103e4 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="6.0dev-150519" +pandora_version="6.0dev-150520" 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 375383d2fd..7dab65f646 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150519'; +use constant AGENT_BUILD => '150520'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 6b1c292da0..5d5541291b 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 6.0dev -%define release 150519 +%define release 150520 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 85a0ee8b2a..c5865a7089 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 6.0dev -%define release 150519 +%define release 150520 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b5ec9aeb24..46ea0b42ea 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150519} +{150520} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0b1fca500e..09df0b8990 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 ("6.0dev(Build 150519)") +#define PANDORA_VERSION ("6.0dev(Build 150520)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 60bd3db54a..c0c274ad6e 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", "(6.0dev(Build 150519))" + VALUE "ProductVersion", "(6.0dev(Build 150520))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ebc545fd69..fbb3362968 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150519 +Version: 6.0dev-150520 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 858a4a0b35..841760d40b 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="6.0dev-150519" +pandora_version="6.0dev-150520" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ca471b886b..530fcfc10d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150519'; +$build_version = 'PC150520'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index a8172b1c71..4e92cbf0fd 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Wed, 20 May 2015 16:38:49 +0900 Subject: [PATCH 02/40] Fixed error with open source version (without enterprise). --- pandora_server/util/pandora_db.pl | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8656cd871e..2fa10c6799 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -217,19 +217,22 @@ sub pandora_purgedb ($$) { } log_message ('', "\n"); - log_message ('PURGE', "Deleting validated events from tmetaconsole_event_history.", ''); - $events_to_delete = get_db_value ($dbh, "SELECT COUNT(*) FROM tmetaconsole_event_history WHERE estado = 1"); - while($events_to_delete > 0) { - db_do($dbh, "DELETE FROM tmetaconsole_event_history WHERE estado = 1 LIMIT ?", $BIG_OPERATION_STEP); - $events_to_delete = $events_to_delete - $BIG_OPERATION_STEP; + if (defined($conf->{'_enterprise_installed'}) && $conf->{'_enterprise_installed'} eq '1' && + defined($conf->{'_metaconsole'}) && $conf->{'_metaconsole'} eq '1'){ + log_message ('PURGE', "Deleting validated events from tmetaconsole_event_history.", ''); + $events_to_delete = get_db_value ($dbh, "SELECT COUNT(*) FROM tmetaconsole_event_history WHERE estado = 1"); + while($events_to_delete > 0) { + db_do($dbh, "DELETE FROM tmetaconsole_event_history WHERE estado = 1 LIMIT ?", $BIG_OPERATION_STEP); + $events_to_delete = $events_to_delete - $BIG_OPERATION_STEP; - # Mark the progress - log_message ('', "."); + # Mark the progress + log_message ('', "."); - # Do not overload the MySQL server - usleep (10000); + # Do not overload the MySQL server + usleep (10000); + } + log_message ('', "\n"); } - log_message ('', "\n"); } else { log_message ('PURGE', 'event_purge is set to 0. Old events will not be deleted.'); From 1d01bd68534ea8f46c070b0c6313713d0809261b Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 20 May 2015 11:50:30 +0200 Subject: [PATCH 03/40] Fixed problems with value pure in visual console in meta,tiquet: #2202 --- pandora_console/include/functions_visual_map.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 1012d529e3..845b257e25 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -338,7 +338,7 @@ function visual_map_print_item($mode = "read", $layoutData, $url = $config['homeurl'] . "index.php?sec=reporting&sec2=operation/visual_console/render_view&pure=" . $config["pure"] . "&id=" . $layoutData["id_layout_linked"]; } else { - $url = "index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=1&id_visualmap=" . $layoutData["id_layout_linked"] . "&refr=0"; + $url = "index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap=" . $layoutData["id_layout_linked"] . "&refr=0"; } } else { From a0dbe00f928e7bd2689741e6d61ae38c4a7f1465 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 20 May 2015 13:11:41 +0200 Subject: [PATCH 04/40] Some fixes in the new code of report (html) --- pandora_console/include/functions_reporting_html.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 7ac80a0a5a..fbdcdba15a 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1526,19 +1526,19 @@ function reporting_html_agent_configuration(&$table, $item) { } function reporting_html_TTRT_value(&$table, $item, $mini, $only_value = false, $check_empty = false) { - reporting_html_value($table, $item, $mini); + reporting_html_value($table, $item, $mini, $only_value, $check_empty); } function reporting_html_TTO_value(&$table, $item, $mini, $only_value = false, $check_empty = false) { - reporting_html_value($table, $item, $mini); + reporting_html_value($table, $item, $mini, $only_value, $check_empty); } function reporting_html_MTBF_value(&$table, $item, $mini, $only_value = false, $check_empty = false) { - reporting_html_value($table, $item, $mini); + reporting_html_value($table, $item, $mini, $only_value, $check_empty); } function reporting_html_MTTR_value(&$table, $item, $mini, $only_value = false, $check_empty = false) { - reporting_html_value($table, $item, $mini); + reporting_html_value($table, $item, $mini, $only_value, $check_empty); } function reporting_html_sum_value(&$table, $item, $mini) { From bb934257e6aa2e81b2a2732ec4942d7d75f94cde Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 21 May 2015 00:01:13 +0200 Subject: [PATCH 05/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9c1c489abb..b3ea47c730 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150520 +Version: 6.0dev-150521 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 cffe8103e4..795b71d81f 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="6.0dev-150520" +pandora_version="6.0dev-150521" 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 7dab65f646..7cb8eea609 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150520'; +use constant AGENT_BUILD => '150521'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 5d5541291b..765789a2fe 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 6.0dev -%define release 150520 +%define release 150521 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 c5865a7089..b40515cdad 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 6.0dev -%define release 150520 +%define release 150521 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 46ea0b42ea..14aedf8ff6 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150520} +{150521} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 09df0b8990..3309831094 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 ("6.0dev(Build 150520)") +#define PANDORA_VERSION ("6.0dev(Build 150521)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c0c274ad6e..d380c8de7e 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", "(6.0dev(Build 150520))" + VALUE "ProductVersion", "(6.0dev(Build 150521))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index fbb3362968..65c6b9d440 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150520 +Version: 6.0dev-150521 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 841760d40b..d702b82872 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="6.0dev-150520" +pandora_version="6.0dev-150521" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 530fcfc10d..8c78e274f6 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150520'; +$build_version = 'PC150521'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 4e92cbf0fd..67294e4e9b 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Thu, 21 May 2015 12:18:40 +0200 Subject: [PATCH 06/40] Fixed PHP Warnings and PHP notices (The PHP version 5.3.4 (the PHP version in new CentOS) and uppers are very noisy.) --- pandora_console/general/header.php | 1 + pandora_console/general/logon_ok.php | 2 ++ .../godmode/reporting/reporting_builder.list_items.php | 6 +++--- .../godmode/reporting/reporting_builder.main.php | 1 + pandora_console/godmode/reporting/reporting_builder.php | 2 ++ pandora_console/include/functions_reporting_html.php | 1 + pandora_console/include/functions_users.php | 3 ++- pandora_console/operation/agentes/tactical.php | 5 +++-- pandora_console/operation/reporting/reporting_viewer.php | 1 + 9 files changed, 16 insertions(+), 6 deletions(-) mode change 100644 => 100755 pandora_console/godmode/reporting/reporting_builder.list_items.php mode change 100644 => 100755 pandora_console/godmode/reporting/reporting_builder.main.php mode change 100644 => 100755 pandora_console/godmode/reporting/reporting_builder.php mode change 100644 => 100755 pandora_console/include/functions_reporting_html.php mode change 100644 => 100755 pandora_console/include/functions_users.php mode change 100644 => 100755 pandora_console/operation/agentes/tactical.php mode change 100644 => 100755 pandora_console/operation/reporting/reporting_viewer.php diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index b2421d5653..4041ed5535 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -47,6 +47,7 @@ config_check(); id = "header_table"; $table->class = "none"; $table->cellpadding = 0; diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index 40a1210cc1..24ff5ba867 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -49,6 +49,7 @@ if (tags_has_user_acl_tags()) { // Overview Table /////////////// + $table = new stdClass(); $table->class = "databox"; $table->cellpadding = 4; $table->cellspacing = 4; @@ -154,6 +155,7 @@ if (tags_has_user_acl_tags()) { // Show last activity from this user echo '
'; + $table = new stdClass(); $table->width = '100%'; //Don't specify px $table->data = array (); $table->size = array (); diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php old mode 100644 new mode 100755 index 11a1204f00..5c609877ac --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -149,7 +149,7 @@ if (!defined("METACONSOLE")) "id" => 'image_form_filter')) . ''; if (!defined("METACONSOLE")){ - $table = null; + $table = new stdClass(); $table->width = '100%'; $table->data[0][0] = __('Agents'); $table->data[0][1] = html_print_select($agents, 'agent_filter', $agentFilter, '', __('All'), 0, true); @@ -460,7 +460,7 @@ if (defined("METACONSOLE")){ echo "
"; echo ""; } -$table = null; +$table = new stdClass(); $table->width = '100%'; $table->colspan[0][0] = 3; $table->size = array(); @@ -491,7 +491,7 @@ echo "
colspan[0][0] = 3; $table->size = array(); diff --git a/pandora_console/godmode/reporting/reporting_builder.main.php b/pandora_console/godmode/reporting/reporting_builder.main.php old mode 100644 new mode 100755 index 18973f06c9..24c3f6530d --- a/pandora_console/godmode/reporting/reporting_builder.main.php +++ b/pandora_console/godmode/reporting/reporting_builder.main.php @@ -41,6 +41,7 @@ switch ($action) { break; } +$table = new stdClass(); $table->width = '98%'; $table->id = 'add_alert_table'; $table->class = 'databox'; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php old mode 100644 new mode 100755 index 288955ffb3..3a4594517e --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -369,6 +369,7 @@ switch ($action) { $search_name = "%$search%' OR description LIKE '%$search%"; } + $table_aux = new stdClass(); $table_aux->width = '100%'; $table_aux->class = 'databox filters'; $table_aux->cellpadding = 0; @@ -462,6 +463,7 @@ switch ($action) { 'id_group', 'non_interactive'), $return_all_group, 'RR', $group, $strict_user); + $table = new stdClass(); $table->width = '0px'; if (sizeof ($reports)) { $table->id = 'report_list'; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php old mode 100644 new mode 100755 index fbdcdba15a..c69f336645 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -101,6 +101,7 @@ function reporting_html_print_report($report, $mini = false) { foreach ($report['contents'] as $key => $item) { + $table = new stdClass(); $table->size = array (); $table->style = array (); $table->width = '98%'; diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php old mode 100644 new mode 100755 index c89725af90..59d3c587d4 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -125,7 +125,8 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro } else { // First group it's needed to retrieve its parent group - $first_group = reset(array_slice($user_groups, 0, 1)); + $first_group = array_slice($user_groups, 0, 1); + $first_group = reset($first_group); $parent_group = $first_group['parent']; $user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group); diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php old mode 100644 new mode 100755 index 34fdf5f853..895e6d3cb8 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -163,6 +163,7 @@ echo 'class = ""; $table->cellpadding = 2; @@ -195,8 +196,8 @@ $data_agents = array( ); $table->data[1][0] = reporting_get_stats_alerts($data); -$table->data[2][0] .= reporting_get_stats_modules_status($data, 180, 100, false, $data_agents); -$table->data[3][0] .= reporting_get_stats_agents_monitors($data); +$table->data[2][0] = reporting_get_stats_modules_status($data, 180, 100, false, $data_agents); +$table->data[3][0] = reporting_get_stats_agents_monitors($data); $table->rowclass[] = ''; diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php old mode 100644 new mode 100755 index 990a2f032a..d9a091fb34 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -141,6 +141,7 @@ else { //------------------------ INIT FORM ----------------------------------- +$table = new stdClass(); $table->id = 'controls_table'; $table->width = '99%'; $table->class = 'databox'; From 5eb372a7ff525bfa80a09c7d01bd3875731eb5b4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 21 May 2015 12:31:45 +0200 Subject: [PATCH 07/40] Moved the function 'reporting_get_stats_servers' to the correct file --- .../include/functions_reporting.php | 159 ++++++++++++++++++ .../include/functions_reporting_html.php | 159 +----------------- 2 files changed, 160 insertions(+), 158 deletions(-) mode change 100644 => 100755 pandora_console/include/functions_reporting.php diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php old mode 100644 new mode 100755 index 4bfb09ceef..5f7139a3c5 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7399,4 +7399,163 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi return $data_colors; } + +function reporting_get_stats_servers($tiny = true) { + global $config; + + $server_performance = servers_get_performance(); + + // Alerts table + $table_srv = html_get_predefined_table(); + + $table_srv->style[0] = $table_srv->style[2] = 'text-align: right; padding: 5px;'; + $table_srv->style[1] = $table_srv->style[3] = 'text-align: left; padding: 5px;'; + + $tdata = array(); + $tdata[0] = html_print_image('images/module.png', true, array('title' => __('Total running modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["total_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + + $tdata = array(); + $tdata[0] = '
'; + $table_srv->colspan[count($table_srv->data)][0] = 4; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + + $tdata = array(); + $tdata[0] = html_print_image('images/database.png', true, array('title' => __('Local modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_local_modules"]) . ''; + + $tdata[2] = '' . + format_numeric($server_performance ["local_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + + if ($tiny) { + $tdata = array(); + $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Remote modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_remote_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["remote_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + else { + if (isset($server_performance ["total_network_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_network_modules"]) . ''; + + $tdata[2] = '' . + format_numeric($server_performance["network_modules_rate"], 2) . + ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_plugin_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_plugin_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["plugin_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_prediction_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_prediction_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["prediction_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_wmi_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_wmi_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["wmi_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_web_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px')); + $tdata[1] = '' . + format_numeric($server_performance ["total_web_modules"]) . + ''; + + $tdata[2] = '' . + format_numeric($server_performance ["web_modules_rate"], 2) . + ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + $tdata = array(); + $tdata[0] = '
'; + $table_srv->colspan[count($table_srv->data)][0] = 4; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + + + switch ($config["dbtype"]) { + case "mysql": + $system_events = db_get_value_sql( + 'SELECT SQL_NO_CACHE COUNT(id_evento) + FROM tevento'); + break; + case "postgresql": + case "oracle": + $system_events = db_get_value_sql( + 'SELECT COUNT(id_evento) + FROM tevento'); + break; + } + + + + $tdata = array(); + $tdata[0] = html_print_image('images/lightning_go.png', true, + array('title' => __('Total events'), 'width' => '25px')); + $tdata[1] = '' . + format_numeric($system_events) . ''; + + $table_srv->colspan[count($table_srv->data)][1] = 3; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + $output = '
+ ' . + __('Server performance') . + '' . + html_print_table($table_srv, true) . '
'; + + return $output; +} ?> \ No newline at end of file diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index c69f336645..2ce89347f8 100755 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1838,164 +1838,7 @@ function reporting_html_sql(&$table, $item) { -function reporting_get_stats_servers($tiny = true) { - global $config; - - $server_performance = servers_get_performance(); - - // Alerts table - $table_srv = html_get_predefined_table(); - - $table_srv->style[0] = $table_srv->style[2] = 'text-align: right; padding: 5px;'; - $table_srv->style[1] = $table_srv->style[3] = 'text-align: left; padding: 5px;'; - - $tdata = array(); - $tdata[0] = html_print_image('images/module.png', true, array('title' => __('Total running modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["total_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - - $tdata = array(); - $tdata[0] = '
'; - $table_srv->colspan[count($table_srv->data)][0] = 4; - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - - $tdata = array(); - $tdata[0] = html_print_image('images/database.png', true, array('title' => __('Local modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_local_modules"]) . ''; - - $tdata[2] = '' . - format_numeric($server_performance ["local_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - - if ($tiny) { - $tdata = array(); - $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Remote modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_remote_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["remote_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - else { - if (isset($server_performance ["total_network_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_network_modules"]) . ''; - - $tdata[2] = '' . - format_numeric($server_performance["network_modules_rate"], 2) . - ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_plugin_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_plugin_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["plugin_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_prediction_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_prediction_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["prediction_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_wmi_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_wmi_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["wmi_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_web_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px')); - $tdata[1] = '' . - format_numeric($server_performance ["total_web_modules"]) . - ''; - - $tdata[2] = '' . - format_numeric($server_performance ["web_modules_rate"], 2) . - ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - $tdata = array(); - $tdata[0] = '
'; - $table_srv->colspan[count($table_srv->data)][0] = 4; - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - - - switch ($config["dbtype"]) { - case "mysql": - $system_events = db_get_value_sql( - 'SELECT SQL_NO_CACHE COUNT(id_evento) - FROM tevento'); - break; - case "postgresql": - case "oracle": - $system_events = db_get_value_sql( - 'SELECT COUNT(id_evento) - FROM tevento'); - break; - } - - - - $tdata = array(); - $tdata[0] = html_print_image('images/lightning_go.png', true, - array('title' => __('Total events'), 'width' => '25px')); - $tdata[1] = '' . - format_numeric($system_events) . ''; - - $table_srv->colspan[count($table_srv->data)][1] = 3; - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - $output = '
- ' . - __('Server performance') . - '' . - html_print_table($table_srv, true) . '
'; - - return $output; -} + function reporting_get_stats_summary($data, $graph_width, $graph_height) { From d57ba03f193e2063dc85770eb575221b0c3c5868 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 21 May 2015 13:01:44 +0200 Subject: [PATCH 08/40] Fixed problems with load events when selected all agents,tiquet: #2241 --- pandora_console/operation/events/events_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 76c6d30f59..6619425fb9 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -141,7 +141,7 @@ $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_use $tags = tags_get_user_tags($config['id_user'], 'ER'); -if ($id_agent == 0 && $text_agent != __('All')) { +if ($id_agent == 0 && $text_agent != '') { $id_agent = -1; } From 400cc3c5875ceca1e7986048b5298d7dcd86dff2 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 21 May 2015 15:23:37 +0200 Subject: [PATCH 09/40] If possible selected None own in owner event, tiquet: #2250 --- pandora_console/include/functions_events.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 4fa1f53a4f..9840110cb8 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -481,9 +481,10 @@ function events_change_owner ($id_event, $new_owner = false, $force = false, $me } // If no new_owner is provided, the current user will be the owner - if (empty($new_owner)) { - $new_owner = $config['id_user']; - } + // ** Comment this lines because if possible selected None owner in owner event. TIQUET: #2250*** + //if (empty($new_owner)) { + // $new_owner = $config['id_user']; + //} // Only generate comment when is forced (sometimes is changed the owner when comment) if ($force) { From 0ea32ce1dc8083529cd5ede8dc9311b42b746eeb Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 22 May 2015 00:01:13 +0200 Subject: [PATCH 10/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b3ea47c730..54ab32a9f1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150521 +Version: 6.0dev-150522 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 795b71d81f..0300b25ef3 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="6.0dev-150521" +pandora_version="6.0dev-150522" 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 7cb8eea609..d32d5858c2 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150521'; +use constant AGENT_BUILD => '150522'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 765789a2fe..53ebdcd224 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 6.0dev -%define release 150521 +%define release 150522 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 b40515cdad..c4be3f40ad 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 6.0dev -%define release 150521 +%define release 150522 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 14aedf8ff6..339b1f9281 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150521} +{150522} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3309831094..bf1fe945ed 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 ("6.0dev(Build 150521)") +#define PANDORA_VERSION ("6.0dev(Build 150522)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d380c8de7e..c472d188c1 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", "(6.0dev(Build 150521))" + VALUE "ProductVersion", "(6.0dev(Build 150522))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 65c6b9d440..20ebdc0791 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150521 +Version: 6.0dev-150522 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 d702b82872..52fc7e468e 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="6.0dev-150521" +pandora_version="6.0dev-150522" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8c78e274f6..d892c2aaf1 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150521'; +$build_version = 'PC150522'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 67294e4e9b..f468e2325d 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Fri, 22 May 2015 12:13:22 +0200 Subject: [PATCH 11/40] Fixed problems with not variable initialized, tiquet: #2238 --- .../godmode/reporting/graph_builder.graph_editor.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index d41a0c778c..b439b09c8a 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -46,7 +46,7 @@ if ($editGraph) { WHERE t2.id_agente_modulo = t1.id_agent_module)) AS agent_name FROM tgraph_source AS t1 - WHERE t1.id_graph = " . $id); + WHERE t1.id_graph = " . $id_graph); $module_array = array(); $weight_array = array(); $agent_array = array(); @@ -62,7 +62,7 @@ if ($editGraph) { $agent_array[] = $graphRow['agent_name']; } - $graphInTgraph = db_get_row_sql("SELECT * FROM tgraph WHERE id_graph = " . $id); + $graphInTgraph = db_get_row_sql("SELECT * FROM tgraph WHERE id_graph = " . $id_graph); $stacked = $graphInTgraph['stacked']; $period = $graphInTgraph['period']; $width = $graphInTgraph['width']; @@ -98,7 +98,7 @@ if(count($module_array) > 0){ echo ""; echo ""; - echo ""; + echo ""; html_print_input_text ('weight', $weight_array[$a], '', 20, 10, false, false); html_print_submit_button ('Ok', 'btn', false, '', false); echo ""; @@ -106,7 +106,7 @@ if(count($module_array) > 0){ echo "
"; echo ""; echo ""; - echo "".html_print_image('images/cross.png', true, array ('title' => __('Delete'))).""; + echo "".html_print_image('images/cross.png', true, array ('title' => __('Delete'))).""; echo ""; } @@ -116,7 +116,7 @@ if(count($module_array) > 0){ //Configuration form echo ''; -echo "
"; +echo ""; echo ""; echo ""; From 2fe85510a72cfb0f6d34df794561cbf5ec8ff16d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 12:31:33 +0200 Subject: [PATCH 12/40] Fixed PHP Warnings. --- pandora_console/include/functions_events.php | 3 ++- pandora_console/operation/agentes/group_view.php | 1 + pandora_console/operation/agentes/tactical.php | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 4fa1f53a4f..53dbe452fe 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -854,10 +854,11 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret $returned = ui_print_info_message ( __('No events'),'',true ); return $returned; } - else + else echo ui_print_info_message ( __('No events') ); } else { + $table = new stdClass(); $table->id = 'latest_events_table'; $table->cellpadding = 0; $table->cellspacing = 0; diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index 3a5b8bd20a..909bcff12f 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -82,6 +82,7 @@ $total_agentes = 0; $monitor_ok = 0; $monitor_warning = 0; $monitor_critical = 0; +$monitor_unknown = 0; $agents_unknown = 0; foreach ($result_groups as $data) { $total_agentes += $data["_total_agents_"]; diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index 895e6d3cb8..1e3786c721 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -228,7 +228,7 @@ $acltags = tags_get_user_module_and_tags ($config['id_user'], $access = 'ER', $u if (!empty($acltags)) { $tags_condition = tags_get_acl_tags_event_condition($acltags, false, $user_strict); - + if (!empty($tags_condition)) { $events = events_print_event_table ("estado<>1 AND ($tags_condition)", 10, "100%",true,false,true); ui_toggle($events, __('Latest events')); @@ -243,7 +243,7 @@ if ($is_admin) { require($config['homedir'] . '/godmode/servers/servers.build_table.php'); } -$out .= '
'; +$out = '
'; $out .= '
' . __('Event graph') . From 3d32d5645eb83845a2fc7046bb8890f37428a475 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 13:10:05 +0200 Subject: [PATCH 13/40] Fixed the event list when it is setted the replication, now the info message show again. --- pandora_console/operation/events/events.php | 14 ++++++++++---- pandora_console/operation/events/events_list.php | 7 ++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index b2c773a076..8ad9e23852 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -25,6 +25,8 @@ require_once ($config['homedir'].'/include/functions_ui.php'); check_login (); + + if (! check_acl ($config["id_user"], 0, "ER")) { db_pandora_audit("ACL Violation", "Trying to access event viewer"); @@ -46,10 +48,7 @@ if (!$meta) { if (isset($config['event_replication']) && $config['event_replication'] == 1) { - if ($config['show_events_in_local'] == 0) { - return; - } - else { + if ((bool)$config['show_events_in_local']) { $readonly = true; } } @@ -223,6 +222,8 @@ $date_from = (string)get_parameter('date_from', ''); $date_to = (string)get_parameter('date_to', ''); $server_id = (int)get_parameter('server_id', 0); + + $text_agent = (string) get_parameter("text_agent"); $id_agent = get_parameter('id_agent', 0); if ($id_agent != 0) { @@ -243,6 +244,7 @@ if ($id_agent_module != 0) { } + $tag_with_json = base64_decode(get_parameter("tag_with", '')) ; $tag_with_json_clean = io_safe_output($tag_with_json); $tag_with_base64 = base64_encode($tag_with_json_clean); @@ -263,6 +265,8 @@ users_get_groups ($config["id_user"], "ER"); $ids = (array) get_parameter ("eventid", -1); + + $params = "search=" . rawurlencode(io_safe_input($search)) . "&event_type=" . $event_type . "&severity=" . $severity . @@ -295,6 +299,8 @@ if ($meta) { $url = "index.php?sec=eventos&sec2=operation/events/events&" . $params; + + // Header if ($config["pure"] == 0 || $meta) { $pss = get_user_info($config['id_user']); diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 6619425fb9..9fc1ce8f7a 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -35,12 +35,13 @@ if (! check_acl ($config["id_user"], 0, "ER")) { return; } -if(defined('METACONSOLE')){ +if (defined('METACONSOLE')) { $jump = '  '; } -else{ +else { $jump = "
"; } + if (is_ajax()) { $get_filter_values = get_parameter('get_filter_values', 0); $save_event_filter = get_parameter('save_event_filter', 0); @@ -141,7 +142,7 @@ $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_use $tags = tags_get_user_tags($config['id_user'], 'ER'); -if ($id_agent == 0 && $text_agent != '') { +if ($id_agent == 0 && $text_agent != __('All')) { $id_agent = -1; } From 83967d35264d9bb7b192e68f6651a22635e81007 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 13:22:12 +0200 Subject: [PATCH 14/40] Fixed PHP Warnings --- pandora_console/operation/events/events.build_table.php | 7 ++++--- pandora_console/operation/events/events_list.php | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 17f99d3c48..5b98f9b9a9 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -14,6 +14,7 @@ // GNU General Public License for more details. if(!isset($table->width)) { + $table = new stdClass(); $table->width = '100%'; } @@ -500,7 +501,7 @@ foreach ($result as $event) { if (!empty($event_user_comments)) { $last_key = key(array_slice($event_user_comments, -1, 1, true)); $date_format = $config['date_format']; - + foreach ($event_user_comments as $key => $event_user_comment) { $event_user_comment_str .= sprintf('%s: %s
%s: %s
%s: %s
', __('Date'), date($date_format, $event_user_comment['utimestamp']), @@ -591,7 +592,7 @@ foreach ($result as $event) { array ("title" => __('Validate event'))); $data[$i] .= ''; } - + // Delete event if ((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'],$childrens_ids) == 1)) { if($event['estado'] != 2) { @@ -677,7 +678,7 @@ if (!empty ($table->data)) { }); } - id = 'events_filter_form_advanced'; $table_advanced->width = '98%'; $table_advanced->cellspacing = 4; @@ -543,6 +544,7 @@ $table_advanced->rowclass[] = ''; //- END ADVANCE FILTER ------------------------------------------------- +$table = new stdClass(); $table->id = 'events_filter_form'; $table->width = '100%'; $table->cellspacing = 4; From 62ff5eaef46cfe74852d33692195253987a448b0 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Fri, 22 May 2015 14:33:43 +0200 Subject: [PATCH 15/40] Add new macro Events response, tiquet:#2253 --- .../pandoradb_migrate_5.1_to_6.0.mysql.sql | 5 +++++ pandora_console/include/functions_events.php | 17 ++++++++++++++++- pandora_console/pandoradb_data.sql | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 56ccc56c20..bab26c2050 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -115,3 +115,8 @@ INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `descri INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`) VALUES (37,9,'OSVersion','Retrieve the version (build) of a Windows computer','/usr/bin/perl','OSVersion','IyEvdXNyL2Jpbi9wZXJsCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiMgcGFuZG9yYV9wcm9kdWN0SUQucGwKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIyBDb3B5cmlnaHQgKGMpIDIwMTUgQm9yamEgU2FuY2hleiwgPGZib3JqYS5zYW5jaGV6QGFydGljYS5lcz4KIyAgICAgICAgICAgKGMpIDIwMTUgQXJ0aWNhIFNvbHVjaW9uZXMgVGVjbm9sb2dpY2FzIFMuTAojCiMgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgojIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1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YXRpbmdTeXN0ZW0iKTsKIyBSZW1lbWJlciB0byBtYXRjaCBsZW5naHQgb2YgYm90aCBhcnJheXMgaGVhZGVycyAmIHVuaXRzCm15IEBoZWFkZXJzID0gKCJWZXJzaW9uIik7Cm15IEB1bml0cyAgID0gKCIiKTsKcHJpbnRfbW9kdWxlZGF0YSAoXEBoZWFkZXJzLFxAdW5pdHMsIFxAcmVzdWx0KTsKZXhpdCAwOwo=',0), INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`) VALUES (38,9,'Architecture','Retrieve the architecture of a Windows computer','/usr/bin/perl','Architecture','IyEvdXNyL2Jpbi9wZXJsCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiMgcGFuZG9yYV9wcm9kdWN0SUQucGwKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIyBDb3B5cmlnaHQgKGMpIDIwMTUgQm9yamEgU2FuY2hleiwgPGZib3JqYS5zYW5jaGV6QGFydGljYS5lcz4KIyAgICAgICAgICAgKGMpIDIwMTUgQXJ0aWNhIFNvbHVjaW9uZXMgVGVjbm9sb2dpY2FzIFMuTAojCiMgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vcgojIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlCiMgYXMgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IHZlcnNpb24gMi4KIwojIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXR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oaXRlY3R1cmUiKTsKbXkgQHVuaXRzICAgPSAoIiIpOwpwcmludF9tb2R1bGVkYXRhIChcQGhlYWRlcnMsXEB1bml0cywgXEByZXN1bHQpOwpleGl0IDA7Cg==',0); +-- --------------------------------------------------------------------- +-- Table `tevent_response` +-- --------------------------------------------------------------------- +INSERT INTO `tevent_response` VALUES (6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,''); + diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 9840110cb8..c09991a05b 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1571,7 +1571,8 @@ function events_check_event_filter_group ($id_filter) { function events_get_macros() { return array('_agent_address_' => __('Agent address'), '_agent_id_' => __('Agent id'), - '_event_id_' => __('Event id')); + '_event_id_' => __('Event id'), + '_module_address_' => __('Module Agent address'),); } /** @@ -1866,6 +1867,20 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor case '_event_id_': $subst = $event['id_evento']; break; + case '_module_address_': + if($meta) { + $server = metaconsole_get_connection_by_id ($server_id); + metaconsole_connect($server); + } + + $module = db_get_row("tagente_modulo",'id_agente_modulo', $event['id_agentmodule']); + if ($module['ip_target'] != false) + $subst = $module['ip_target']; + + if($meta) { + metaconsole_restore_db_force(); + } + break; } $target = str_replace($macro,$subst,$target); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index b4e2379465..3cd43c4632 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1033,6 +1033,6 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0),(2,'Departm INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','',''),(2,'critical','Critical modules','','',''),(3,'dmz','DMZ Network Zone','','',''),(4,'performance','Performance anda capacity modules','','',''),(5,'configuration','','','',''); -INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,''),(2,'SSH to host','Connect via SSH to the agent','http://localhost:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,''),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,''),(5,'Restart agent','Restart the agent with using UDP protocol. To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,''); +INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,''),(2,'SSH to host','Connect via SSH to the agent','http://localhost:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,''),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,''),(5,'Restart agent','Restart the agent with using UDP protocol. To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,''),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,''); INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', ''); From fcd6927efbe52017d616a3f01ae0460edb26bea4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 15:00:06 +0200 Subject: [PATCH 16/40] Fixed the empty list of events. --- pandora_console/operation/events/events.build_query.php | 2 ++ pandora_console/operation/events/events.php | 6 ++++-- pandora_console/operation/events/events_list.php | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index f1829ef192..16b09a7671 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -123,6 +123,8 @@ else { } } + + if ($meta) { //There is another filter. } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 8ad9e23852..02409525ca 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -224,12 +224,14 @@ $server_id = (int)get_parameter('server_id', 0); -$text_agent = (string) get_parameter("text_agent"); +$text_agent = (string) get_parameter("text_agent", __('All')); + $id_agent = get_parameter('id_agent', 0); if ($id_agent != 0) { $text_agent = db_get_value('nombre', 'tagente', 'id_agente', $id_agent); if ($text_agent == false) { - $text_agent = ''; + $text_agent = __('All'); + $id_agent = 0; } } diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 737a4b9ee8..af2d9490cd 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -141,11 +141,13 @@ $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_use // Get the tags where the user have permissions in Events reading tasks $tags = tags_get_user_tags($config['id_user'], 'ER'); - if ($id_agent == 0 && $text_agent != __('All')) { $id_agent = -1; } + + + ///////////////////////////////////////////// // Build the condition of the events query From 8107a78791a7e75ab63f534dbda5bd5e7cd6aded Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:04:23 +0200 Subject: [PATCH 17/40] Added support to metaconsole in function 'events_get_group_events' --- pandora_console/include/functions_events.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 52f90452ff..bdde8f7463 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1189,7 +1189,7 @@ function events_print_type_description ($type, $return = false) { function events_get_group_events ($id_group, $period, $date, $filter_event_validated = false, $filter_event_critical = false, $filter_event_warning = false, $filter_event_no_validated = false, - $filter_event_search = false) { + $filter_event_search = false, $meta = false) { global $config; @@ -1231,7 +1231,7 @@ function events_get_group_events ($id_group, $period, $date, AND utimestamp <= %d ', implode (",", $id_group), $datelimit, $date); - return events_get_events_grouped($sql_where, 0, 1000); + return events_get_events_grouped($sql_where, 0, 1000, $meta); } /** @@ -1851,7 +1851,7 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor $subst = ''; switch($macro) { case '_agent_address_': - if($meta) { + if ($meta) { $server = metaconsole_get_connection_by_id ($server_id); metaconsole_connect($server); } From c004c2c1b6a9cfeffd1999842a8c670fa4453739 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:05:17 +0200 Subject: [PATCH 18/40] Fixed the 'simple_graph' item in metaconsole reports. TICKET: #2249 --- .../include/functions_reporting.php | 33 +++++++++++++++++-- .../include/functions_reporting_html.php | 1 + 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 5f7139a3c5..12077c6b39 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1987,6 +1987,8 @@ function reporting_exception($report, $content, $type = 'dinamic', function reporting_group_report($report, $content) { global $config; + $metaconsole_on = ($config['metaconsole'] == 1) && defined('METACONSOLE'); + $return['type'] = 'group_report'; @@ -2004,7 +2006,14 @@ function reporting_group_report($report, $content) { $events = events_get_group_events( $content['id_group'], $content['period'], - $report['datetime']); + $report['datetime'], + false, + false, + false, + false, + false, + $metaconsole_on); + if (empty($events)) { $events = array(); } @@ -2012,6 +2021,8 @@ function reporting_group_report($report, $content) { $return["data"]["group_stats"] = reporting_get_group_stats($content['id_group']); + + return reporting_check_structure_content($return); } @@ -3953,6 +3964,16 @@ function reporting_simple_graph($report, $content, $type = 'dinamic', global $config; + + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + + $return = array(); $return['type'] = 'simple_graph'; @@ -3960,12 +3981,16 @@ function reporting_simple_graph($report, $content, $type = 'dinamic', $content['name'] = __('Simple graph'); } + + $module_name = io_safe_output( modules_get_agentmodule_name($content['id_agent_module'])); $agent_name = io_safe_output( modules_get_agentmodule_agent_name ($content['id_agent_module'])); + + $return['title'] = $content['name']; $return['subtitle'] = $agent_name . " - " . $module_name; $return["description"] = $content["description"]; @@ -4060,6 +4085,10 @@ function reporting_simple_graph($report, $content, $type = 'dinamic', break; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -4698,7 +4727,7 @@ function reporting_get_group_stats ($id_group = 0, $access = 'AR') { // ----------------------------------------------------------------- if ($config["realtimestats"] == 0) { - if (!is_array($id_group)){ + if (!is_array($id_group)) { $my_group = $id_group; $id_group = array(); $id_group[0] = $my_group; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 2ce89347f8..0e7dfa6089 100755 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -988,6 +988,7 @@ function reporting_html_exception($table, $item) { function reporting_html_group_report($table, $item) { global $config; + $table->colspan['group_report']['cell'] = 3; $table->cellstyle['group_report']['cell'] = 'text-align: center;'; $table->data['group_report']['cell'] = " From 3ee4194d11cdd221ed77241cb2d3991dc7087362 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:25:56 +0200 Subject: [PATCH 19/40] Fixed the 'simple_baseline_graph' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 12077c6b39..1d6561a794 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2898,6 +2898,14 @@ function reporting_simple_baseline_graph($report, $content, global $config; + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['type'] = 'simple_baseline_graph'; if (empty($content['name'])) { @@ -2939,13 +2947,18 @@ function reporting_simple_baseline_graph($report, $content, true, 0, true, - false, - ui_get_full_url(false, false, false, false)); + $only_image, + ui_get_full_url(false, false, false, false), + $ttl); break; case 'data': break; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 3a213df637cc9f1cee449655c75352e22be5aab0 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:28:44 +0200 Subject: [PATCH 20/40] Fixed PHP Warnings --- pandora_console/godmode/reporting/graphs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 1f7404222a..de161a895f 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -134,8 +134,9 @@ if ($multiple_delete) { $graphs = custom_graphs_get_user ($config['id_user'], false, true, "RR"); if (!empty ($graphs)) { + $table = new stdClass(); $table->width = '98%'; - $tale->class = 'databox_frame'; + $table->class = 'databox_frame'; $table->align = array (); $table->head = array (); $table->head[0] = __('Graph name'); From 9f48e5eaa1785a49c375daeb2961fa9270d8dade Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:37:07 +0200 Subject: [PATCH 21/40] Fixed the 'custom_graph' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1d6561a794..2b9e2b73d4 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3912,6 +3912,14 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', require_once ($config["homedir"] . '/include/functions_graph.php'); + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $graph = db_get_row ("tgraph", "id_graph", $content['id_gs']); $return = array(); @@ -3963,12 +3971,17 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', $graph["stacked"], $report["datetime"], $only_image, - ui_get_full_url(false, false, false, false)); + ui_get_full_url(false, false, false, false), + $ttl); break; case 'data': break; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From cd62f8c91f11d699d1995be1cc2283dfff7629ba Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:43:27 +0200 Subject: [PATCH 22/40] Fixed the 'max_value', 'min_value', 'avg_value', 'sumatory', 'MTTR', 'MTBF', 'TTO', 'TTRT' items in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 2b9e2b73d4..06a593f6a5 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3231,6 +3231,14 @@ function reporting_value($report, $content, $type) { } } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $module_name = io_safe_output( modules_get_agentmodule_name($content['id_agent_module'])); $agent_name = io_safe_output( @@ -3300,6 +3308,10 @@ function reporting_value($report, $content, $type) { 'value' => $value, 'formated_value' => $formated_value); + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 10efebee28af886c4bd87a8950a3093be32643f7 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:51:43 +0200 Subject: [PATCH 23/40] Removed 'SLA_services' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reports.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 pandora_console/include/functions_reports.php diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php old mode 100644 new mode 100755 index d06899952f..5b54f46db2 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -536,8 +536,11 @@ function reports_get_report_types ($template = false, $not_editor = false) { if (!$template && $config['enterprise_installed']) { $types['SLA_monthly'] = array('optgroup' => __('SLA'), 'name' => __('Monthly S.L.A.')); - $types['SLA_services'] = array('optgroup' => __('SLA'), - 'name' => __('Services S.L.A.')); + + if (!$config['metaconsole']) { + $types['SLA_services'] = array('optgroup' => __('SLA'), + 'name' => __('Services S.L.A.')); + } } From 29743cfa743dd620d78744b2990d7f425aae0d36 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 17:55:06 +0200 Subject: [PATCH 24/40] Fixed the 'projection_graph' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 06a593f6a5..d58087b745 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2999,6 +2999,14 @@ function reporting_projection_graph($report, $content, global $config; + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['type'] = 'projection_graph'; if (empty($content['name'])) { @@ -3047,9 +3055,9 @@ function reporting_projection_graph($report, $content, 0, 0, $report["datetime"], - true, + $only_image, ui_get_full_url(false, false, false, false) . '/', - 1, + $ttl, // Important parameter, this tell to graphic_combined_module function that is a projection graph $output_projection, $content['top_n_value'] @@ -3059,6 +3067,10 @@ function reporting_projection_graph($report, $content, break; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From d2b094061af16a1e637da9e478a99bb26e62755d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 22 May 2015 18:02:41 +0200 Subject: [PATCH 25/40] Fixed the 'monitor_report' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index d58087b745..8dc3b1fa54 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2785,6 +2785,14 @@ function reporting_monitor_report($report, $content) { $return["description"] = $content["description"]; $return["date"] = reporting_get_date_text($report, $content); + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $value = reporting_get_agentmodule_sla( $content['id_agent_module'], $content['period'], @@ -2805,6 +2813,10 @@ function reporting_monitor_report($report, $content) { $return["data"]["fail"]["formated_value"] = (100 - $return["data"]["ok"]["formated_value"]); } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 37361f53aec40aa28aa54987a4ee4e8f9167e08a Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 23 May 2015 00:01:13 +0200 Subject: [PATCH 26/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 54ab32a9f1..56e6faa634 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150522 +Version: 6.0dev-150523 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 0300b25ef3..58913b33fd 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="6.0dev-150522" +pandora_version="6.0dev-150523" 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 d32d5858c2..fd3aa54d80 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150522'; +use constant AGENT_BUILD => '150523'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 53ebdcd224..a47f2ca666 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 6.0dev -%define release 150522 +%define release 150523 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 c4be3f40ad..dab433d0d6 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 6.0dev -%define release 150522 +%define release 150523 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 339b1f9281..7de2f90835 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150522} +{150523} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index bf1fe945ed..a7812e9e57 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 ("6.0dev(Build 150522)") +#define PANDORA_VERSION ("6.0dev(Build 150523)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c472d188c1..070fa183b4 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", "(6.0dev(Build 150522))" + VALUE "ProductVersion", "(6.0dev(Build 150523))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 20ebdc0791..24518205e7 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150522 +Version: 6.0dev-150523 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 52fc7e468e..273e6a2200 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="6.0dev-150522" +pandora_version="6.0dev-150523" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d892c2aaf1..fa57633bcd 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150522'; +$build_version = 'PC150523'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f468e2325d..599d0c1aee 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Sun, 24 May 2015 00:01:10 +0200 Subject: [PATCH 27/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 56e6faa634..00021aab73 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150523 +Version: 6.0dev-150524 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 58913b33fd..322a7f8b94 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="6.0dev-150523" +pandora_version="6.0dev-150524" 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 fd3aa54d80..51b8c51f72 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150523'; +use constant AGENT_BUILD => '150524'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index a47f2ca666..cbddfc40d1 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 6.0dev -%define release 150523 +%define release 150524 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 dab433d0d6..d7a6ff696d 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 6.0dev -%define release 150523 +%define release 150524 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7de2f90835..2e883fd2a5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150523} +{150524} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a7812e9e57..62aeb283c8 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 ("6.0dev(Build 150523)") +#define PANDORA_VERSION ("6.0dev(Build 150524)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 070fa183b4..10fefcbd97 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", "(6.0dev(Build 150523))" + VALUE "ProductVersion", "(6.0dev(Build 150524))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 24518205e7..80d288634f 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150523 +Version: 6.0dev-150524 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 273e6a2200..2cf1b7543c 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="6.0dev-150523" +pandora_version="6.0dev-150524" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index fa57633bcd..16c8cea56e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150523'; +$build_version = 'PC150524'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 599d0c1aee..d18c86e7c7 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Mon, 25 May 2015 00:01:11 +0200 Subject: [PATCH 28/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 00021aab73..2660b40db8 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150524 +Version: 6.0dev-150525 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 322a7f8b94..802ca855b1 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="6.0dev-150524" +pandora_version="6.0dev-150525" 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 51b8c51f72..f158c84da0 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150524'; +use constant AGENT_BUILD => '150525'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index cbddfc40d1..9af2027f48 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 6.0dev -%define release 150524 +%define release 150525 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 d7a6ff696d..983d3b7748 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 6.0dev -%define release 150524 +%define release 150525 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2e883fd2a5..ef5bad64bd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150524} +{150525} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 62aeb283c8..4111b94e8e 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 ("6.0dev(Build 150524)") +#define PANDORA_VERSION ("6.0dev(Build 150525)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 10fefcbd97..7179d561cd 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", "(6.0dev(Build 150524))" + VALUE "ProductVersion", "(6.0dev(Build 150525))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 80d288634f..cbed54f8ee 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150524 +Version: 6.0dev-150525 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 2cf1b7543c..c530d841c3 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="6.0dev-150524" +pandora_version="6.0dev-150525" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 16c8cea56e..cfddf5f7d9 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150524'; +$build_version = 'PC150525'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d18c86e7c7..7c2cac8d46 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Mon, 25 May 2015 10:44:20 +0200 Subject: [PATCH 29/40] Fixed error, when type modules is Asyncronous type, tiquet: #2193 (cherry picked from commit 7efff2181640af397efb5f0f2c6eb41a7906b938) --- pandora_console/extensions/module_groups.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 0b612dd46f..4bb97379e0 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -130,7 +130,7 @@ function mainModuleGroups() { //The big query switch ($config["dbtype"]) { case "mysql": - $sql = "SELECT COUNT(id_agente) AS count, case utimestamp when 0 then 5 else estado end as estado + $sql = "SELECT COUNT(id_agente) AS count, estado FROM tagente_estado WHERE id_agente IN (SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled IS FALSE) @@ -141,8 +141,7 @@ function mainModuleGroups() { GROUP BY estado"; break; case "postgresql": - $sql = "SELECT COUNT(id_agente) AS count, - case utimestamp when 0 then 5 else estado end as estado + $sql = "SELECT COUNT(id_agente) AS count, estado FROM tagente_estado WHERE id_agente IN (SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled = 0) @@ -153,7 +152,7 @@ function mainModuleGroups() { GROUP BY estado, utimestamp"; break; case "oracle": - $sql = "SELECT COUNT(id_agente) AS count, case when utimestamp = 0 then 5 else estado end estado + $sql = "SELECT COUNT(id_agente) AS count, estado FROM tagente_estado WHERE id_agente IN (SELECT id_agente FROM tagente WHERE id_grupo = %d AND (disabled IS NOT NULL AND disabled <> 0)) From c713046edfce1a4d41d72d0d208340ed9543b015 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 11:19:25 +0200 Subject: [PATCH 30/40] Fixed the 'sql' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 8dc3b1fa54..b871de38eb 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3408,6 +3408,14 @@ function reporting_sql($report, $content) { $return["description"] = $content["description"]; $return["date"] = reporting_get_date_text(); + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + if ($content['treport_custom_sql_id'] != 0) { switch ($config["dbtype"]) { case "mysql": @@ -3466,6 +3474,10 @@ function reporting_sql($report, $content) { $return['error'] = __('Illegal query: Due security restrictions, there are some tokens or words you cannot use: *, delete, drop, alter, modify, union, password, pass, insert or update.'); } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 6dc62eccced5c44398021ce86a1e0fbe441871d2 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 25 May 2015 11:57:08 +0200 Subject: [PATCH 31/40] Fixed problems with new code, not view unit in graph, tiquet: 2194 (cherry picked from commit 2df8fab33a21a1227547b80bef8cc17320342963) --- .../operation/agentes/interface_traffic_graph_win.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 86f46a15aa..acc4012af6 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -178,7 +178,7 @@ $interface_traffic_modules = array( array_values($interface_traffic_modules), $config['homeurl'], array_keys($interface_traffic_modules), - array("bytes"), + array_fill(0, count($interface_traffic_modules),"bytes"), false); echo '
'; From d943fa5b781f13c8e2b7bb5d5fd9dad85a98d9b9 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 12:46:32 +0200 Subject: [PATCH 32/40] Fixed the 'alert_report_agent', 'alert_report_group' and 'alert_report_module' item in metaconsole reports. TICKET: #2249 --- .../reporting_builder.item_editor.php | 3 +- .../include/functions_reporting.php | 37 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 09659d6b02..d2c47ab3f4 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -550,7 +550,7 @@ else html_print_select(reports_get_report_types(false, true), 'type', $type, 'chooseType();', '', ''); } else { - $report_type = reports_get_report_types($type); + $report_type = reports_get_report_types(); if (!empty($report_type) and isset($report_type[$type]['name'])) echo $report_type[$type]['name']; else @@ -2312,6 +2312,7 @@ function chooseType() { $("#row_period").show(); $("#row_show_in_two_columns").show(); $("#row_group").show(); + $("#row_servers").show(); break; case 'alert_report_agent': $("#row_description").show(); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index b871de38eb..17887f5252 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2412,6 +2412,14 @@ function reporting_alert_report_group($report, $content) { $content['name'] = __('Alert Report Group'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $group_name = groups_get_name($content['id_group'], true); $return['title'] = $content['name']; @@ -2514,6 +2522,10 @@ function reporting_alert_report_group($report, $content) { $return['data'] = $data; + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -2527,6 +2539,15 @@ function reporting_alert_report_agent($report, $content) { $content['name'] = __('Alert Report Agent'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $agent_name = agents_get_name($content['id_agent']); $return['title'] = $content['name']; @@ -2609,6 +2630,10 @@ function reporting_alert_report_agent($report, $content) { $return['data'] = $data; + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -2622,6 +2647,14 @@ function reporting_alert_report_module($report, $content) { $content['name'] = __('Alert Report Module'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $module_name = io_safe_output( modules_get_agentmodule_name($content['id_agent_module'])); $agent_name = io_safe_output( @@ -2702,6 +2735,10 @@ function reporting_alert_report_module($report, $content) { $return['data'] = $data; + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 86db63f4f94e423d1ac8578b727057ac76efef1c Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 25 May 2015 12:55:18 +0200 Subject: [PATCH 33/40] Fixed problems with name of dynamic's worksmap. tiquet: #2207 --- pandora_console/include/functions_networkmap.php | 4 ++-- pandora_console/operation/agentes/networkmap.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index a1e0f9c2cf..3c1b9e27d2 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -1684,7 +1684,7 @@ function networkmap_get_types ($strict_user = false) { $networkmap_types['topology'] = __('Create a new topology map'); $networkmap_types['groups'] = __('Create a new group map'); - $networkmap_types['dinamic'] = __('Create a new dynamic map'); + $networkmap_types['dynamic'] = __('Create a new dynamic map'); if (!$strict_user) { $networkmap_types['radial_dynamic'] = __('Create a new radial dynamic map'); } @@ -1710,7 +1710,7 @@ function networkmap_get_filter_types ($strict_user = false) { $networkmap_types['topology'] = __('Topology'); $networkmap_types['groups'] = __('Group'); - $networkmap_types['dinamic'] = __('Dynamic'); + $networkmap_types['dynamic'] = __('Dynamic'); if (!$strict_user) { $networkmap_types['radial_dynamic'] = __('Radial dynamic'); } diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 6e83586e14..0a3c663f39 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -393,7 +393,7 @@ switch ($activeTab) { $title = __('Policies view'); $icon = "images/policies_mc.png"; break; - case 'dinamic': + case 'dynamic': $title = __('Dynamic view'); $icon = "images/dynamic_network_icon.png"; break; @@ -463,7 +463,7 @@ if ($activeTab == 'groups' || $activeTab == 'policies' || $activeTab == 'radial_ } // Layout -if ($activeTab != 'dinamic' && $activeTab != 'radial_dynamic') { +if ($activeTab != 'dynamic' && $activeTab != 'radial_dynamic') { $form_elems[] = __('Layout') . ' ' . html_print_select ($layout_array, 'layout', $layout, '', '', '', true); } @@ -485,7 +485,7 @@ if ($activeTab == 'topology') { } // No overlap -if ($activeTab != 'dinamic' && $activeTab != 'radial_dynamic') { +if ($activeTab != 'dynamic' && $activeTab != 'radial_dynamic') { $form_elems[] = __('No Overlap') . ' ' . html_print_checkbox ('nooverlap', '1', $nooverlap, true); } @@ -505,13 +505,13 @@ if ($activeTab == 'groups') { } // Simple -if ($activeTab != 'dinamic' && $activeTab != 'radial_dynamic') { +if ($activeTab != 'dynamic' && $activeTab != 'radial_dynamic') { $form_elems[] = __('Simple') . ' ' . html_print_checkbox ('simple', '1', $simple, true); } // Regenerate -if ($activeTab != 'dinamic' && $activeTab != 'radial_dynamic') { +if ($activeTab != 'dynamic' && $activeTab != 'radial_dynamic') { $form_elems[] = __('Regenerate') . ' ' . html_print_checkbox ('regen', '1', $regen, true); } @@ -533,7 +533,7 @@ if ($pure == "1") { } // Font -if ($activeTab != 'dinamic' && $activeTab != 'radial_dynamic') { +if ($activeTab != 'dynamic' && $activeTab != 'radial_dynamic') { $form_elems[] = __('Font') . ' ' . html_print_input_text ('font_size', $font_size, $alt = 'Font size (in pt)', 2, 4, true); } @@ -594,7 +594,7 @@ switch ($activeTab) { case 'policies': require_once(ENTERPRISE_DIR . '/operation/policies/networkmap.policies.php'); break; - case 'dinamic': + case 'dynamic': require_once('operation/agentes/networkmap.dinamic.php'); break; case 'radial_dynamic': From e401dfa8bdf0212d2de9b14a33c4298736b7fba8 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 13:02:22 +0200 Subject: [PATCH 34/40] Fixed the 'event_report_agent', 'event_report_group' and 'event_report_module' items in metaconsole reports. TICKET: #2249 --- .../include/functions_reporting.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 17887f5252..aa7f855b16 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1226,6 +1226,14 @@ function reporting_event_report_group($report, $content, $content['name'] = __('Event Report Group'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['title'] = $content['name']; $return['subtitle'] = groups_get_name($content['id_group'], true); if (!empty($content['style']['event_filter_search'])) { @@ -1378,6 +1386,10 @@ function reporting_event_report_group($report, $content, $ttl); } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -1390,6 +1402,14 @@ function reporting_event_report_module($report, $content) { $content['name'] = __('Event Report Module'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['title'] = $content['name']; $return['subtitle'] = agents_get_name($content['id_agent']) . " - " . @@ -1409,6 +1429,10 @@ function reporting_event_report_module($report, $content) { $return['data'] = $data; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -2038,6 +2062,14 @@ function reporting_event_report_agent($report, $content, $content['name'] = __('Event Report Agent'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['title'] = $content['name']; $return['subtitle'] = agents_get_name($content['id_agent']); $return["description"] = $content["description"]; @@ -2156,6 +2188,10 @@ function reporting_event_report_agent($report, $content, $ttl); } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 81a0a217b5a72aa129e8376e349777d5c39240bb Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 13:31:10 +0200 Subject: [PATCH 35/40] Fixed PHP Warnings --- pandora_console/operation/agentes/alerts_status.php | 1 + pandora_console/operation/agentes/estado_generalagente.php | 5 ++++- pandora_console/operation/agentes/estado_monitores.php | 1 + pandora_console/operation/search_main.php | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 0590173859..9e833607b1 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -381,6 +381,7 @@ if ($print_agent) { } } +$table = new stdClass(); $table->width = '100%'; $table->class = "databox data"; $table->cellpadding = '0'; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 79d873e02b..9772bb55cd 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -59,6 +59,7 @@ if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && !$is_extra) { } // START: TABLE AGENT BUILD +$table_agent = new stdClass(); $table_agent->id = 'agent_details_main'; $table_agent->width = '82%'; $table_agent->cellspacing = 0; @@ -182,6 +183,7 @@ $table_agent->rowclass[] = ''; // END: TABLE AGENT BUILD // START: TABLE CONTACT BUILD +$table_contact = new stdClass(); $table_contact->id = 'agent_contact_main'; $table_contact->width = '100%'; $table_contact->cellspacing = 0; @@ -225,6 +227,7 @@ $table_contact->data[] = $data; // END: TABLE CONTACT BUILD // START: TABLE DATA BUILD +$table_data = new stdClass(); $table_data->id = 'agent_data_main'; $table_data->width = '100%'; $table_data->cellspacing = 0; @@ -481,7 +484,7 @@ if (!empty($network_interfaces)) { // END: TABLE INTERFACES -$table = null; +$table = new stdClass(); $table->id = 'agent_details'; $table->width = '100%'; $table->cellspacing = 0; diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index a9e0ef036a..8fac965916 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -417,6 +417,7 @@ function print_form_filter_monitors($id_agent, $status_filter_monitor = -1, $status_text_monitor = '', $status_module_group=-1) { $form_text = ''; + $table = new stdClass(); $table->class = "databox filters"; $table->width = "100%"; $table->style[0] = 'font-weight: bold;'; diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php index 32248844a2..288f2b7059 100644 --- a/pandora_console/operation/search_main.php +++ b/pandora_console/operation/search_main.php @@ -29,6 +29,7 @@ echo '
' $anyfound = false; +$table = new stdClass(); $table->id = 'summary'; $table->width = '98%'; From 22ce2d8902f5672fc5a7044937058aceb742163c Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 13:39:27 +0200 Subject: [PATCH 36/40] Fixed the 'group_configuration' and 'agent_configuration' items in metaconsole reports. TICKET: #2249 --- .../reporting_builder.item_editor.php | 1 + .../include/functions_reporting.php | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) mode change 100644 => 100755 pandora_console/godmode/reporting/reporting_builder.item_editor.php diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php old mode 100644 new mode 100755 index d2c47ab3f4..f73ef53dd7 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2470,6 +2470,7 @@ function chooseType() { break; case 'group_configuration': $("#row_group").show(); + $("#row_servers").show(); break; case 'netflow_area': $("#row_netflow_filter").show(); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index aa7f855b16..87dd1ac63d 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2307,6 +2307,14 @@ function reporting_group_configuration($report, $content) { $content['name'] = __('Group configuration'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $group_name = groups_get_name($content['id_group'], true); $return['title'] = $content['name']; @@ -2336,6 +2344,10 @@ function reporting_group_configuration($report, $content) { $return['data'][] = $agent_report['data']; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -3172,6 +3184,13 @@ function reporting_agent_configuration($report, $content) { $return["description"] = $content["description"]; $return["date"] = reporting_get_date_text($report, $content); + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } $sql = " SELECT * @@ -3264,6 +3283,10 @@ function reporting_agent_configuration($report, $content) { $return['data'] = $agent_configuration; + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 2f234415161f89c8683c57111c4295ccede11a42 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 16:01:33 +0200 Subject: [PATCH 37/40] Fixed the 'inventory' and 'inventory_changes' items in metaconsole reports. TICKET: #2249 --- .../reporting_builder.item_editor.php | 24 ++++++++++------ .../include/functions_reporting.php | 28 +++++++++++++++++++ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index f73ef53dd7..e91b95910a 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2425,11 +2425,11 @@ function chooseType() { $("#row_module_multi").show(); $("#row_show_in_two_columns").show(); $("#row_servers").show(); - $("#id_agents").change(agent_changed_by_multiple_agents_inventory); + $("#id_agents").change(event_change_id_agent_inventory); $("#id_agents").trigger('change'); $("#combo_group").change(function() { - updateAgents($(this).val()); + updateAgents($(this).val(), ); }); break; @@ -2441,27 +2441,27 @@ function chooseType() { $("#row_date").show(); $("#row_show_in_two_columns").show(); - $("#id_agents").change(agent_changed_by_multiple_agents_inventory); + $("#id_agents").change(event_change_id_agent_inventory); $("#id_agents").trigger('change'); $("#row_servers").show(); $("#combo_group").change(function() { $('#hidden-date_selected').val(''); - updateInventoryDates(); - updateAgents($(this).val()); + updateInventoryDates(); + updateAgents($(this).val(), ); }); $("#id_agents").change(function() { $('#hidden-date_selected').val(''); - updateInventoryDates(); + updateInventoryDates(); }); $("#inventory_modules").change(function() { $('#hidden-date_selected').val(''); - updateInventoryDates(); + updateInventoryDates(); }); if (!$("#hidden-date_selected").val()) - updateInventoryDates(); + updateInventoryDates(); break; case 'inventory_changes': break; @@ -2514,6 +2514,14 @@ function chooseType() { } } +function event_change_id_agent_inventory() { + agent_changed_by_multiple_agents_inventory( + {"data" : {"homedir" : }}, + null, + null, + $("#combo_server").val()); +} + function set_last_value_period() { var checked = $("input[name='last_value']").prop("checked"); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 87dd1ac63d..c8d6b5c959 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1445,6 +1445,14 @@ function reporting_inventory_changes($report, $content) { $content['name'] = __('Inventory Changes'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['title'] = $content['name']; $return['subtitle'] = agents_get_name($content['id_agent']); $return["description"] = $content["description"]; @@ -1471,6 +1479,10 @@ function reporting_inventory_changes($report, $content) { $return['data'] = $inventory_changes; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -1485,6 +1497,14 @@ function reporting_inventory($report, $content) { $content['name'] = __('Inventory'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['title'] = $content['name']; $return["description"] = $content["description"]; $return["date"] = reporting_get_date_text($report, $content); @@ -1510,6 +1530,10 @@ function reporting_inventory($report, $content) { $return['data'] = $inventory_data; } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } @@ -1606,6 +1630,10 @@ function reporting_agent_module($report, $content) { } } + if ($config['metaconsole']) { + metaconsole_restore_db(); + } + return reporting_check_structure_content($return); } From 991c406a703ed92279a744c5bd07eef2f131a61a Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 May 2015 16:29:51 +0200 Subject: [PATCH 38/40] Fixed the 'group_report' item in metaconsole reports. TICKET: #2249 --- pandora_console/include/functions_reporting.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c8d6b5c959..74e03b8434 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2048,6 +2048,14 @@ function reporting_group_report($report, $content) { $content['name'] = __('Group Report'); } + if ($config['metaconsole']) { + $id_meta = metaconsole_get_id_server($content["server_name"]); + + + $server = metaconsole_get_connection_by_id ($id_meta); + metaconsole_connect($server); + } + $return['title'] = $content['name']; $return['subtitle'] = groups_get_name($content['id_group'], true); $return["description"] = $content["description"]; @@ -2073,7 +2081,9 @@ function reporting_group_report($report, $content) { $return["data"]["group_stats"] = reporting_get_group_stats($content['id_group']); - + if ($config['metaconsole']) { + metaconsole_restore_db(); + } return reporting_check_structure_content($return); } From c0bc11e50ad6fbcd737081b32877cf52b0d98c5b Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 26 May 2015 00:02:12 +0200 Subject: [PATCH 39/40] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2660b40db8..59870dccbc 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150525 +Version: 6.0dev-150526 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 802ca855b1..31a2101fa1 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="6.0dev-150525" +pandora_version="6.0dev-150526" 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 f158c84da0..831549f32a 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150525'; +use constant AGENT_BUILD => '150526'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 9af2027f48..32f0cc85ec 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 6.0dev -%define release 150525 +%define release 150526 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 983d3b7748..d2a05eaa5e 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 6.0dev -%define release 150525 +%define release 150526 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ef5bad64bd..fcb9631feb 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150525} +{150526} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 4111b94e8e..e5f1a8675a 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 ("6.0dev(Build 150525)") +#define PANDORA_VERSION ("6.0dev(Build 150526)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7179d561cd..0a49c0da11 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", "(6.0dev(Build 150525))" + VALUE "ProductVersion", "(6.0dev(Build 150526))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index cbed54f8ee..7b11329efa 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150525 +Version: 6.0dev-150526 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 c530d841c3..10ac2fc47c 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="6.0dev-150525" +pandora_version="6.0dev-150526" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index cfddf5f7d9..de70d152df 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150525'; +$build_version = 'PC150526'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7c2cac8d46..f53beae01d 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Tue, 26 May 2015 09:41:31 +0200 Subject: [PATCH 40/40] Changed text in notice of update console, tiquet: #2209 --- pandora_console/include/functions_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 1c84a03865..a8262b8ed6 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1458,7 +1458,7 @@ function config_check () { } if ($_SESSION['new_update'] == 'new') { set_pandora_error_for_header( - __('There is a new update please go to menu Administration and into extensions go to Update Manager for more details.'), + __('There is a new update available. Please go to Administration:Setup:Update Manager for more details.'), __("New update of Pandora Console")); } }