A tool writted by Manuel Kasper [email protected] for Monzoon Networks AG.
This tool generate per-AS traffic graphs from NetFlow/SFlow records.
See AS-Stats Repository for more details.
Before to use it, make a right directory for persistante data.
mkdir -p /data/conf /data/rrd
Create a "knownlinks" file in /data/conf/
See AS-Stats Repository for more details.
Example :
touch /data/conf/knownlinks
vim /data/conf/knownlinks
<ip router> <tab> <ifindex> <tab> <short tag> <tab> <description> <tab> <color digit> <tab> <sampling rate>
1.1.1.1 <tab> 10 <tab> provider <tab> My Prodiver <tab> 7648EC <tab> 1
Important: you must use tabs, not spaces, to separate fields!
NETFLOW set 1 if you want enable Netflow
NETFLOW_PORT set udp port for Netflow daemon
SFLOW set 1 if you want enable SFlow
SFLOW_PORT set udp port for SFlow daemon
SFLOW_ASN set your asn number for SFlow daemon
TZ set timezone
Important: Default timezone is UTC !
docker run -d --name=as-stats -e NETFLOW=1 -e NETFLOW_PORT=5000 -e TZ=Europe/Paris -v <my directory>:/data/as-stats -p 80:80 -p 5000:5000/udp nidebr/as-stats
Important: Change WebUI port and Netflow port according your configuration!
docker run -d --name=as-stats -e SFLOW=1 -e SFLOW_PORT=6000 -e SFLOW_ASN=1234 -e TZ=Europe/Paris -v <my directory>:/data/as-stats -p 80:80 -p 5000:5000/udp nidebr/as-stats
Important: Change WebUI port, SFlow port and ASN number according your configuration!
Docker compose file exemple :
version: '2'
services:
as-stats:
image: nidebr/as-stats
ports:
- "8080:80"
- "5000:5000/udp"
environment:
- NETFLOW=1
- NETFLOW_PORT=5000
- TZ=Europe/Paris
volumes:
- <my directory>:/data/as-stats
Config file for WebUI a here :
vim <my directory>/config.inc
See AS-Stats Repository for more details.
docker exec -it as-stats stats-day
Important: When docker image start, startup script wait 2 minutes and launch automaticaly this script. I recommand wait ~5/10 minutes and restart "manually stats day", its for the first stats appear on WebUI.
If you want to enter instance :
docker exec -it as-stats bash