On Thursday 01 August 2002 08:28 am, you wrote:
> Does anyone have a shell script example or a better idea on how to monitor
> network usage? I don't think I need anything as big as MRTG.
>
> I have a small network behind a Linux router (2 LAN cards) Can I pull this
> info with a shell script with ifconfig? and have it emailed daily? or
> monthly

iptables has packet/byte counters built into it. If you do "iptables -vL" it 
will show you the counts for each chains and rule within the chain. If you do 
"iptables -vL -Z" it will zero the counters after displaying them.

I have the following set up as a cron job (make it weekly, daily, whatever):

iptables -vnL -Z | mail "[EMAIL PROTECTED]" -s "Bandwidth Usage"

-Mad

-- 
Madness is soil in which creativity grows

                                 - Chris Bielek

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to