LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Is there a terminal command that I can run that will........... (https://www.linuxquestions.org/questions/linux-networking-3/is-there-a-terminal-command-that-i-can-run-that-will-380462/)

ludwig W 11-06-2005 09:00 AM

Is there a terminal command that I can run that will...........
 
Hi,
Is there a terminal command that I can run that will give me a readout of the upload and download of my network interface (eth0) every few seconds?

I've been trying to find something like this but can't.

I want it to run in a terminal and not a gui.

Can anyone help?

thanks
Ludwig

fouldsy 11-06-2005 09:47 AM

You tried iptraf ? Lets you view different real-time reports for your interfaces depending on what data you're wishing to view.

ludwig W 11-06-2005 09:51 AM

thanks for the info, mate.

Is there a native UNIX command that would do that, rather than a 3rd party program?


cheers:newbie:

mickyg 11-06-2005 09:57 AM

As root type:

ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}' for total downloaded and ifconfig eth0 | grep 'RX bytes' | awk '{print $7 $8}' for total uploaded.

ludwig W 11-06-2005 10:02 AM

thanks mickyg.
However, I'm really looking for a readout that updates every few seconds that tells me the data rate uploaded and downloaded in kB/s

Any idea about that?


cheers mate :newbie:

tredegar 11-06-2005 10:48 AM

Check out gkrellm:

http://members.dslextreme.com/users/...m/gkrellm.html

Edit:Ooops! You ask for a terminal command.... But have you considered how messy this will make your terminal?

ludwig W 11-06-2005 10:58 AM

well, I can have several terminals open at once.
The reason I only want terminals is that I have a really low powered box that runs blackbox and runs as an NFS server 24/7. It's too low powered to run KDE or Gnome effectively, so I'd prefer just to run Blackbox and not have any gui's.

I would have thought that there must be a unix command that monitors eth0????

tkedwards 11-06-2005 09:48 PM

Quote:

Distribution: thanks mickyg.
However, I'm really looking for a readout that updates every few seconds that tells me the data rate uploaded and downloaded in kB/s
Code:

watch -n 1 "/sbin/ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}'"
will update every 1 second

Code:

I would have thought that there must be a unix command that monitors eth0????
There are plenty of monitoring programs for Linux - iptraf (as already suggested), dstat, ntop are just some. These are all Linux command line programs.

ludwig W 11-07-2005 01:48 AM

Quote:

watch -n 1 "/sbin/ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}'"
Thanks tkedwards....that works great.
However, if I wanted kb instead of bytes, how would I do that?


Cheers
Ludwig :)

heema 11-07-2005 02:09 AM

you could convert the output if you want

ludwig W 11-07-2005 02:18 AM

sorry to be dumb, but how would you do that?

ludwig W 11-07-2005 01:14 PM

actually, what I've found is that this doesn't work great.
Quote:

watch -n 1 "/sbin/ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}'"
This seems to give me the total amount downloaded and uploaded.
That's not what I want.
I want the RATE at which things are being downloaded and uploaded.
i.e. kb/s

Can anyone help me with that?????


Cheers
Ludwig

fur 11-07-2005 01:52 PM

ethstats does exactly what you are looking for. However you will need to install it..

Here is a example of the output..

Code:

Pinky:~# ethstats
total:    2.87 Mb/s In    0.23 Mb/s Out -    620.0 p/s In    287.0 p/s Out
  eth0:    0.23 Mb/s In    0.23 Mb/s Out -    288.0 p/s In    287.0 p/s Out
  eth1:    2.65 Mb/s In    0.00 Mb/s Out -    332.0 p/s In      0.0 p/s Out
total:    2.56 Mb/s In    0.25 Mb/s Out -    613.1 p/s In    316.0 p/s Out
  eth0:    0.25 Mb/s In    0.25 Mb/s Out -    315.7 p/s In    316.0 p/s Out
  eth1:    2.31 Mb/s In    0.00 Mb/s Out -    297.4 p/s In      0.0 p/s Out
total:    2.63 Mb/s In    0.24 Mb/s Out -    607.8 p/s In    304.6 p/s Out
  eth0:    0.24 Mb/s In    0.24 Mb/s Out -    305.1 p/s In    304.6 p/s Out
  eth1:    2.39 Mb/s In    0.00 Mb/s Out -    302.7 p/s In      0.0 p/s Out
total:    2.86 Mb/s In    0.21 Mb/s Out -    605.2 p/s In    270.4 p/s Out
  eth0:    0.21 Mb/s In    0.21 Mb/s Out -    270.7 p/s In    270.4 p/s Out
  eth1:    2.65 Mb/s In    0.00 Mb/s Out -    334.5 p/s In      0.0 p/s Out


ludwig W 11-07-2005 02:44 PM

kewl....thanks fur!!!!!!!!!!!!!:D :D :D :D :D

I'll give it a shot............

ludwig W 11-07-2005 03:02 PM

fur,
thanks mate.
It works a treat!!!!!!


All times are GMT -5. The time now is 09:33 PM.