Real Time Linux Server monitoring with GLANCES

Glances is an open source real time Linux server 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 for real time Linux server monitoring of our system.

Recommended Read: Complete guide to install Zabbix on CentOS7

Also Read: Easy guide to setup Nagios monitoring using SSH (check_by_ssh)

Prerequisites

On CentOS

$ sudo yum install python python-devel

On Ubuntu

$ 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

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…

CentOS/RHEL installation

RHEL/CentOS 8

$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

RHEL/CentOS 7

$ 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.

Ubuntu Installation

$ sudo apt-get install glances

Installation of Glances monitoring tool using PIP

$ 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

$ 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

$ glances

Running Glances remotely

$ 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

$ glances -w

Once done, open the web browser & enter the following URL to access the Glances monitoring using web browser,

http://192.168.1.100:61208

This will open the glances monitoring page for our server.

This was our tutorial on Installation of Glances tool on CentOS/RHEL machines which is used as a real time Linux server monitoring tool. Please do leave your comments/questions in the comment box below.

http://linuxtechlab.com is a beginner friendly website where you can learn Linux Tips & tricks,Scripting, also has lots of tutorials aimed at making Linux easy.