Fix storm protection for SNMPv2 traps.

This commit is contained in:
Ramon Novoa 2020-03-06 12:59:31 +01:00
parent bdd6cde6c2
commit 9743f1a2d4
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,10 @@ sub data_producer ($) {
# Storm protection.
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);
if (! defined ($AGENTS{$source})) {
$AGENTS{$source}{'count'} = 1;