2013-03-20 Ramon Novoa <rnovoa@artica.es>

* conf/pandora_server.conf,
	  lib/PandoraFMS/Core.pm,
	  lib/PandoraFMS/Config.pm,
	  bin/pandora_server: Added the parameter braa_retries, which lets braa
	  retry SNMP modules a number of times before handing it over to the
	  network server.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7873 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2013-03-20 15:50:41 +00:00
parent 0a59852587
commit ec65703d8b
5 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2013-03-20 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf,
lib/PandoraFMS/Core.pm,
lib/PandoraFMS/Config.pm,
bin/pandora_server: Added the parameter braa_retries, which lets braa
retry SNMP modules a number of times before handing it over to the
network server.
2013-03-19 Ramon Novoa <rnovoa@artica.es>
* bin/pandora_server: Moved a log message to verbosity 10.

View File

@ -313,7 +313,7 @@ while (1) {
# Update module status and fired alert counts
my @agents = get_db_rows ($DBH, 'SELECT id_agente, nombre, update_module_count, update_alert_count FROM tagente WHERE disabled = 0 AND (update_module_count=1 OR update_alert_count=1)');
foreach my $agent (@agents) {
print_message (\%Config, " [*] Updating module status and alert fired counts for agent " . $agent->{'nombre'}, 10);
logger (\%Config, " [*] Updating module status and alert fired counts for agent " . $agent->{'nombre'}, 10);
if ($agent->{'update_module_count'} == 1) {
pandora_update_agent_module_count ($DBH, $agent->{'id_agente'});

View File

@ -234,6 +234,10 @@ snmpget /usr/bin/snmpget
braa /usr/bin/braa
# Number of retries before braa hands a module over to the Network Server (PANDORA FMS ENTERPRISE ONLY).
braa_retries 3
# Default group id for new agents created with Pandora FMS Data Server
autocreate_group 2

View File

@ -253,6 +253,9 @@ sub pandora_load_config {
# braa for enterprise snmp server
$pa_config->{"braa"} = "/usr/bin/braa";
# SNMP enterprise retries (for braa)
$pa_config->{"braa_retries"} = 3; # 5.0
# Xprobe2 for recon OS fingerprinting and tcpscan (optional)
$pa_config->{"xprobe2"} = "/usr/bin/xprobe2";
@ -292,7 +295,7 @@ sub pandora_load_config {
# Event auto-validation
$pa_config->{"event_auto_validation"} = 1; # 5.0
# -------------------------------------------------------------------------
# This values are not stored in .conf files.
# This values should be stored in database, not in .conf files!
@ -541,6 +544,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^braa\s(.*)/i) {
$pa_config->{'braa'}= clean_blank($1);
}
elsif ($parametro =~ m/^braa_retries\s([0-9]*)/i) {
$pa_config->{"braa_retries"} = clean_blank($1);
}
elsif ($parametro =~ m/^xprobe2\s(.*)/i) {
$pa_config->{'xprobe2'}= clean_blank($1);
}

View File

@ -997,6 +997,7 @@ sub pandora_process_module ($$$$$$$$$;$) {
my $status_changes = $agent_status->{'status_changes'};
my $last_data_value = $agent_status->{'datos'};
my $last_known_status = $agent_status->{'last_known_status'};
my $last_error = defined ($module->{'last_error'}) ? $module->{'last_error'} : $agent_status->{'last_error'};
# Get new status
my $new_status = get_module_status ($processed_data, $module, $module_type);
@ -1074,10 +1075,10 @@ sub pandora_process_module ($$$$$$$$$;$) {
SET datos = ?, estado = ?, last_status = ?, last_known_status = ?,
status_changes = ?, utimestamp = ?, timestamp = ?,
id_agente = ?, current_interval = ?, running_by = ?,
last_execution_try = ?, last_try = ?
last_execution_try = ?, last_try = ?, last_error = ?
WHERE id_agente_modulo = ?', $processed_data, $status, $last_status, $last_status, $status_changes,
$current_utimestamp, $timestamp, $module->{'id_agente'}, $current_interval, $server_id,
$utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $module->{'id_agente_modulo'});
$utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $last_error, $module->{'id_agente_modulo'});
# Save module data. Async and log4x modules are not compressed.
if ($module_type =~ m/(async)|(log4x)/ || $save == 1) {
@ -3781,7 +3782,7 @@ sub pandora_module_unknown ($$) {
}
# Update module status count
pandora_mark_agent_for_module_update ($dbh, $agent, 0, $module->{'estado'});
pandora_mark_agent_for_module_update ($dbh, $module->{'id_agente'});
# Generate alerts
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0) {
@ -3811,7 +3812,7 @@ sub pandora_module_unknown ($$) {
}
# Update module status count
pandora_mark_agent_for_module_update ($dbh, $agent, 3, $module->{'estado'});
pandora_mark_agent_for_module_update ($dbh, $module->{'id_agente'});
# Generate alerts
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0) {