Top commands to monitor CentOS 7 server

Monitoring of your CentOS installation is one of key tasks for every system administrator. They should know how to maintain their VPS systems, dedicated servers to avoid any issues. Below we will discuss top commands to monitor CentOS.


The tools have different mechanisms of generating the traffic report. Some of the tools like nload read the ‘/proc/net/dev’ file to get traffic stats, whereas some tools use the ‘pcap’ library to capture all packets and then calculate the total size to estimate the traffic load.

iftop

Command iftop provides a real time monitoring of network bandwidth besides your server. It helps us measure the total data moving -in and -out in connections. ‘iftop’ measures the data flowing through individual socket connections, and it works in a manner that is different from other utilities. ‘iftop’ uses the ‘pcap’ library to capture the packets moving in and out of the network adapter, and then sums up the size and count to find the total bandwidth under use.

# yum install iftop

After installing ‘iftop’ you may start monitoring simply enter:

# iftop

tcptrack

Command ‘tcptrack’ is very close to ‘iftop’ command, it captures packets and calculate network bandwidth for each tcp connection. It also supports the standard ‘pcap’ filters that can be used to monitor specific connections.

# yum install tcptrack

After installing ‘tcptrack’ start using it and get the network stats by running the following command:

# tcptrack

nload

Command ‘nload’ is used to get information regarding incoming and outgoing traffic of the server. Instead of ‘iftop’ and ‘tcptrack’ it produces a graph statistics and indicates the incoming as well as outgoing traffic. It also draws out a graph to indicate the same, the scale of which can be adjusted. Easy and simple to use, and does not support many options.

# yum install nload

After installing ‘nload’ start using it by running the following command:

# nload

iptraf

Command ‘iptraf’ is a very useful network monitoring tool. Utility ‘iptraf’ provides a colorful and interactive list of traffic going -in and -out (IP LAN monitor). This produces a list with all hosts and traffic counters.

# yum install iptraf-ng

After installing ‘iptraf’ start using it by entering in console the following command:

# iptraf

netdiag

Netdiag is a collection of network diagnostics tools and commands (netwatch, trafshow, netload commands) are all part of it. You need to install a netdiag package to get all these commands.

# yum install netdiag

After installing ‘netdiag’ start using it by entering in console the following command:

# 

bmon

Command ‘bmon’ (Bandwidth Monitor) is a tool similar to ‘nload’ that shows the traffic load over all the network interfaces on the system. The output also consists of a graph and a section with packet level details. CentOS users need to setup repoforge, since its not available in EPEL.

# yum install bmon

slurm

Slurm is ‘yet’ another network load monitor that shows device statistics along with an ascii graph. It supports 3 different styles of graphs each of which can be activated using the c, s and l keys. Simple in features, slurm does not display any further details about the network load.

# yum install slurm -y

After installing ‘slurm’ start using it by running command and interface, example:

$ slurm -s -i eth0

EPEL Repo setup

Packages for some of the commands mentioned here are available for EPEL repository. The command to install EPEL repo on your system is mentioned below. Use the one that suits your system architecture,

RHEL/CentOS 7

$ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

Looking for a custom solution?

Our technicians can provide you with the best custom made solutions on the market, no matter whether you're a small business or large enterprise.

Get in touch