I use this script to gather information for the "Bandwith monitor", so i can se in realtime what's happing on my bering-leaf.
A185_in is a chain in Shorewall, like shorewall-stat use, but i have one for in and one for out.
I use iptables because it will give me the output in bytes.
I think you could use this for mrtg/rddtool but i don't know how.


Look at http://www.ba.cnr.it/~paolo/pmacct/ too.
I haven't checked it out yet, but it seems do do the job too.

Joakim


-------------- #!/bin/sh -e trap "exit 1" 1 trap "exit 1" 2 ctxt=0 cpu=0 while [ 1 ] do cpu=$((`iptables -L A185_in -v -x -n|grep RETURN|awk '{print $2}'`)) ctxt=$((`iptables -L A185_out -v -x -n|grep RETURN|awk '{print $2}'`)) usr1o=$((`iptables -L A109_out -v -x -n|grep RETURN|awk '{print $2}'`)) usr2i=$((`iptables -L A201_in -v -x -n|grep RETURN|awk '{print $2}'`)) ... cat /proc/net/dev echo usr0:$cpu 0 0 0 0 0 0 0 $ctxt 0 0 0 0 0 0 0 echo usr1:$usr1i 0 0 0 0 0 0 0 $usr1o 0 0 0 0 0 0 0 ... echo echo "#" sleep 5 done --------

----- Original Message ----- From: "Troy Aden" <[EMAIL PROTECTED]>
To: "Leaf-User (E-mail)" <[email protected]>
Sent: Tuesday, February 22, 2005 4:37 PM
Subject: [leaf-user] Shorewall Accounting Statistics for MRTG



I am looking over a procedure for graphing specific ports with MRTG using
shorewall accounting to track port usage. The problem is that it seems the
procedure that I found is meant for someone who is running shorewall on a
full blown Linux box not a Bering L.E.A.F box. I am wondering if anyone has
successfully done this on Bering? And if so, if they could point me to a
working procedure or tweak the procedure I found here
(http://www.nightbrawler.com/code/shorewall-stats/) to be workable with
Bering UClibc 2.2.2? I have a box running Debian that is connected to the
Bering box. I have MRTG and Perl installed on the Debian box. The place
where I am stumped is the "shorewall_stats.pl". My impression is that this
file should be residing on the Bering box. The problem is that my mrtg.cfg
file resides on my Debian box. Or can the shorewall_stats.pl file reside on
my Debian box and still pull what it needs from shorewall on my Bering
firewall? I am sure that others would be interested in doing this since it
would be very handy to know what ports are using what percentage of your
bandwidth.


Sorry about the wording above. Thanks in advance!

Troy



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
------------------------------------------------------------------------
leaf-user mailing list: [email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

__________ NOD32 1.1005 (20050221) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com





------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ------------------------------------------------------------------------ leaf-user mailing list: [email protected] https://lists.sourceforge.net/lists/listinfo/leaf-user SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

Reply via email to