From 151313e03f3918159005538225b63a09d173ca48 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 22 Jun 2011 16:39:00 +0000 Subject: [PATCH] 2011-06-22 Ramon Novoa * lib/PandoraFMS/Config.pm: Added a new SNMP server (enterprise). * lib/PandoraFMS/NetworkServer.pm: Small fixes. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4479 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/lib/PandoraFMS/Config.pm | 10 +++++++++- pandora_server/lib/PandoraFMS/NetworkServer.pm | 7 ++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index f6a26a2018..db09b6f99a 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2011-06-22 Ramon Novoa + + * lib/PandoraFMS/Config.pm: Added a new SNMP server (enterprise). + + * lib/PandoraFMS/NetworkServer.pm: Small fixes. + 2011-06-21 Sergio Martin * lib/PandoraFMS/DataServer.pm: Fixed numeric condition in a string diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 238434cf99..ebce419a16 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -238,7 +238,9 @@ sub pandora_load_config { $pa_config->{"event_window"} = 3600; # 4.0 $pa_config->{"icmpserver"} = 1; # 4.0 $pa_config->{"icmp_threads"} = 3; # 4.0 - $pa_config->{"block_size"} = 50; # 4.0 + $pa_config->{"snmpserver"} = 1; # 4.0 + $pa_config->{"snmp_threads"} = 3; # 4.0 + $pa_config->{"block_size"} = 15; # 4.0 $pa_config->{"max_queue_files"} = 500; @@ -253,6 +255,9 @@ sub pandora_load_config { # nmap for recon OS fingerprinting and tcpscan (optional) $pa_config->{"nmap"} = "/usr/bin/nmap"; + # braa for enterprise snmp server + $pa_config->{"braa"} = "/usr/bin/braa"; + # Xprobe2 for recon OS fingerprinting and tcpscan (optional) $pa_config->{"xprobe2"} = "/usr/bin/xprobe2"; @@ -513,6 +518,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^nmap\s(.*)/i) { $pa_config->{'nmap'}= clean_blank($1); } + elsif ($parametro =~ m/^braa\s(.*)/i) { + $pa_config->{'braa'}= clean_blank($1); + } elsif ($parametro =~ m/^xprobe2\s(.*)/i) { $pa_config->{'xprobe2'}= clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index a4a485e0d2..23386ab619 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -87,7 +87,8 @@ sub data_producer ($) { my @tasks; my @rows; - + my $network_filter = enterprise_hook ('get_network_filter', [$pa_config]); + if ($pa_config->{'pandora_master'} == 0) { @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try FROM tagente, tagente_modulo, tagente_estado @@ -96,7 +97,7 @@ sub data_producer ($) { AND tagente.disabled = 0 AND tagente_modulo.id_tipo_modulo > 4 AND tagente_modulo.id_tipo_modulo < 19 ' - . enterprise_hook ('get_network_filter', []) . + . (defined ($network_filter) ? $network_filter : ' ') . 'AND tagente_modulo.disabled = 0 AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())) @@ -110,7 +111,7 @@ sub data_producer ($) { AND tagente_modulo.disabled = 0 AND tagente_modulo.id_tipo_modulo > 4 AND tagente_modulo.id_tipo_modulo < 19 ' - . enterprise_hook ('get_network_filter', []) . + . (defined ($network_filter) ? $network_filter : ' ') . 'AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())) ORDER BY tagente_modulo.flag DESC, time_left DESC, tagente_estado.last_execution_try ASC', $pa_config->{'servername'});