Kiến Thức Linux Linux Căn Bản

How to Monitor Network Usage with nload in Linux

nload 1

If you are a network administrator then you will need to monitor your network bandwidth usage in day-to-day tasks. In this case, nload will help you to makes your job easier. nload is a command-line utility that can be used to monitor network traffic and bandwidth usage in real time. It visualizes the in-comming and out-going traffic using two graphs and also provides additional information like min/max network usage and total transferred data.

In this tutorial, we will show you how to install and use nload monitoring tool on Linux.

Prerequisites

  • A server running Ubuntu 20.04.
  • A root password is configured the server.

Getting Started

Before starting, update your system packages to the latest version. You can update them using the following command:

apt-get update -y

Once all the packages are updated, you can proceed to the next step.

Install nload

By default, nload is not installed in the Linux. However, it is available in the default repository of all major Linux distributions.

For Ubuntu, you can install nload using the following command:

apt-get install nload -y

For CentOS and RHEL, run the following command to install nload:

dnf install nload -y

After installing nload, you can see all options available with nload using the following command:

nload --help

You should see the following screen:

Working with nload command

Run nload command without any option will start monitoring all network devices.

nload

You should see the following screen:

After running the nload command, you can control the monitoring screen using the following shortcut keys:

  • left and right arrow keys or Enter/Tab used to switch between the devices.
  • F2 key is used to see the option window.
  • F5 key is used to save your current settings.
  • F6 key is used ti load your settings from the config file.
  • q key is used to exit from the nload console.

You can use -m flag with nload command to display all network interfaces at the same time without the graphs.

nload -m

You should see the following screen:

You can use -a flag with nload command to set the length in seconds of the time window for average calculation. By default, it is set to 300.

For example, set the duration to 30 second as shown below:

nload -a 30

You can use -t flag with nload command to sets the refresh interval of the display in milliseconds. By default, it is set to 500 seconds.

For example, set the refresh interval to 200 as shown below:

nload -t 200

You can also define the specific network device with nload command.

For example, to monitor eth0 device use the following command:

nload devices eth0

You can also combine all options in a single command to analyze the network traffic according to our needs.

For example, use the following option to monitor all devices with a time window of 300 seconds and a refresh rate of 600 milliseconds.

nload -m -a 300 -t 600

Conclusion

In this tutorial, you learned how to monitor network traffic using nload command. You also learned how to use different options to monitor the network traffic according to your needs.

 

Đăng ký liền tay Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !

Tags

Add Comment

Click here to post a comment

Đăng ký liền tay
Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !