Real Time Linux server monitoring with GLANCES monitoring tool
Last updated on June 5th, 2018 at 02:48 pm
Glances is an open source real time Linux monitoring system that aims at providing as much as information possible in as minimum as space possible. Glances is like top command but more refined with many more features & much more real time information of your Linux system. Glances provide information regarding memory, CPU, Disk IO , file system, Uptime, processes, interfaces, alerts & many other system information.
One of the best features of Glances is that it can work in server/client mode. We can perform remote monitoring of the systems using a Web interface or through terminal/CLI & we can also export stats to a file.
In this tutorial, we are going to discuss the installation of glances monitoring tool on CentOS/RHEL as well Ubuntu machines & also how to use it monitor our systems.
(Recommended Read: Complete guide to install Zabbix on CentOS7 )
Glances is written in python, so it requires that we have python installed on machines. If its not installed, we can install it using the following command,
$ sudo yum install python python-devel
$ sudo apt-get install python python-dev
Also read our detailed article on How to install python 3.6 on Linux machines.
Installation of Glances monitoring
There are three ways with which we can install glances on CentOS/RHEL & Ubuntu systems. Either using system repositories or we can use pip (python package manager) or we can also use an official script for installation. PIP method & official script method is same on both Ubuntu & CentOS/RHEL.
Its recommended that we either use PIP or Official script to install Glances as repositories might hold older versions but none the less, let’s discuss all methods one by one…
On CentOS, glances packages are available with the EPEL repository. Install EPEL repository with the following command on your machine,
$ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
RHEL/CentOS 6 (64 Bit)
$ sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
RHEL/CentOS 6 (32 Bit)
$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Once installed, run the following command to install glances tool,
$ sudo yum install glances
This will install glances tool on your machine.
Glances is available with the default Ubuntu repositories, so we can install glances easily on Ubuntu systems with the following command,
$ sudo apt-get install glances
Installation of Glances monitoring tool using PIP
If you have PIP installed on your system, than install glances on both CentOS/RHEL & Ubuntu systems using the following command,
$ pip install glances
If you don’t have PIP installed on your machine, read our detailed article on How to install PIP on Linux systems.
Installation of Glances monitoring tool using the Official script
This is another way with which we can install the latest version of glances on our CentOS/RHEL & Ubuntu systems. Open terminal & execute the following command,
$ sudo curl -L https://bit.ly/glances | /bin/bash
This will automatically install the glances on our system. We can also use following command in place of the one mentioned above, both achieve the same goal,
$ sudo wget -O- https://bit.ly/glances | /bin/bash
Using Glances in standalone mode
Once the glances tool has been installed on our machine, we can use it by opening the terminal & running the following command,
Running Glances remotely
To remotely monitor the server from another machine, open terminal & run the following command,
$ glances -s
you should get the following output
Glances server is running on 0.0.0.0:61209
Now open the remote machine from where you want to monitor the server & run the following command from the terminal,
$ glances -c 192.168.1.100
where 192.168.1.100 is IP address of the server to be monitored.
Running Glances in Web server mode
To start the Glances in webserver mode, execute the following command from terminal,
$ glances -w
Once done, open the web browser & enter the following URL to access the Glances monitoring using web browser,
This will open the glances monitoring page for our server.
This was our tutorial on Installation of Glances tool on CentOS/RHEL machines. Please do leave your comments/questions in the comment box below.