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
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
Then, install pip from the EPEL repository.
:~# yum install epel-release
Now, install pip.
Now, upgrade pip.
:~# pip install --upgrade pip
When the installation is finished, it is necessary to install gcc.
:~# yum install gcc
Next, install psutil using pip.
:~# pip install psutil
Finally, install glances.
:~# pip installa glances
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]
And that’s it.
3. Using Glances
Now let’s use it. Execute the command glances
to initialize the monitoring locally.
:~# glances
If you are running glances in a server, you can run.
:~# glances -s
In the client machine, just run.
:~# glances -c IP
Finally, if you nat to use the web interface run on the server.
:~# glances -w
On the client machine, open the web browser and go to http://IP_SERVER:61208.
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
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.