CentOS 7 – Introducing the Linux system and network monitoring tools

Installing an FTP server

In the final section of our chapter, we are going to present a number of very useful tools to monitor both systems and networks for our CentOS 7 server.

We will start by showing some system monitoring tools. We believe that most of these tools need the EPEL repository installed, so we can just install it before trying to install any of those tools:


$ sudo yum install epel-release

The first tool that we are going to talk about is Htop. It is kind of the same as the old top command, but it has a very user-friendly interface, wherein it is much more interactive with many shortcuts, a graphical colored presentation of the process, and the CPU, Memory, and SWAP Memory in a bar shaped way, to show how much of those are used. To install Htop, we just need to use Yum:


$ sudo yum install htop

And to run it, we simply need to type htop. There is no configuration needed:


$ htop

We should see this kind of interface:

The second system-monitoring tool on the list is Iotop. It does look like the old top command, but it specializes in showing the system available disk input and output access in real time. It shows each process activity, and how much it is using the hard disk (read/write speed and actual usage). To install it, we need to use YUM again, but usually it is installed on most CentOS 7 servers by default:


$ sudo yum install ioptop

To use it we need to type the name:


$ ioptop

We will have the following interface:

Just before going to the network monitoring tools, we should take a quick look at this tool that performs monitoring for both systems and networks. Monitorix is an open source, lightweight monitoring tool for systems and network monitoring. It collects system and network activities on a regular basis in order to show them in a well-presented graph through a web-based interface. It is very helpful for detecting bottlenecks and system failures for better management.

To install Monitorix, we need to install a few necessary packages first:


$ sudo yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI perl-DBI perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple

Then we install Monitorix:


$ sudo yum install monitorix

It is kind of a service, so we need to start it and enable it for the login service startup:


$ sudo systemctl start monitorix
$ sudo systemctl enable monitorix

We may need to disable SELinux or set it to permissive to make our service work fine. In addition, since Monitorix serves at port 8080, we need to open that at the firewall, as follows:


$ sudo firewall-cmd --permanent --zone=public —add-port=8080/tcp
$ sudo firewall-cmd --reload

Then we can start using it by using a browser. We type the following at the address section:


http://Server_IP_address:8080/monitorix

Thus, we will have the following interface:

We will get to see a variety of graphs for multiple pieces of information, as follows:

This was about system load average usage and the next one is about the network status:

Now, let’s talk about some useful network monitoring tools. We will first talk about Netstat, which is one of the most common tools for monitoring a network’s incoming and outgoing traffic. It is very useful for network troubleshooting. It is usually installed on the system, so we only need to execute it:


$ netstat -a

Then we will have this kind of output:

After this, we have IPTraf, which is a real-time network-monitoring tool. It gathers information about network traffic activity, such as TCP, UDP, IP, and ICMP statistics, and then presents them in its interface. To install it, we need to use YUM:


$ sudo yum install iptraf

Then we just type its name to run it.

Finally, there is IfTop, which is an open source tool that reports network activities in real time. It is very useful for troubleshooting connections with outside servers, since it uses the Pcap library to capture incoming and outgoing packages on the desired network interface. To install it, we use yum again:


$ sudo yum install iptop

Then, to use it, we need to type the command with the desired interface to listen to:


$ sudo iptop -i eth0

Comments are closed.