Monitoring Tools for Linux System

Posted By : Aquib Ahamad | 10-Sep-2020

Glances – A Versatile System Monitoring Tools for Linux System

 

Glances is a system monitoring tool which ties them all togethers and offer a lots of more features. What I likes the most is that you can use run Glances on a remote Linux servers and monitors the systems resources on your local system or monitors it through your web browser.

 

 

 

>You can also integrates it to a tool like Grafana to monitor the stats in an intuitive dashboard.

It is written in Python which mean that it can be used on most platforms with almost all feature.

 

You may also be interested in reading Installing Hadoop 3.2.1 On Ubuntu 16.04

 

Let’s have a quick glance over the main features Glance provide (pun intended).

• Can monitors 15+ metrics on a systems (including docker container).

• Flexible usages modes standalone, client-server, over SSH and web mode.

• Versatile REST API and XML-RPC available for integration

• Readily supports exporting data to differents services and databases.

• Highly configurable and adaptables to different needs.

• Very comprehensive Documentation.

• Installing Glances on Ubuntu and other Linux distributions

Glances is available in the officials repositories of many Linux distributions. This means you can use your distribution’s package managers to install it easily.

On Debian/Ubuntu based distributions, you can use the followings commands

 

#sudo apt install glance

 

You can also install the latest Glance using snap package

 

#sudo snap install glances.

 

• Since Glances is based on Python, you can also use PIP to install it on most Linux distributions. Install PIP first and then uses it to install Glances

 

# sudo pip3 install glances

 

if nothing else, you can always use the auto install scripts provided by Glances developer. Though we at It’s foss don’t recommend running randoms script directly on your systems. It’s entirely your decision.

 

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

 

You can check out other way to install Glances from their documentations, you can also install through docker containers.

Using Glances to monitors Linux system resources on local systems (standalone mode)

You can easily launch Glances to monitors your local machine by running this command n the terminal.

 

#Glances

 

you can instantly observe that it integrates a lot of different information in one single screens. I like that it shows the public and private IP’s of the computer right at the top.

 

 

 

Glances is also interactive, meaning you can use command to interact with it while it is runnings. You can press “s” to bring up the sensor onto the screen; “k” to bring up the TCP connection list; “1” to expands the CPU stats to show individual thread.

You can also use the arrows keys to move around the lists of processes and sorts the tables by different metrics.

Using Glances to monitors remote Linux systems (Client – Server modes)

To monitors a remote computer you can use Glances in client-server mode. You need to have Glances installed in both system.

On the remote Linux systems, you’ll have to launch glances in server mode using the -s options

 

#glances -s

 

On the client system, use this command to launch Glances in client mode and connect to the servers.

 

#glances -c server_ip_address

 

Monitor Linux system resources in web browser usings Glances (Web Modes)

Glances can also run in web modes. This means that you can use web browsers to access Glances. Unlike the previous client-servers mode, you don’t need to install Glances on the client systems.

To start Glances in web mode, use the -w options

 

#glances -w

 

Keeps in mind that it may display “Glances Web User Interface started on http://0.0.0.0:61208” even on a Linux server when it is actually using the server IP address.

The web mode also emulates the terminal looks. The web versions is builts with responsive designs principles in minds and looks good even on phones.

You may want to protects the web modes with a password so that only authorized people can use it. The default username is glances.

 

root@localhost:~# glances -w –password

 

Defines the Glances webserver password (glances username)

Password (confirm)

Do you want to save the password ? [Yes/No]: n

Glances Web User Interface started on http://0.0.0.0:61208/

Export Glances data to differents service

One of the biggest advantages of using Glances is the out of the box supports to exports the data to various databases, services and integration into various data pipelines seamlessly.

You can export to CSV while monitoring with this commands.

glances --export csv --export-csv-file /tmp/glances.csv

Use REST API to integrates Glances with other services.

This is my favorite feature in the whole stacks. Glances is not only bring togethers various metrics together, it also expose them via APIs.

This simple yet powerful features make it very easy to builds custom application, services and middleware application for any specific use cases.

REST API server starts automatically when you launch Glances in web mode. To launch it in API server only mode you can use the followings commands.

 

#glances -w –disable-webui

 

The REST-API documentations is comprehensive and the response are easy to integrate with a web applications. This makes it easy to build a unified dashboard to monitors multiples servers with a tool like Node-RED.

 

We are a software development company that provides end-to-end web and mobile app development solutions for cross-industry use cases. Explore our SaaS app development services here. For more more detail, contact us at [email protected].

About Author

Author Image
Aquib Ahamad

He has good knowledge of RHCSA and RHCE and Aws git and bigdata. He is a quick learner who is always looking to learn new technologies

Request for Proposal

Name is required

Comment is required

Sending message..