Merge branch 'ent-5558-9625-no-funciona-proteccion-tormenta-de-traps-snmpv2' into 'develop'

Fix storm protection for SNMPv2 traps.

See merge request artica/pandorafms!3096
This commit is contained in:
Daniel Rodriguez 2020-03-06 14:19:52 +01:00
commit 05dbe9c922
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,10 @@ sub data_producer ($) {
# Storm protection. # Storm protection.
my ($ver, $date, $time, $source, $null) = split(/\[\*\*\]/, $line, 5); my ($ver, $date, $time, $source, $null) = split(/\[\*\*\]/, $line, 5);
if ($ver eq "SNMPv2" || $pa_config->{'snmp_pdu_address'} eq '1' ) {
$source =~ s/(?:(?:TCP|UDP):\s*)?\[?([^] ]+)\]?(?::-?\d+)?(?:\s*->.*)?$/$1/;
}
next unless defined ($source); next unless defined ($source);
if (! defined ($AGENTS{$source})) { if (! defined ($AGENTS{$source})) {
$AGENTS{$source}{'count'} = 1; $AGENTS{$source}{'count'} = 1;