How to install Glances on CentOS 7?

0
450
glance
glance

We already know that monitoring your server is something basic like sysadmin. But it is not only limited to those professionals in server administration but we can do it ourselves. For it, they count on diverse light tools and open source that, they help us with it. In addition, we like monitoring because it helps to be attentive to any eventuality that arises in the computer. So, that’s why today I’ll show you how to install Glances on CentOS 7.

Glances is a cross-platform system monitoring tool written in Python. Glances helps us keep an eye on our system, just the website project says.

Among its main features, we have that it is possible to choose to display system information on the terminal or remotely through a web interface. It also has an API that allows third-party applications to use Glances.

Some of the parameters that Glance allows you to monitor are there:

  • CPU.
  • Memory.
  • Load.
  • Process list.
  • Network interface.
  • Disk I/O.
  • IRQ / Raid.
  • Sensors.
  • Filesystem (and folders).
  • Docker.

As you can see, the information you can get by using it is varied. So, let’s install Glances.

1. Check the Python version

In this first step, you must verify which version of python your CentOS 7 system has. This is because Glances requires at least Python 2.7 or Python 3.4. So run this command:

:~$ su
:~# python -version
1.- Check the python version
1.- Check the python version

At the moment I’m using CentOS 7 and I’ve always updated it. However, in case you don’t have a valid version of python, you can use this tutorial.

So, let’s continue.

2. Install Glances on CentOS 7

Now it’s the turn to install Glances. We have several ways to do this. Both are very easy so I’ll tell you how it is.

The first way to install Glances is to do it through the auto install script. To do this, you can use CURL or wget to download the script and run it with bash.

:~# curl -L https://bit.ly/glances | /bin/bash

or

:~# wget -O- https://bit.ly/glances | /bin/bash

It’s really simple and this method guarantees you to have the last version ready for production, i.e. the master branch.

However, we are using CentOS 7 and that means stability, right? then we are going to install the latest stable version of Glances and for that, I will use pip.

:~# yum install python-devel
2.- Installing some required packages
2.- Installing some required packages

Then, install pip from the EPEL repository.

:~# yum install epel-release
3.- Enabling the EPEL repository
3.- Enabling the EPEL repository

Now, install pip.

4.- Install python-pip
4.- Install python-pip

Now, upgrade pip.

:~# pip install --upgrade pip

When the installation is finished, it is necessary to install gcc.

:~# yum install gcc
5.- install gcc
5.- install gcc

Next, install psutil using pip.

:~# pip install psutil
6.- Install psutil
6.- Install psutil

Finally, install glances.

:~# pip installa glances
7.- Install glances using pip
7.- Install glances using pip

If you want to use additional libraries to enable other features of glans, you can use this command as well.

:~# pip install glances[action,browser,cloud,cpuinfo,chart,docker,export,folders,gpu,ip,raid,snmp,web,wifi]
8.- Installing other packages
8.- Installing other packages

And that’s it.

3. Using Glances

Now let’s use it. Execute the command glances to initialize the monitoring locally.

:~# glances
9.- Glances
9.- Glances

If you are running glances in a server, you can run.

:~# glances -s

 

10.- Running glances in a server mode
10.- Running glances in a server modeReplace IP for the server IP.

In the client machine, just run.

 

:~# glances -c IP

Finally, if you nat to use the web interface run on the server.

:~# glances -w
11.- Running Glances to allow web interface
11.- Running Glances to allow web interface

On the client machine, open the web browser and go to http://IP_SERVER:61208.

12.- Glances in a web browser
12.- Glances in a web browser

Of course, don’t forget to add the rules to the firewall to open the glances port.

:~# firewall-cmd --zone=public --add-port=61208/tcp --permanent
:~# firewall-cmd --reload
13.- Open the glances port
13.- Open the glances port

And that’s it.

Conclusion

Glances is a pretty good tool to monitor your CentOS 7 server. It is built in Python and its memory consumption is quite efficient. Its installation in CentOS is something simple for a user accustomed to terminal commands.

Please share this article in your social networks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here