mirror of
https://github.com/manuelkasper/AS-Stats.git
synced 2025-02-20 11:44:12 +08:00
Merge pull request #102 from alarig/master
bin/asstatd.pl: parse_sflow: removing snmpin/snmpout >= 1073741823 test
This commit is contained in:
commit
0b9ea81503
@ -578,10 +578,9 @@ sub parse_sflow {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($snmpin >= 1073741823 || $snmpout >= 1073741823) {
|
if ($snmpin > 2147483647 || $snmpout > 2147483647) {
|
||||||
# invalid interface index - could be dropped packet or internal
|
# invalid RFC 2863 ifIndex
|
||||||
# (routing protocol, management etc.)
|
print "Invalid interface index $snmpin/$snmpout\n";
|
||||||
#print "Invalid interface index $snmpin/$snmpout\n";
|
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -678,32 +677,32 @@ sub parse_sflow {
|
|||||||
handleflow($ipaddr, $noctets, $srcas, $dstas, $snmpin, $snmpout, $ipversion, 'sflow', $vlanin, $vlanout);
|
handleflow($ipaddr, $noctets, $srcas, $dstas, $snmpin, $snmpout, $ipversion, 'sflow', $vlanin, $vlanout);
|
||||||
|
|
||||||
if ($peerasstats) {
|
if ($peerasstats) {
|
||||||
# srcpeeras is the one who sent me data
|
# srcpeeras is the one who sent me data
|
||||||
# dstpeeras is the first one to which you'll send the data
|
# dstpeeras is the first one to which you'll send the data
|
||||||
# so, dstpeeras is the first entry in array
|
# so, dstpeeras is the first entry in array
|
||||||
# if the array is now empty (poped before), then take $dstas
|
# if the array is now empty (poped before), then take $dstas
|
||||||
my $srcpeeras = ($sFlowSample->{'GatewayAsSourcePeer'}) ? $sFlowSample->{'GatewayAsSourcePeer'} : 0;
|
my $srcpeeras = ($sFlowSample->{'GatewayAsSourcePeer'}) ? $sFlowSample->{'GatewayAsSourcePeer'} : 0;
|
||||||
my $dstpeeras = 0;
|
my $dstpeeras = 0;
|
||||||
|
|
||||||
if ($sFlowSample->{'GatewayDestAsPaths'}) {
|
if ($sFlowSample->{'GatewayDestAsPaths'}) {
|
||||||
$dstpeeras = @{$sFlowSample->{'GatewayDestAsPaths'}->[0]->{'AsPath'}}[0];
|
$dstpeeras = @{$sFlowSample->{'GatewayDestAsPaths'}->[0]->{'AsPath'}}[0];
|
||||||
if (!$dstpeeras) {
|
if (!$dstpeeras) {
|
||||||
$dstpeeras = 0;
|
$dstpeeras = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($dstpeeras == 0 && $dstas != 0){
|
if($dstpeeras == 0 && $dstas != 0){
|
||||||
$dstpeeras = $dstas;
|
$dstpeeras = $dstas;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($myas{$srcpeeras}) {
|
if ($myas{$srcpeeras}) {
|
||||||
$srcpeeras = 0;
|
$srcpeeras = 0;
|
||||||
}
|
}
|
||||||
if ($myas{$dstpeeras}) {
|
if ($myas{$dstpeeras}) {
|
||||||
$dstpeeras = 0;
|
$dstpeeras = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($srcpeeras != 0 || $dstpeeras != 0) {
|
if ($srcpeeras != 0 || $dstpeeras != 0) {
|
||||||
handleflow($ipaddr, $noctets, $srcpeeras, $dstpeeras, $snmpin, $snmpout, $ipversion, 'sflow', $vlanin, $vlanout, 1);
|
handleflow($ipaddr, $noctets, $srcpeeras, $dstpeeras, $snmpin, $snmpout, $ipversion, 'sflow', $vlanin, $vlanout, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user