Introduction
This tutorial will guide you through installing and using three command-line tools for network monitoring, which help identify which programs are using bandwidth. We will use Ubuntu 16.04 for this tutorial, but the instructions should work for other Debian and Ubuntu distributions available on VPS Sell.
Update System
First, update your server with:
apt-get update
nethogs
nethogs
is an open-source command-line tool for monitoring real-time network traffic bandwidth used by each process or application.
Installation
To install nethogs
, run:
apt-get install nethogs
Usage
To start nethogs
, use:
nethogs
nethogs
will display the amount of traffic being used by each process, with total sent and received bandwidth at the bottom. You can use the following commands within nethogs
:
m
: Toggle between "kb/s", "kb", "b", and "mb" display units.
r
: Sort by received traffic.
s
: Sort by sent traffic.
q
: Quit the program.
IPTraf
IPTraf
is a powerful tool for monitoring network traffic with various interactive interfaces.
Installation
To install IPTraf
on Ubuntu, run:
apt-get install iptraf
Usage
Start IPTraf
with:
iptraf
You will see a menu allowing you to select the network interface you want to monitor. For a comprehensive view of all network traffic, select "All interfaces" from the first menu. You can enable reverse DNS lookups and service names by going to the "Configure" menu and adjusting the settings accordingly.
netstat
netstat
(network statistics) is a command-line utility that displays network connections, routing tables, and network interface statistics.
Usage
To list open sockets, use:
netstat
For a more detailed output, including listening ports and the processes using them, run:
netstat -nltp
Explore additional options with:
netstat --help
man netstat