Skip to contentSkip to conversation

IMPT!!! - What software to use to gauge if Bandwidth control is working/successful ??

LARTC Rick Goh Siow Mong [email protected] 3 participants 8 messages Jan 11, 2001 – Jan 12, 2001

lore
Share & tools
lore

Rick Goh Siow Mong [email protected]

author
#0 lore raw

How does one know if the traffic to a machine has indeed being limited to say 64Kbps?

What software are you using to gauge this? Can this software show graphically in real-time the amount of data to this machine?

Regards.

#1 lore raw

<PRE>On Thu, Jan 11, 2001 at 10:38:15PM +0800, Rick Goh Siow Mong wrote:
&gt;<i> How does one know if the traffic to a machine has indeed being limited to say 64Kbps?
</I>&gt;<i>
</I>&gt;<i> What software are you using to gauge this? Can this software show graphically in real-time the amount of data to this machine? </I>
'iptraf' is very good for 'now' measurements. 'mrtg' takes 5 minute
averages, which is also very useful.

Signature · 6 lines
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet


</PRE>
#2 lore raw
In reply to Rick Goh Siow Mong [email protected]

<PRE>bert hubert wrote:

&gt;<i> On Thu, Jan 11, 2001 at 10:38:15PM +0800, Rick Goh Siow Mong wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> How does one know if the traffic to a machine has indeed being limited to say 64Kbps?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> What software are you using to gauge this? Can this software show graphically in real-time the amount of data to this machine? </I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> 'iptraf' is very good for 'now' measurements. 'mrtg' takes 5 minute
</I>&gt;<i> averages, which is also very useful.
</I>
Bert,
MRTG works with SNMP to get traffic statistics from remote routers.
How did you get SNMP to work on a Linux box? Have you already used MRTG
to monitor linux routers?

(for those unfamiliar with SNMP: SNMP is short for Simple Network Management Protocol, an IETF standardised protocol, widely used by ISP's and enterprises for monitoring and managing their IP networks. It is invented for managing large networks, so it is actually of no use for the home user.)

Regards,
Guy

</PRE>

#3 lore raw
In reply to Rick Goh Siow Mong [email protected]

<PRE>On Thu, Jan 11, 2001 at 07:34:46PM +0100, Guy Van Den Bergh wrote:

&gt;<i> MRTG works with SNMP to get traffic statistics from remote routers. </I>&gt;<i> How did you get SNMP to work on a Linux box? Have you already used MRTG </I>&gt;<i> to monitor linux routers?
</I>
Yes. You can install an snmp daemon on your Linux box, which will make it respond to snmp commands a router would respond to as well. I don't like this approach because my 8MB 486 router didn't have enough memory to run an snmp daemon concurrently with mrtg.

The second way, which I like a lot better, is to have mrtg call an external program which then creates the right numbers. Very easy to do:

export PATH=$PATH:/usr/sbin
ipchains -vx -L output | grep $1 | cut -b 9-19
ipchains -vx -L input | grep $1 | cut -b 9-19
uptime
echo $1-router

This creates output mrtg can understand.

Regards,

bert hubert

Signature · 6 lines
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet


</PRE>
author
#4 lore raw
In reply to Rick Goh Siow Mong [email protected]

<PRE>I have tried IPCHAINS IP Accounting.

However, the amount of traffic as accounted for by IPCHAINS for the amount of bandwidth going through the ports of my linux box, is not accurate at all. In fact, the number is completely off!

Could u send me your ipchains scripts? thanks in advance.

*******************************************
Below is what i did, which give me the wrong figures. Am I missing something here??

In rc.firewall, i added the following lines:

# To accept traf-stats for MRTG
/sbin/ipchains -N web
/sbin/ipchains -A web -j ACCEPT
/sbin/ipchains -N ftp
/sbin/ipchains -A ftp -j ACCEPT
/sbin/ipchains -N dns
/sbin/ipchains -A dns -j ACCEPT
/sbin/ipchains -N telnet
/sbin/ipchains -A telnet -j ACCEPT /sbin/ipchains -A input -p tcp --dport www -j web /sbin/ipchains -A output -p tcp --sport www -j web /sbin/ipchains -A input -p udp --dport www -j web /sbin/ipchains -A output -p udp --sport www -j web /sbin/ipchains -A input -p tcp --dport ftp -j ftp /sbin/ipchains -A output -p tcp --sport ftp -j ftp /sbin/ipchains -A input -p tcp --dport domain -j dns /sbin/ipchains -A output -p tcp --sport domain -j dns /sbin/ipchains -A input -p udp --dport domain -j dns /sbin/ipchains -A output -p udp --sport domain -j dns /sbin/ipchains -A input -p tcp --dport telnet -j telnet /sbin/ipchains -A output -p tcp --sport telnet -j telnet

traffic.sh --&gt; the script to be run under MRTG.

#!/bin/sh
#Courtesy of xidus.net.
statname=$1
uptime=unused
stat=cat /proc/net/ip_fwchains | grep $statname | tail -1 | awk '{print $10}'
echo $stat
echo $stat
echo $statname
echo $uptime

</PRE>

#5 lore raw
In reply to Rick Goh Siow Mong [email protected]

<PRE>On Fri, Jan 12, 2001 at 09:31:32PM +0800, Rick Goh Siow Mong wrote:
&gt;<i> I have tried IPCHAINS IP Accounting.
</I>&gt;<i>
</I>&gt;<i> However, the amount of traffic as accounted for by IPCHAINS for the amount </I>&gt;<i> of bandwidth going through the ports of my linux box, is not accurate at </I>&gt;<i> all. In fact, the number is completely off!
</I>
I suspect that you will find that it works perfectly. However, MRTG can be misconfigured. MRTG expects either 'absolute', 'direct' or 'gauge' data. Investige if you are supplying it with the right data.

Regards,

bert hubert

Signature · 6 lines
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet


</PRE>
author
#6 lore raw
In reply to Rick Goh Siow Mong [email protected]

<PRE>Is this correct?

# trafstat.sh is available at <A HREF="http://mrtg.xidus.net/run/trafstat.sh">http://mrtg.xidus.net/run/trafstat.sh</A>
# returns byte counters based on ipchains stats
# see the script for more info on the setup
Target[traf-web]: `/www/mrtg/run/trafstat.sh web`
Options[traf-web]: nopercent,growright,noinfo
Title[traf-web]: Web traffic
PageTop[traf-web]: &lt;h1&gt;Web traffic&lt;/h1&gt;
MaxBytes[traf-web]: 1000000
YLegend[traf-web]: Bytes/s
ShortLegend[traf-web]: B/s
LegendI[traf-web]: &amp;nbsp;Traffic
LegendO[traf-web]:
Legend1[traf-web]: Traffic in Bytes per Second

</PRE>

#7 lore raw
In reply to Rick Goh Siow Mong [email protected]

<PRE>On Fri, Jan 12, 2001 at 10:57:35PM +0800, Rick Goh Siow Mong wrote:
&gt;<i> Is this correct?
</I>
Well, I'm not your personal helpdesk, I would advice truly understanding MRTG. But, at a guess, add 'gauge' to Options. You probably see ever growing bandwidth usage now.

Regards,

bert hubert

Signature · 6 lines
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet


</PRE>