manuelkasper / AS-Stats

A simple tool to generate per-AS traffic graphs from NetFlow/sFlow records
BSD 2-Clause "Simplified" License
194 stars 67 forks source link

AS-Stats not working with sFlow data from Brocade/Extreme NetIron routers #103

Open d307473 opened 2 years ago

d307473 commented 2 years ago

Hello,

it seems as-stats is not working with sFlow data from Brocade/Extreme NetIron devices. No RRD-files are being created within the data-directory. Running asstatd.pl in debug mode produces the following output:

# /opt/as-stats/bin/asstatd.pl -P 2080 -p 0 -r /opt/as-stats/data/rrd -k /opt/as-stats/conf/knownlinks -a 47251
DEBUG Sampling Rate for 192.168.236.1_1 is IN: 1024 | OUT: 1024
DEBUG Sampling Rate for 192.168.236.1_2 is IN: 1024 | OUT: 1024
DEBUG Sampling Rate for 192.168.236.2_1 is IN: 1024 | OUT: 1024
DEBUG Sampling Rate for 192.168.236.2_2 is IN: 1024 | OUT: 1024
3333 => 0 (56 octets, version 4, snmpin 1, snmpout 6)
0 => 31898 (60 octets, version 4, snmpin 6, snmpout 1)
0 => 16509 (380 octets, version 4, snmpin 6, snmpout 1)
14061 => 0 (44 octets, version 4, snmpin 1, snmpout 6)
0 => 397197 (76 octets, version 4, snmpin 6, snmpout 1)
41018 => 0 (44 octets, version 4, snmpin 1, snmpout 6)
0 => 1273 (76 octets, version 4, snmpin 6, snmpout 1)
0 => 14618 (183 octets, version 4, snmpin 6, snmpout 1)
212906 => 0 (56 octets, version 4, snmpin 1, snmpout 6)
0 => 54113 (577 octets, version 4, snmpin 6, snmpout 1)
53667 => 0 (56 octets, version 4, snmpin 1, snmpout 65)
Invalid interface index 3/2147483649
37963 => 39110 (64 octets, version 4, snmpin 1, snmpout 3)
37963 => 0 (64 octets, version 4, snmpin 1, snmpout 3)

Our sFlow-config on both routers:

sflow enable
sflow source ve 4000 8888
sflow destination 192.168.236.100 2080 
sflow polling-interval 30
sflow sample 1024

and on all interfaces we have set:

sflow forwarding

And the knownlinks-file (separated with tabs):

# Router IP ifindex     tag     description color   samplingrate
192.168.236.1   1       uplink1     Transit1    239614  1024
192.168.236.1   2       uplink2     Peering1    4167B5  1024
192.168.236.2   1       uplink3     Transit2    721358  1024
192.168.236.2   2       uplink4     Peering2    EA891B  1024

By using tcpdump we can confirm that sFlow-data is being received on the collector host. Other sFlow monitoring tools are also working as expected - only as-stats does not work. Maybe any hints?

Thanks in advance

georgetasioulis commented 2 years ago

I'm experiencing the same here with an MLX4, though I was able to make it "work" using https://github.com/sflow/sflowtool by converting sFlow into NetFlow.

You could run something like:

sflowtool -c 127.0.0.1 -d 9991

and

/opt/as-stats/bin/asstatd.pl -P 0 -p 9991 -r /opt/as-stats/data/rrd -k /opt/as-stats/conf/knownlinks -a 47251

just make sure that you change your Router IP in the knownlinks file to 127.0.0.1.

PS: converting sFlow to NetFlow results in a significant loss of information, so consider this a dirty hack. Obviously it would be better if sFlow would work correctly with AS-Stats and Brocades.

georgetasioulis commented 2 years ago

Sadly, as I noticed now, with the above method we only see inbound traffic (and I'm not sure it's 100% accurate either, because they don't perfectly match my librenms interface graphs).

BTW what version are you running on your Brocade? The device I'm testing this on is running a pretty old one: V5.6.0aT163