Difference between revisions of "Monitoring bandwidth and traffic"

From Pulsed Media Wiki
(Created page with "== Bandwidth and Traffic Monitoring on Debian Servers == Monitoring bandwidth and network traffic is essential for both dedicated servers and virtual private servers (VPS) to...")
 
 
Line 1: Line 1:
 
== Bandwidth and Traffic Monitoring on Debian Servers ==
 
== Bandwidth and Traffic Monitoring on Debian Servers ==
  
Monitoring bandwidth and network traffic is essential for both dedicated servers and virtual private servers (VPS) to maintain performance, detect abuse, and track usage trends. Debian-based Linux distributions support a wide variety of tools for this purpose, including command-line utilities and web-based dashboards.
+
Monitoring [[Bandwidth (computing)|bandwidth]] and [[Network traffic|network traffic]] is a critical aspect of managing both [[Dedicated server|dedicated servers]] and [[Virtual Private Server|virtual private servers]] ([[Virtual Private Server|VPS]]). Effective monitoring allows administrators to maintain [[Performance (computing)|performance]], identify unusual activity that might indicate [[Computer security|security]] issues or abuse, track usage trends for capacity planning, and understand how different [[Process (computing)|processes]] or users consume [[Network traffic|network resources]]. Debian-based [[Linux]] [[Operating system|operating systems]] (like Debian, Ubuntu, and others) offer a wide variety of tools for this purpose, ranging from simple [[Command-line interface|command-line interface]] ([[Command-line interface|CLI]]) utilities to comprehensive [[Web interface|web-based dashboards]].
  
 
=== Prerequisites ===
 
=== Prerequisites ===
  
Before using bandwidth monitoring tools, ensure that the system is up to date and essential packages are installed. Root or sudo access is required.
+
Before installing and using bandwidth monitoring tools, it's essential to ensure your [[Debian]] or Debian-based system is up to date. This ensures you have the latest package lists and necessary dependencies. [[Root access|Root]] or [[Sudo (software)|sudo]] access is required to install [[Software|software]] packages.
  
<syntaxhighlight lang="bash">
+
Update the package list and install some essential tools often needed for downloading and managing other [[Software|software]]:
sudo apt update && sudo apt install wget curl tar unzip -y
+
 
</syntaxhighlight>
+
  sudo [[APT (software)|apt]] update && sudo [[APT (software)|apt]] install [[wget|wget]] [[cURL|curl]] tar unzip -y
  
 
=== Tools Overview ===
 
=== Tools Overview ===
 +
 +
Choosing the right tool depends on your needs – whether you require a quick real-time view, historical data logging, or a comprehensive system dashboard.
  
 
{| class="wikitable"
 
{| class="wikitable"
! Tool !! Interface Type !! Features !! Suitable For
+
! Tool !! Interface Type !! Key Focus !! Suitable For
 +
|-
 +
| vnStat || [[Command-line interface|CLI]] || Historical [[Bandwidth (computing)|bandwidth]] usage logging (daily, monthly) || Tracking long-term usage trends, simple reports
 
|-
 
|-
| vnStat || Command-line || Lightweight bandwidth logging by day/month || General monitoring
+
| iftop || [[Command-line interface|CLI]] (real-time) || Real-time [[Network traffic|traffic]] flow by connection (source/destination [[IP address|IP]]) || Live observation of active connections and their usage
 
|-
 
|-
| iftop || Command-line (real-time) || Real-time traffic by connection/IP || Live traffic observation
+
| nload || [[Command-line interface|CLI]] (graphical) || Simple real-time graphical view of total in/out [[Bandwidth (computing)|bandwidth]] || Quick visual check of current load
 
|-
 
|-
| nload || Command-line (graphical) || Real-time graphical network usage || Visual terminal output
+
| bmon || [[Command-line interface|CLI]] (graphical) || Detailed real-time [[Bandwidth (computing)|bandwidth]] and [[Network traffic|traffic]] statistics per [[Interface (computing)|interface]] || Network debugging, viewing stats across multiple interfaces
 
|-
 
|-
| bmon || Command-line (graphical) || Graphs for all interfaces || Network debugging
+
| Netdata || [[Web interface|Web-based dashboard]] || Comprehensive real-time system and [[Bandwidth (computing)|bandwidth]] monitoring || Beginner-friendly [[Graphical user interface|GUI]] overview, detailed metrics across system
 
|-
 
|-
| Netdata || Web-based dashboard || Full system and bandwidth monitoring || Beginner-friendly GUI
+
| nethogs || [[Command-line interface|CLI]] || Real-time [[Network traffic|traffic]] usage per [[Process (computing)|process]] or user || Identifying which applications/users are using [[Bandwidth (computing)|bandwidth]]
 
|}
 
|}
  
 
=== vnStat ===
 
=== vnStat ===
  
vnStat is a lightweight tool that logs bandwidth usage over time.
+
[[vnStat]] is a lightweight [[Network traffic|network traffic]] monitor that logs [[Bandwidth (computing)|bandwidth]] usage data for selected [[Interface (computing)|interfaces]]. It collects data in the background and provides summaries by hour, day, month, or a full history. It does not monitor traffic in real-time on its own but analyzes logs.
 +
 
 +
Installation:
 +
 
 +
  sudo [[APT (software)|apt]] install [[vnStat|vnstat]] -y 
 +
 
 +
After installation, [[vnStat]] needs to be set up for the specific network [[Interface (computing)|interface]] you want to monitor (e.g., `eth0`, `ens3`). Replace `eth0` with your actual [[Interface (computing)|interface]] name.
  
<syntaxhighlight lang="bash">
+
  sudo [[vnStat|vnstat]] -u -i eth0 # Initialize database for the interface 
sudo apt install vnstat -y
+
  sudo [[Systemctl|systemctl]] enable [[vnStat|vnstat]]    # Enable the vnstat service to start on boot 
sudo vnstat -u -i eth0
+
  sudo [[Systemctl|systemctl]] start [[vnStat|vnstat]]    # Start the vnstat service 
sudo systemctl enable vnstat
 
sudo systemctl start vnstat
 
</syntaxhighlight>
 
  
View usage:
+
View usage statistics from the collected data:
  
<syntaxhighlight lang="bash">
+
  [[vnStat|vnstat]]        # Summary of total, daily, and monthly usage for default interface 
vnstat       # Summary
+
  [[vnStat|vnstat]] -d     # Show daily traffic statistics 
vnstat -d     # Daily
+
  [[vnStat|vnstat]] -m     # Show monthly traffic statistics 
vnstat -m     # Monthly
+
  [[vnStat|vnstat]] -h      # Show hourly traffic statistics 
vnstat -l     # Live traffic
+
  [[vnStat|vnstat]] -l     # Show current transfer rates (like a basic live view, but from logs) 
</syntaxhighlight>
+
  [[vnStat|vnstat]] --top 10 # Show top 10 days by traffic
  
 
=== iftop ===
 
=== iftop ===
  
iftop displays real-time bandwidth usage by IP and port.
+
[[iftop]] (interface top) is a real-time [[Bandwidth (computing)|bandwidth]] monitoring tool that displays usage by individual connections. It shows which [[IP address|IP addresses]] your server is sending data to and receiving data from, and at what rate. It's excellent for seeing who is using bandwidth right now.
 +
 
 +
Installation:
  
<syntaxhighlight lang="bash">
+
  sudo [[APT (software)|apt]] install [[iftop|iftop]] -y
sudo apt install iftop -y
 
sudo iftop -i eth0
 
</syntaxhighlight>
 
  
Controls: Use arrow keys and keys such as '''T''', '''P''', and '''S''' to toggle views. Press ''Ctrl+C'' to exit.
+
Run [[iftop]] for a specific network [[Interface (computing)|interface]] (replace `eth0`):
 +
 
 +
  sudo [[iftop|iftop]] -i eth0 
 +
 
 +
[[iftop|iftop]] opens a curses-based interface in your terminal. Controls within [[iftop|iftop]]: Use arrow keys to navigate, press '''T''' to toggle between different display modes (2-line, 1-line, 3-line for each connection), '''P''' to toggle port display, '''S''' to sort by source/destination. Press `Ctrl+C` to exit.
  
 
=== nload ===
 
=== nload ===
  
nload offers a simple terminal-based graphical view of incoming and outgoing traffic.
+
[[nload]] is a simple, real-time command-line tool that provides a graphical (text-based) representation of incoming and outgoing [[Network traffic|traffic]] for a network [[Interface (computing)|interface]]. It's useful for a quick visual check of current network load.
 +
 
 +
Installation:
 +
 
 +
  sudo [[APT (software)|apt]] install [[nload|nload]] -y 
  
<syntaxhighlight lang="bash">
+
Run [[nload]]. By default, it monitors the first detected active [[Interface (computing)|interface]]. Use left/right arrow keys to switch between interfaces if you have multiple.
sudo apt install nload -y
+
 
nload
+
  [[nload|nload]] 
</syntaxhighlight>
+
  # Or specify an interface: 
 +
  # nload eth0 
  
 
=== bmon ===
 
=== bmon ===
  
bmon (Bandwidth Monitor) provides graphical interface per network device.
+
[[bmon]] (Bandwidth Monitor) is a more detailed [[Bandwidth (computing)|bandwidth]] monitoring and shaping utility that provides real-time statistics and a text-based graphical representation for multiple network [[Interface (computing)|interfaces]] simultaneously. It can display various metrics beyond simple throughput.
  
<syntaxhighlight lang="bash">
+
Installation:
sudo apt install bmon -y
+
 
bmon
+
  sudo [[APT (software)|apt]] install [[bmon|bmon]] -y
</syntaxhighlight>
+
 
 +
Run [[bmon]]:
 +
 
 +
  [[bmon|bmon]] 
 +
 
 +
Inside [[bmon|bmon]], you can use arrow keys to navigate between interfaces and different statistics views. Press `?` for help.
  
 
=== Netdata ===
 
=== Netdata ===
  
Netdata is a web-based real-time system and bandwidth monitoring tool.
+
[[Netdata]] is a comprehensive, real-time performance and health monitoring system that provides a user-friendly [[Web interface|web-based dashboard]]. While not solely for [[Bandwidth (computing)|bandwidth]], it includes detailed network traffic monitoring alongside hundreds of other system metrics (CPU usage, RAM, disk I/O, process monitoring, etc.). It's designed to be easy to install and use, providing immediate insights.
 +
 
 +
Installation (using the recommended kickstart script):
 +
 
 +
  bash <([[cURL|curl]] -Ss https://my-netdata.io/kickstart.sh) 
  
<syntaxhighlight lang="bash">
+
The kickstart script guides you through the installation. Once installed, [[Netdata]] typically starts automatically. It also needs to be enabled to restart on boot.
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
 
</syntaxhighlight>
 
  
Once installed, access via browser:
+
Enable and start the [[Netdata]] service:
  
<syntaxhighlight lang="text">
+
  sudo [[Systemctl|systemctl]] enable [[Netdata|netdata]] 
http://your_server_ip:19999
+
  sudo [[Systemctl|systemctl]] start [[Netdata|netdata]] 
</syntaxhighlight>
 
  
Enable and start:
+
Access the [[Netdata]] dashboard via a web browser by navigating to your server's [[IP address|IP address]] on port 19999 (default). You may need to adjust [[Firewall|firewall]] rules to allow access to this port.
  
<syntaxhighlight lang="bash">
+
  http://your_server_ip:19999 
sudo systemctl enable netdata
 
sudo systemctl start netdata
 
</syntaxhighlight>
 
  
 
=== Detecting Network Interfaces ===
 
=== Detecting Network Interfaces ===
  
To find the primary network interface:
+
Many network monitoring tools require you to specify which network [[Interface (computing)|interface]] you want to monitor. To find the names of your active network [[Interface (computing)|interfaces]] on [[Linux]], you can use the `ip` command:
 +
 
 +
  [[IP address|ip]] -brief link show 
 +
 
 +
Look for entries with `UP`. Typical [[Interface (computing)|interface]] names you might see include:
 +
* `eth0`, `eth1`, etc. (Older naming convention)
 +
* `ensX`, `enoX` (Newer predictable network [[Interface (computing)|interface]] names)
 +
* `venet0` (Common in OpenVZ [[Virtual Private Server|VPS]])
 +
* `vethX` (Used with [[Containerization|containers]])
 +
* `lo` (The loopback interface - usually not relevant for external traffic monitoring)
 +
 
 +
Use the name corresponding to your server's primary network connection to the internet.
 +
 
 +
=== Monitoring Per-Process or Per-User Traffic ===
 +
 
 +
Sometimes, you need to know which specific application or user is generating network traffic. [[nethogs]] is a tool that provides a real-time view of [[Network traffic|traffic]] [[Bandwidth (computing)|bandwidth]] usage broken down by [[Process (computing)|process]] or user ID.
  
<syntaxhighlight lang="bash">
+
Installation:
ip -brief link show
 
</syntaxhighlight>
 
  
Typical interface names:
+
  sudo [[APT (software)|apt]] install [[nethogs|nethogs]] -y 
* For VPS: ''eth0'', ''ens3'', ''venet0''
 
* For dedicated servers: ''eno1'', ''ens18''
 
  
=== Monitoring Per-User Traffic ===
+
Run [[nethogs]] for a specific [[Interface (computing)|interface]] (replace `eth0`):
  
To view traffic per user or process, install nethogs:
+
  sudo [[nethogs|nethogs]] eth0 
  
<syntaxhighlight lang="bash">
+
[[nethogs|nethogs]] will show a list of [[Process (computing)|processes]] and their current send/receive [[Bandwidth (computing)|bandwidth]] usage. Press `q` to exit.
sudo apt install nethogs -y
 
sudo nethogs eth0
 
</syntaxhighlight>
 
  
 
=== Daily Email Report (vnStat) ===
 
=== Daily Email Report (vnStat) ===
  
To receive daily bandwidth reports via email:
+
You can configure [[vnStat|vnStat]] to send automated daily or monthly [[Bandwidth (computing)|bandwidth]] reports via email using [[Cron (software)|cron]] and `[[Mailx|mail]]` (or `[[Mailutils|mailutils]]`).
 +
 
 +
1. Install `mailutils` (if you don't have a mail sending utility):
 +
  sudo [[APT (software)|apt]] install [[Mailutils|mailutils]] -y 
  
1. Install mailutils (if not already installed):
+
2. Edit the [[Cron (software)|crontab]] for the [[Root access|root]] user:
<syntaxhighlight lang="bash">
+
  sudo [[Cron (software)|crontab]] -
sudo apt install mailutils -y
 
</syntaxhighlight>
 
  
2. Add cron job:
+
3. Add a line to schedule the report. This example sends a daily report (`vnstat -d`) at 1 minute past midnight (`0 1 * * *`) to `user@example.com`. Replace `user@example.com` with the desired recipient email address.
<syntaxhighlight lang="bash">
 
sudo crontab -e
 
</syntaxhighlight>
 
  
Add the following line:
+
  0 1 * * * [[vnStat|vnStat]] -d | [[Mailx|mail]] -s "Daily Bandwidth Report for YourServerName" user@example.com 
  
<syntaxhighlight lang="bash">
+
You might need to configure your server to be able to send emails for this to work.
0 1 * * * vnstat -d | mail -s "Daily Bandwidth Report" user@example.com
 
</syntaxhighlight>
 
  
 
=== Uninstalling Tools ===
 
=== Uninstalling Tools ===
  
To remove any tool:
+
If you need to remove any of the installed tools, you can do so using [[APT (software)|APT]]:
  
<syntaxhighlight lang="bash">
+
  sudo [[APT (software)|apt]] remove toolname -y 
sudo apt remove toolname -y
+
  # Example: 
</syntaxhighlight>
+
  # sudo apt remove vnstat -y
 +
  # sudo apt remove netdata -y 
  
Example:
+
=== Summary Table ===
  
<syntaxhighlight lang="bash">
+
This table provides a quick recap of the tools covered and their primary function:
sudo apt remove vnstat -y
 
</syntaxhighlight>
 
 
 
=== Summary Table ===
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! Tool !! Command !! Interface Setup !! Function
+
! Tool !! Command to Run !! Typical Interface !! Primary Function
 
|-
 
|-
| vnStat || <code>vnstat</code> || <code>vnstat -u -i eth0</code> || Usage logging
+
| [[vnStat|vnStat]] || <code> [[vnStat|vnStat]]  </code> || [[Command-line interface|CLI]] || Historical Usage Logging
 
|-
 
|-
| iftop || <code>iftop -i eth0</code> || Manual || Real-time traffic view
+
| [[iftop|iftop]] || <code> [[iftop|iftop]] -i eth0   </code> || [[Command-line interface|CLI]] (Interactive) || Real-time Connection Monitoring
 
|-
 
|-
| nload || <code>nload</code> || Automatic || Graphical bandwidth monitor
+
| [[nload|nload]] || <code> [[nload|nload]]  </code> || [[Command-line interface|CLI]] (Graphical) || Simple Real-time Meter
 
|-
 
|-
| bmon || <code>bmon</code> || Automatic || Graphical per-device stats
+
| [[bmon|bmon]] || <code> [[bmon|bmon]]  </code> || [[Command-line interface|CLI]] (Graphical/Interactive) || Detailed Real-time Interface Stats
 
|-
 
|-
| Netdata || Browser access || Automatic || Full system & bandwidth monitor
+
| [[Netdata|Netdata]] || <code>  Access via browser (e.g., http://server_ip:19999)  </code> || [[Web interface|Web UI]] || Comprehensive Real-time System & Network Monitoring
 
|-
 
|-
| nethogs || <code>nethogs eth0</code> || Automatic || Traffic by user/process
+
| [[nethogs|nethogs]] || <code> [[nethogs|nethogs]] eth0   </code> || [[Command-line interface|CLI]] (Interactive) || Real-time Traffic by Process/User
 
|}
 
|}
 +
 +
Monitoring your server's network traffic is an ongoing task. Utilizing these tools can provide valuable insights into how your server is being used and help you diagnose network-related issues or plan for future capacity needs.
 +
 +
[[Category:Linux software]]
 +
[[Category:System administration]]
 +
[[Category:Networking]]
 +
[[Category:Internet protocols]]
 +
[[Category:Server software]]

Latest revision as of 11:07, 24 April 2025

Bandwidth and Traffic Monitoring on Debian Servers

Monitoring bandwidth and network traffic is a critical aspect of managing both dedicated servers and virtual private servers (VPS). Effective monitoring allows administrators to maintain performance, identify unusual activity that might indicate security issues or abuse, track usage trends for capacity planning, and understand how different processes or users consume network resources. Debian-based Linux operating systems (like Debian, Ubuntu, and others) offer a wide variety of tools for this purpose, ranging from simple command-line interface (CLI) utilities to comprehensive web-based dashboards.

Prerequisites

Before installing and using bandwidth monitoring tools, it's essential to ensure your Debian or Debian-based system is up to date. This ensures you have the latest package lists and necessary dependencies. Root or sudo access is required to install software packages.

Update the package list and install some essential tools often needed for downloading and managing other software:

 sudo apt update && sudo apt install wget curl tar unzip -y  

Tools Overview

Choosing the right tool depends on your needs – whether you require a quick real-time view, historical data logging, or a comprehensive system dashboard.

Tool Interface Type Key Focus Suitable For
vnStat CLI Historical bandwidth usage logging (daily, monthly) Tracking long-term usage trends, simple reports
iftop CLI (real-time) Real-time traffic flow by connection (source/destination IP) Live observation of active connections and their usage
nload CLI (graphical) Simple real-time graphical view of total in/out bandwidth Quick visual check of current load
bmon CLI (graphical) Detailed real-time bandwidth and traffic statistics per interface Network debugging, viewing stats across multiple interfaces
Netdata Web-based dashboard Comprehensive real-time system and bandwidth monitoring Beginner-friendly GUI overview, detailed metrics across system
nethogs CLI Real-time traffic usage per process or user Identifying which applications/users are using bandwidth

vnStat

vnStat is a lightweight network traffic monitor that logs bandwidth usage data for selected interfaces. It collects data in the background and provides summaries by hour, day, month, or a full history. It does not monitor traffic in real-time on its own but analyzes logs.

Installation:

 sudo apt install vnstat -y  

After installation, vnStat needs to be set up for the specific network interface you want to monitor (e.g., `eth0`, `ens3`). Replace `eth0` with your actual interface name.

 sudo vnstat -u -i eth0 # Initialize database for the interface  
 sudo systemctl enable vnstat    # Enable the vnstat service to start on boot  
 sudo systemctl start vnstat     # Start the vnstat service  

View usage statistics from the collected data:

 vnstat         # Summary of total, daily, and monthly usage for default interface  
 vnstat -d      # Show daily traffic statistics  
 vnstat -m      # Show monthly traffic statistics  
 vnstat -h      # Show hourly traffic statistics  
 vnstat -l      # Show current transfer rates (like a basic live view, but from logs)  
 vnstat --top 10 # Show top 10 days by traffic  

iftop

iftop (interface top) is a real-time bandwidth monitoring tool that displays usage by individual connections. It shows which IP addresses your server is sending data to and receiving data from, and at what rate. It's excellent for seeing who is using bandwidth right now.

Installation:

 sudo apt install iftop -y  

Run iftop for a specific network interface (replace `eth0`):

 sudo iftop -i eth0  

iftop opens a curses-based interface in your terminal. Controls within iftop: Use arrow keys to navigate, press T to toggle between different display modes (2-line, 1-line, 3-line for each connection), P to toggle port display, S to sort by source/destination. Press `Ctrl+C` to exit.

nload

nload is a simple, real-time command-line tool that provides a graphical (text-based) representation of incoming and outgoing traffic for a network interface. It's useful for a quick visual check of current network load.

Installation:

 sudo apt install nload -y  

Run nload. By default, it monitors the first detected active interface. Use left/right arrow keys to switch between interfaces if you have multiple.

 nload  
 # Or specify an interface:  
 # nload eth0  

bmon

bmon (Bandwidth Monitor) is a more detailed bandwidth monitoring and shaping utility that provides real-time statistics and a text-based graphical representation for multiple network interfaces simultaneously. It can display various metrics beyond simple throughput.

Installation:

 sudo apt install bmon -y  

Run bmon:

 bmon  

Inside bmon, you can use arrow keys to navigate between interfaces and different statistics views. Press `?` for help.

Netdata

Netdata is a comprehensive, real-time performance and health monitoring system that provides a user-friendly web-based dashboard. While not solely for bandwidth, it includes detailed network traffic monitoring alongside hundreds of other system metrics (CPU usage, RAM, disk I/O, process monitoring, etc.). It's designed to be easy to install and use, providing immediate insights.

Installation (using the recommended kickstart script):

 bash <(curl -Ss https://my-netdata.io/kickstart.sh)  

The kickstart script guides you through the installation. Once installed, Netdata typically starts automatically. It also needs to be enabled to restart on boot.

Enable and start the Netdata service:

 sudo systemctl enable netdata  
 sudo systemctl start netdata  

Access the Netdata dashboard via a web browser by navigating to your server's IP address on port 19999 (default). You may need to adjust firewall rules to allow access to this port.

 http://your_server_ip:19999  

Detecting Network Interfaces

Many network monitoring tools require you to specify which network interface you want to monitor. To find the names of your active network interfaces on Linux, you can use the `ip` command:

 ip -brief link show  

Look for entries with `UP`. Typical interface names you might see include:

  • `eth0`, `eth1`, etc. (Older naming convention)
  • `ensX`, `enoX` (Newer predictable network interface names)
  • `venet0` (Common in OpenVZ VPS)
  • `vethX` (Used with containers)
  • `lo` (The loopback interface - usually not relevant for external traffic monitoring)

Use the name corresponding to your server's primary network connection to the internet.

Monitoring Per-Process or Per-User Traffic

Sometimes, you need to know which specific application or user is generating network traffic. nethogs is a tool that provides a real-time view of traffic bandwidth usage broken down by process or user ID.

Installation:

 sudo apt install nethogs -y  

Run nethogs for a specific interface (replace `eth0`):

 sudo nethogs eth0  

nethogs will show a list of processes and their current send/receive bandwidth usage. Press `q` to exit.

Daily Email Report (vnStat)

You can configure vnStat to send automated daily or monthly bandwidth reports via email using cron and `mail` (or `mailutils`).

1. Install `mailutils` (if you don't have a mail sending utility):

 sudo apt install mailutils -y  

2. Edit the crontab for the root user:

 sudo crontab -e  

3. Add a line to schedule the report. This example sends a daily report (`vnstat -d`) at 1 minute past midnight (`0 1 * * *`) to `user@example.com`. Replace `user@example.com` with the desired recipient email address.

 0 1 * * * vnStat -d | mail -s "Daily Bandwidth Report for YourServerName" user@example.com  

You might need to configure your server to be able to send emails for this to work.

Uninstalling Tools

If you need to remove any of the installed tools, you can do so using APT:

 sudo apt remove toolname -y  
 # Example:  
 # sudo apt remove vnstat -y  
 # sudo apt remove netdata -y  

Summary Table

This table provides a quick recap of the tools covered and their primary function:

Tool Command to Run Typical Interface Primary Function
vnStat vnStat CLI Historical Usage Logging
iftop iftop -i eth0 CLI (Interactive) Real-time Connection Monitoring
nload nload CLI (Graphical) Simple Real-time Meter
bmon bmon CLI (Graphical/Interactive) Detailed Real-time Interface Stats
Netdata Access via browser (e.g., http://server_ip:19999) Web UI Comprehensive Real-time System & Network Monitoring
nethogs nethogs eth0 CLI (Interactive) Real-time Traffic by Process/User

Monitoring your server's network traffic is an ongoing task. Utilizing these tools can provide valuable insights into how your server is being used and help you diagnose network-related issues or plan for future capacity needs.