Statistical Data Overview
Note: You do not have to do all of this by yourself, simply install luci-app-statistics and configure it with the help of luci_statistics. Done. However, if you are bored, knock yourself out:
Collect data
Executing some simple commands like iptables -nL -v -x -t filter, tc -s qdisc show dev pppoe-dsl or tc filter show dev pppoe-dsl will already output statistical data. Simple. But there tools which collect such (and much more) data and parse it for storage or for other programs which draw pictures from the parsed data:
- statistic.collectd a daemon which monitors various system info through plugins and optionally outputs gathered data into *.rrd files (rrd is only one of several options, it can send over network or export *.csv files as well)
- statistic.rrdcollect a very simple data collector daemon which lets you define rules and patterns to extract numerical data from commands (like an iptables listing) or files (like /sys or /proc)
- statistic.custom custom cronjobs which gather data and parse it and then call
rrdupdatemanually on existing *.rrd files
- bwmon
milk this article for the related content, leave stuff for testing current bandwidth there, move the rest
Generate charts from data
Now from this statistical data we could make some tools create pretty pictures:
- statistic.rrdTool http://oss.oetiker.ch/rrdtool/ provides the means to create, update, dump, examine and render *.rrd files
- charts.mrtg http://oss.oetiker.ch/mrtg/ is written in Perl, use rrdTool, which is written in C
- to create for bodacious pie charts like e.g. gargoyle Gargoyle you could utilize JavaScript, AJAX, etc.
NOTE: If you do not log exclusively your own traffic data, please mind data privacy protection laws to prevent you from going to jail or paying a fine. Usually it is alright to collect and display adequately anonymized data but nothing else without knowledge and consent of the persons concernd.
Serve Pictures
- http.overview pick a webserver, install and configure it
- chart.http make rrdTool place the PNG-files in a directory, then make ? tinker a html-page which the webserver can serve
doc/howto/statistical.data.overview.txt · Last modified: 2011/05/27 15:59 by orca
