Monitor network traffic and bandwidth usage in cent os

Information TechnologyLinux

Generally, system administrators check the performance problems and related issues using various monitoring tools. nload is one of the most useful app to monitor network throughput on the command line interface. It is a console application which monitors network traffic and bandwidth usage in real time. It visualizes the traffic using two graphs and provides additional info like total amount of transferred data and min/max network usage.

This article describes “how to monitor network traffic and bandwidth usage in Cent OS”.

Installing nload

Before installing nload on Cent OS, EPEL package is required and it should be enabled by default.

To install EPEL package, use the following command –

# sudo yum install epel-release

The sample output should be like this –

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.iitm.ac.in
* elrepo: mirrors.ircam.fr
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-5 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package       Arch       Version       Repository       Size
================================================================================
Installing:
epel-release noarch       7-5          extras          14 k
Transaction Summary
================================================================================
Install 1 Package

To install nload, use the following command –

# yum -y install nload

The sample output should be like this –

Loaded plugins: fastestmirror, langpacks
epel/x86_64/metalink           | 3.7 kB 00:00
epel                             | 4.3 kB 00:00
(1/3): epel/x86_64/group_gz      | 169 kB 00:01
(2/3): epel/x86_64/updateinfo    | 498 kB 00:02
(3/3): epel/x86_64/primary_db    | 3.9 MB 00:06
Loading mirror speeds from cached hostfile
* base: ftp.iitm.ac.in
* elrepo: mirrors.ircam.fr
* epel: mirrors.hustunique.com
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
Resolving Dependencies
--> Running transaction check
---> Package nload.x86_64 0:0.7.4-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package       Arch       Version       Repository       Size
================================================================================
Installing:
nload       x86_64       0.7.4-4.el7       epel          70 k
Transaction Summary
================================================================================
Install 1 Package

Using nload to Display the Current Network Usage

To see network stats, use the following command –

# nload

The sample output should be like this –

Incoming:
   Curr: 624.00 Bit/s
   Avg: 4.67 kBit/s
   Min: 0.00 Bit/s
   Max: 45.31 kBit/s
   Ttl: 125.73 MByte
Outgoing:
   Curr: 552.00 Bit/s
   Avg: 9.45 kBit/s
   Min: 0.00 Bit/s
   Max: 98.27 kBit/s
   Ttl: 12.92 MByte

Controlling nload App

To control nload command, use the following options –

  • You can switch between the devices by pressing the left and right arrow keys or Enter/Tab key
  • Press F2 to show the option window
  • Press F5 to save current settings to the user’s config file
  • Press F6 reload settings from the config files
  • Press q or hit Ctrl+C to quit nload

Setting the Refresh Interval of the Display

To set refresh interval of the display, use the following command –

# nload -t 500

Using above command, it will refresh the network monitoring display for every 500 milli seconds.

If you want to store log information, use the following commands –

mkdir logs
cd logs
nload -t 500 | tee graph.log

In the above command, it stores the logs for every 500 milliseconds. Congratulations! Now, you know “How to Monitor Network Traffic and Bandwidth Usage In Cent OS”. We’ll learn more about these types of commands in our next Linux post. Keep reading!

raja
Published on 21-Oct-2019 12:25:27
Advertisements