From 427bb5fe1262081911f31c885002ea62bf2fe5b9 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 18 Sep 2014 00:01:08 +0200 Subject: [PATCH 01/12] 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 e0ee1ff178..76c7235fe5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 5.1-140917 +Version: 5.1-140918 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 2aa064d9ad..702b7d7fc8 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="5.1-140917" +pandora_version="5.1-140918" 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 62ca5ed978..82decf7c48 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 => '5.1'; -use constant AGENT_BUILD => '140917'; +use constant AGENT_BUILD => '140918'; # 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 682b5ce7f2..d02fb9ab11 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 5.1 -%define release 140917 +%define release 140918 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 13927a1cd5..20c2712906 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 5.1 -%define release 140917 +%define release 140918 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 7935ea4b20..6092918eba 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{140917} +{140918} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d3d8699093..5364b76f66 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 ("5.1(Build 140917)") +#define PANDORA_VERSION ("5.1(Build 140918)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 9302951216..368a10434b 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", "(5.1(Build 140917))" + VALUE "ProductVersion", "(5.1(Build 140918))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 96738e0aa2..cc6830b043 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 5.1-140917 +Version: 5.1-140918 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 29bdb9184f..71370ee444 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="5.1-140917" +pandora_version="5.1-140918" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 427abf5f92..19e01b279a 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 = 'PC140917'; +$build_version = 'PC140918'; $pandora_version = 'v5.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 8c5f8af704..e0229ae4d1 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Thu, 18 Sep 2014 10:26:25 +0200 Subject: [PATCH 02/12] Fixed sql error in event list. --- pandora_console/include/functions_html.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index d6237837df..93ced3baf5 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1921,9 +1921,15 @@ function html_print_autocomplete_modules($name = 'module', $groups = users_get_groups($config['id_user'], "AW", false); $groups = array_keys($groups); + if (empty($groups)) { + $id_groups = 0; + } else { + $id_groups = implode(',', $groups); + } + $agents = db_get_all_rows_sql('SELECT id_agente FROM tagente - WHERE id_grupo IN (' . implode(',', $groups) . ')'); + WHERE id_grupo IN (' . $id_groups . ')'); } else { $agents = db_get_all_rows_sql('SELECT id_agente From 16c13ac17e05d6b695b206cb598322232de3f724 Mon Sep 17 00:00:00 2001 From: Vanessa Gil Date: Thu, 18 Sep 2014 12:13:17 +0200 Subject: [PATCH 03/12] Changed values 'post_process', 'interval_module', 'unit' in System Update network component. Ticket #1283 --- .../extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql | 7 +++++++ pandora_console/pandoradb_data.sql | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql index 1d7a9c502c..69303ea368 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql @@ -250,3 +250,10 @@ INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `f -- Table `tconfig` -- --------------------------------------------------------------------- DELETE FROM `tconfig` WHERE `token`='sla_period'; + +-- --------------------------------------------------------------------- +-- Table `network_component` +-- --------------------------------------------------------------------- +UPDATE FROM `network_component` SET `module_inteval`= 3600 WHERE `id_nc`=53; +UPDATE FROM `network_component` SET `post_process`= 0.000000115740741 WHERE `id_nc`=53; +UPDATE FROM `network_component` SET `unit`= 'day' WHERE `id_nc`=53; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 2a2ea39ccc..953c6e04e2 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -325,7 +325,7 @@ INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `t INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (50,'System Description','Get system description (all mibs).',1,17,0,0,9000,0,'','','public','SNMPv2-MIB::sysDescr.0',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (51,'OS Raw Interrupts','Get system raw interrupts from SO',13,16,0,0,180,0,'','','public','UCD-SNMP-MIB::ssRawInterrupts.0',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (52,'OS IO Signals sent','IO Signals sent by Kernel',13,16,0,0,180,0,'','','public','UCD-SNMP-MIB::ssIOSent.0',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); -INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (53,'System Uptime','Sistem uptime in timeticks',1,15,0,0,180,0,'','','public','HOST-RESOURCES-MIB::hrSystemUptime.0',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); +INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (53,'System Uptime','Sistem uptime in timeticks',1,15,0,0,3600,0,'','','public','HOST-RESOURCES-MIB::hrSystemUptime.0',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.000000115740741,'day','basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (176,'Catalyst Free Mem','Taken from ftp://ftp.cisco.com/pub/mibs/oid/OLD-CISCO-MEMORY-MIB.oid',2,15,0,0,180,0,'','','public','1.3.6.1.4.1.9.2.1.8',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (200,'CPU load','CPU0 load average',16,1,100,0,300,1,'','','','SELECT LoadPercentage from Win32_Processor WHERE DeviceID = "CPU0"',1,6,0,'Administrator','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (201,'Free RAM','Available RAM memory in bytes',16,1,0,0,300,0,'','','','SELECT AvailableBytes from Win32_PerfRawData_PerfOS_Memory',1,6,0,'Administrator',NULL,NULL,10,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); From 99a71085476d7ddeed3d9951445da50cffcb9d73 Mon Sep 17 00:00:00 2001 From: Vanessa Gil Date: Thu, 18 Sep 2014 12:38:59 +0200 Subject: [PATCH 04/12] Changed 'post_process' format from tnetwork_component. Ticket #1283. --- .../extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql | 5 +++++ pandora_console/pandoradb.sql | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql index 69303ea368..3793bbbe3d 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql @@ -257,3 +257,8 @@ DELETE FROM `tconfig` WHERE `token`='sla_period'; UPDATE FROM `network_component` SET `module_inteval`= 3600 WHERE `id_nc`=53; UPDATE FROM `network_component` SET `post_process`= 0.000000115740741 WHERE `id_nc`=53; UPDATE FROM `network_component` SET `unit`= 'day' WHERE `id_nc`=53; + +-- --------------------------------------------------------------------- +-- Table `network_component` +-- --------------------------------------------------------------------- +ALTER TABLE `tnetwork_component` MODIFY COLUMN `post_process` DOUBLE(18,15) DEFAULT 0; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index d820fa86c7..17d1547707 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -707,7 +707,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `custom_string_3` text, `custom_integer_1` int(10) default 0, `custom_integer_2` int(10) default 0, - `post_process` double(18,5) default 0, + `post_process` double(18,15) default 0, `unit` text, `wizard_level` enum('basic','advanced','nowizard') default 'nowizard', `macros` text, From 624abdf1fca72f7b0b2f2366e1f055bcf8e57b92 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 12:55:45 +0200 Subject: [PATCH 05/12] Fixed a bug that made the installer crash when called without arguments. --- pandora_server/pandora_server_installer | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 620712cbb3..d121c9cde5 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -10,7 +10,9 @@ MODE=$1 -shift +if [ $# -gt 1 ]; then + shift +fi # Defaults PREFIX=/usr From c5ee2cd954f6bbfaa4d836ddc6c1044aab948ded Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 13:18:06 +0200 Subject: [PATCH 06/12] Server tasks should be executed on the master server only. --- pandora_server/bin/pandora_server | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 79b18c6fb0..1af326583e 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -308,9 +308,7 @@ sub pandora_server_tasks ($) { # Realtime stats (Only master server!) - ( VERY HEAVY !) # Realtimestats == 1, generated by WEB Console, not by server! - if ($pa_config->{"pandora_master"} == 1 - && defined($pa_config->{"realtimestats"}) - && $pa_config->{"realtimestats"} == 0){ + if (defined($pa_config->{"realtimestats"}) && $pa_config->{"realtimestats"} == 0){ # Check if I need to refresh stats my $last_execution_stats = get_db_value ($dbh, "SELECT MAX(utimestamp) FROM tgroup_stat"); @@ -514,8 +512,8 @@ sub main() { # Start the servers pandora_startup (); - # Start thread to execute server tasks - threads->create('pandora_server_tasks', (\%Config))->detach(); + # Start thread to execute server tasks on the master server + threads->create('pandora_server_tasks', (\%Config))->detach() if ($pa_config->{"pandora_master"} == 1); # Generate 'going up' events foreach my $server (@Servers) { From d44e2f081a9a838fcdfc9d86059873646e8bb80f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 13:52:36 +0200 Subject: [PATCH 07/12] The server generates per group agent statistics, not module statistics! Module statistics in the tactical view were broken when realtimestats was disabled. Per group agent statistics were used as if they were per group module statistics. --- .../include/functions_reporting.php | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a605f440a1..fed01ea15d 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1449,11 +1449,11 @@ function reporting_get_group_stats ($id_group = 0, $access = 'AR') { ORDER BY nombre"); $data["monitor_checks"] += $group_stat[0]["modules"]; - $data["monitor_not_init"] += $group_stat[0]["non-init"]; - $data["monitor_unknown"] += $group_stat[0]["unknown"]; - $data["monitor_ok"] += $group_stat[0]["normal"]; - $data["monitor_warning"] += $group_stat[0]["warning"]; - $data["monitor_critical"] += $group_stat[0]["critical"]; + $data["agent_not_init"] += $group_stat[0]["non-init"]; + $data["agent_unknown"] += $group_stat[0]["unknown"]; + $data["agent_ok"] += $group_stat[0]["normal"]; + $data["agent_warning"] += $group_stat[0]["warning"]; + $data["agent_critical"] += $group_stat[0]["critical"]; $data["monitor_alerts"] += $group_stat[0]["alerts"]; $data["monitor_alerts_fired"] += $group_stat[0]["alerts_fired"]; $data["monitor_alerts_fire_count"] += $group_stat[0]["alerts_fired"]; @@ -1464,17 +1464,11 @@ function reporting_get_group_stats ($id_group = 0, $access = 'AR') { $data["utimestamp"] = $group_stat[0]["utimestamp"]; // This fields are not in database - // Get Agents OK - $data["agent_ok"] += groups_agent_ok($group); - // Get Agents Warning - $data["agent_warning"] += groups_agent_warning($group); - // Get Agents Critical - $data["agent_critical"] += groups_agent_critical($group); - // Get Agents Unknown - $data["agent_unknown"] += groups_agent_unknown($group); - // Get Agents Not init - $data["agent_not_init"] += groups_agent_not_init($group); - + $data["monitor_ok"] += groups_monitor_ok($group); + $data["monitor_warning"] += groups_monitor_warning($group); + $data["monitor_critical"] += groups_monitor_critical($group); + $data["monitor_unknown"] += groups_monitor_unknown($group); + $data["monitor_not_init"] += groups_monitor_not_init($group); } // ------------------------------------------------------------------- From 6034dfa5e6d2ee08b8ec7193df58ba6232878a0f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 17:03:31 +0200 Subject: [PATCH 08/12] Fixed the OS type detection for the uninstaller. --- pandora_server/pandora_server_installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d121c9cde5..6ad2916207 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -399,7 +399,7 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client" uninstall () { set_global_vars - if [ "$LINUX" != NO ] || [ "$DISTRO" != "FreeBSD" ] || [ "$DISTRO" != "NetBSD" ] + if [ "$LINUX" != "YES" ] && [ "$DISTRO" != "FreeBSD" ] && [ "$DISTRO" != "NetBSD" ] then echo "This is not a Linux-based distro. Uninstaller is currently not working for your OS" exit 1 From 666097c434685dc848df30110c1bb67478afb79e Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 18:27:41 +0200 Subject: [PATCH 09/12] Added modules for ifce incoming and outgoing traffic and small fixes. --- .../util/recon_scripts/snmp-recon.pl | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/pandora_server/util/recon_scripts/snmp-recon.pl b/pandora_server/util/recon_scripts/snmp-recon.pl index 18d02838cf..02226f59e8 100755 --- a/pandora_server/util/recon_scripts/snmp-recon.pl +++ b/pandora_server/util/recon_scripts/snmp-recon.pl @@ -37,7 +37,7 @@ if ($OSNAME eq "freebsd") { 'pandora_path' => '/usr/local/etc/pandora/pandora_server.conf', 'icmp_checks' => 1, 'networktimeout' => 2, - 'nmap_timing_template' => 2, + 'recon_timing_template' => 3, 'PID' => '', 'quiet' => 1, ); @@ -47,7 +47,7 @@ if ($OSNAME eq "freebsd") { 'pandora_path' => '/etc/pandora/pandora_server.conf', 'icmp_checks' => 1, 'networktimeout' => 2, - 'nmap_timing_template' => 2, + 'recon_timing_template' => 3, 'PID' => '', 'quiet' => 1, ); @@ -101,7 +101,9 @@ my $DOT1DTPFDBADDRESS = ".1.3.6.1.2.1.17.4.3.1.1"; my $DOT1DTPFDBPORT = ".1.3.6.1.2.1.17.4.3.1.2"; my $IFDESC = ".1.3.6.1.2.1.2.2.1.2"; my $IFINDEX = ".1.3.6.1.2.1.2.2.1.1"; +my $IFINOCTECTS = ".1.3.6.1.2.1.2.2.1.10"; my $IFOPERSTATUS = ".1.3.6.1.2.1.2.2.1.8"; +my $IFOUTOCTECTS = ".1.3.6.1.2.1.2.2.1.16"; my $IPENTADDR = ".1.3.6.1.2.1.4.20.1.1"; my $IFNAME = ".1.3.6.1.2.1.31.1.1.1.1"; my $IPNETTOMEDIAPHYSADDRESS = ".1.3.6.1.2.1.4.22.1.2"; @@ -731,7 +733,7 @@ sub create_pandora_agent($) { $if_name = safe_input($if_name); $if_desc = safe_input($if_desc); - # Create the module. + # Interface status module. my %module = ('id_tipo_modulo' => 18, 'id_modulo' => 2, 'nombre' => "if_${if_name}", @@ -742,6 +744,30 @@ sub create_pandora_agent($) { 'snmp_community' => $COMMUNITIES{$device}, 'snmp_oid' => "$IFOPERSTATUS.$if_index"); pandora_create_module_from_hash (\%CONF, \%module, $DBH); + + # Incoming traffic module. + %module = ('id_tipo_modulo' => 16, + 'id_modulo' => 2, + 'nombre' => "if_${if_name}_in", + 'descripcion' => 'The total number of octets received on the interface, including framing characters.', + 'id_agente' => $agent_id, + 'ip_target' => $device, + 'tcp_send' => 1, + 'snmp_community' => $COMMUNITIES{$device}, + 'snmp_oid' => "$IFINOCTECTS.$if_index"); + pandora_create_module_from_hash (\%CONF, \%module, $DBH); + + # Outgoing traffic module. + %module = ('id_tipo_modulo' => 16, + 'id_modulo' => 2, + 'nombre' => "if_${if_name}_out", + 'descripcion' => 'The total number of octets received on the interface, including framing characters.', + 'id_agente' => $agent_id, + 'ip_target' => $device, + 'tcp_send' => 1, + 'snmp_community' => $COMMUNITIES{$device}, + 'snmp_oid' => "$IFOUTOCTECTS.$if_index"); + pandora_create_module_from_hash (\%CONF, \%module, $DBH); } return $agent_id; @@ -864,7 +890,7 @@ sub traceroute_connectivity($) { # Perform a traceroute. my $timeout = $CONF{'networktimeout'}*1000; - my $nmap_args = '-nsP -PE --traceroute --max-retries '.$CONF{'icmp_checks'}.' --host-timeout '.$timeout.' -T'.$CONF{'nmap_timing_template'}; + my $nmap_args = '-nsP -PE --traceroute --max-retries '.$CONF{'icmp_checks'}.' --host-timeout '.$timeout.' -T'.$CONF{'recon_timing_template'}; my $np = new PandoraFMS::NmapParser; eval { $np->parsescan($CONF{'nmap'}, $nmap_args, ($host)); @@ -935,7 +961,7 @@ update_recon_task($DBH, $TASK_ID, 1); # Populate ARP caches. message("Populating ARP caches..."); my $timeout = $CONF{'networktimeout'} * 1000; # Convert the timeout from s to ms. -my $nmap_args = '-nsP --send-ip --max-retries '.$CONF{'icmp_checks'}.' --host-timeout '.$timeout.' -T'.$CONF{'nmap_timing_template'}; +my $nmap_args = '-nsP --send-ip --max-retries '.$CONF{'icmp_checks'}.' --host-timeout '.$timeout.' -T'.$CONF{'recon_timing_template'}; my $np = new PandoraFMS::NmapParser; if ($#SUBNETS >= 0) { $np->parsescan($CONF{'nmap'}, $nmap_args, @SUBNETS); From a5d785e341df59e67fbc4d883c9392b6417ef284 Mon Sep 17 00:00:00 2001 From: Sancho Lerena Date: Thu, 18 Sep 2014 18:30:42 +0200 Subject: [PATCH 10/12] New remote plugin to measure packet loss using a remote check. --- pandora_server/util/plugin/packet_loss.sh | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 pandora_server/util/plugin/packet_loss.sh diff --git a/pandora_server/util/plugin/packet_loss.sh b/pandora_server/util/plugin/packet_loss.sh new file mode 100755 index 0000000000..93ae663050 --- /dev/null +++ b/pandora_server/util/plugin/packet_loss.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# (c) 2014 Sancho Lerena +# (c) Artica Soluciones Tecnologicas + +# Packet loss ICMP measurement remote plugin + +# Remote plugin to measure remote packet loss using ping +# It requires root access, because use flood mode to send many pings. +# It's limited to 50 pings and 10 seconds, so it should not be nasty +# for your network :-) + +if [ $# -eq 0 ] || [ $# -eq 1 ] +then + echo "Syntax: " + exit -1 +fi + +TIMEOUT=$1 +DESTINATION=$2 + +echo `ping -W $1 -q -f -c 50 $2 | grep -o "[0-9\.]*. packet loss" | grep -o "[0-9.]*"` + + From 06fb7a8e66a9ca5eb104c984ee94be21fab82ad9 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Sep 2014 19:06:16 +0200 Subject: [PATCH 11/12] Do not delete the /var/log/pandora directory. Doing so breaks the Pandora FMS Server if it is installed on the same host. --- pandora_agents/unix/pandora_agent_installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ec99895638..b77271b672 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -191,7 +191,7 @@ uninstall () { fi rm -Rf $PANDORA_BASE$PANDORA_HOME 2> /dev/null - rm -Rf $PANDORA_BASE$PANDORA_LOG_DIR 2> /dev/null + rm -Rf $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG 2> /dev/null rm -Rf $PANDORA_BASE$TENTACLE 2> /dev/null rm -Rf $PANDORA_BASE$PANDORA_MAN/{man1,cat1}/tentacle_client.1.gz 2> /dev/null From 6f773474107d5bf464b24289bc91b72cb28b31b6 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 19 Sep 2014 00:01:07 +0200 Subject: [PATCH 12/12] 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 76c7235fe5..16d6f0c3a1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 5.1-140918 +Version: 5.1-140919 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 702b7d7fc8..32ed586daf 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="5.1-140918" +pandora_version="5.1-140919" 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 82decf7c48..38ebdad051 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 => '5.1'; -use constant AGENT_BUILD => '140918'; +use constant AGENT_BUILD => '140919'; # 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 d02fb9ab11..d488b8627e 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 5.1 -%define release 140918 +%define release 140919 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 20c2712906..197802d2e1 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 5.1 -%define release 140918 +%define release 140919 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 6092918eba..0d14c492e3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{140918} +{140919} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5364b76f66..ce15e4982a 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 ("5.1(Build 140918)") +#define PANDORA_VERSION ("5.1(Build 140919)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 368a10434b..7e2fbe0b52 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", "(5.1(Build 140918))" + VALUE "ProductVersion", "(5.1(Build 140919))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index cc6830b043..9f2dd2e167 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 5.1-140918 +Version: 5.1-140919 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 71370ee444..4c9c2551ac 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="5.1-140918" +pandora_version="5.1-140919" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 19e01b279a..5921557830 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 = 'PC140918'; +$build_version = 'PC140919'; $pandora_version = 'v5.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e0229ae4d1..9f0bfdd6bd 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@