Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a linux vps server and I want to see the current network connections and upload/download rate of each one. Is there any simple command that fulfill this purpose?

share|improve this question
    
No there isn't. You would need to install something like a netflow collector such as ntop. – Paul Jun 23 '12 at 22:38
up vote 5 down vote accepted

There are many tools available, although you will have to install a network monitoring system to get per-process bandwidth information.

In order of setup ease:

A simple package that does not require a lot of setup is iftop. This will show you bandwidth per process. iftop screenshot This is probably what you want, if you want a simple real-time solution.

  • To just get per-interface bandwidth, bwm-ng is a small package that shows you real-time usage per interface.
  • netstat will list your open connections, and should already be present on most systems
  • ntop is a very useful tool for system monitoring, that can also monitor per-process TCP connections, IF you install a kernel module to support network monitoring.
  • Gacti, nagios, ntop and ganglia are several more heavy weight systems that can do network monitoring per host/system/service/protocol/etc depending on setup for one server to an entire enterprise network. See mediawiki server monitoring for a real-life example of ganglia in action.
share|improve this answer
    
Thanks , that's it ! – isoman Jun 23 '12 at 23:53

real time usage continuous polling in 5 seconds interval using native netstat

netstat --interfaces=eth0 -c 5

Kernel Interface table

Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg

eth0 1500 0 601670041 0 0 0 290653338 0 0 0 BMRU

eth0 1500 0 601796657 0 0 0 290721761 0 0 0 BMRU

using awk you can just watch a particular field that you are interested, below example you'll just watch for 2 RX and TX columns show how many packets have been received or transmitted error-free (RX-OK/TX-OK)

netstat --interfaces=eth0 -c 5 |awk '{ print $4 "\t" $8 }'

RX-OK TX-OK

605142559 292429624

605142595 292429661

share|improve this answer

I'm using iptraf for that.

Regards,

http://catcher.hdcs.cz

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .