Added an option to delay SNMP trap processing.

This commit is contained in:
Ramon Novoa 2016-08-09 12:11:37 +02:00
parent f132affb99
commit 00ba97f44b
2 changed files with 7 additions and 0 deletions

View File

@ -258,6 +258,7 @@ sub pandora_load_config {
$pa_config->{"snmp_pdu_address"} = 0; # 5.0
$pa_config->{"snmp_storm_protection"} = 0; # 5.0
$pa_config->{"snmp_storm_timeout"} = 600; # 5.0
$pa_config->{"snmp_delay"} = 0; # > 6.0SP3
$pa_config->{"snmpconsole_threads"} = 1; # 5.1
$pa_config->{"translate_variable_bindings"} = 0; # 5.1
$pa_config->{"translate_enterprise_strings"} = 1; # 5.1
@ -530,6 +531,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^snmp_storm_timeout\s+(\d+)/i) {
$pa_config->{'snmp_storm_timeout'}= clean_blank($1);
}
elsif ($parametro =~ m/^snmp_delay\s+(\d+)/i) {
$pa_config->{'snmp_delay'}= clean_blank($1);
}
elsif ($parametro =~ m/^snmpconsole_threads\s+(\d+)/i) {
$pa_config->{'snmpconsole_threads'}= clean_blank($1);
}

View File

@ -328,6 +328,9 @@ sub pandora_snmptrapd {
# Evaluate alerts for this trap
pandora_evaluate_snmp_alerts ($pa_config, $trap_id, $source, $oid, $type, $oid, $value, $custom_oid, $dbh);
}
# Delay the consumption of the next task.
sleep($pa_config->{'snmp_delay'}) if ($pa_config->{'snmp_delay'} > 0);
}
########################################################################################