What i need is a simple application that shows the traffic usage and i need it displayed on a web based interface so i can monitor it anywhere as long as there's a browser and Internet connection without having to login to that machine and following the log files.
I searched a bit and doing trial and error and finally i made up my mind that i picked darkstat. It's simple, no hassle, and it solves my needs.
- Download the latest version from their official website (3.0.714 at this moment)
- Download the SlackBuild script for darkstat
- Extract the SlackBuild script
- Edit the VERSION line to match the version you downloaded
- Switch to root and execute the SlackBuild script. The final package will be placed on /tmp (by default)
- Install the package using installpkg
- Finish the installation procedure
There's not much to configure actually. You can start darkstat by issuing darkstat -i ethX (replace X with your ethernet device)
By default, it will bind to port 667, so you can have a look on the stats by browsing to http://youripaddress:667
If you want to bind it to other port, just add -p portnumber parameter, for example darkstat -i eth0 -p 4444
There are some filtering in darkstat, but in most cases, you want to have a look on all traffic, so we skip this step. If you need more information about filtering the output, check the man page for darkstat.
This application doesn't add itself to the crontab or even at startup files, so if you wanted to run this application everytime your machine is booted, you can add this line to /etc/rc.d/rc.local:
# Start DarkStat Monitoring ToolThat's it!!! So simple and you can even finish this tutorial in less than 5 minutes
/usr/sbin/darkstat -i eth0 -p 4444