How to Monitor Various Metrics of Linux Cloud Servers Using the Glances Tool?

21-02-2024 03:04:30

Glances is a command-line system monitoring tool designed to collect system information, enabling the monitoring of metrics such as load, CPU, network, memory, disk, processes, and more. This guide is based on a Linux cloud server and provides instructions on the installation and usage of the Glances tool.

For Ubuntu or Debian operating systems, the installation command is as follows.

apt-get update
apt-get install glances

For CentOS/Fedora operating systems, the installation command is as follows.

yum install -y glances

Running Glances is as simple as entering the glances command.

Glances offer several hotkeys to alter the display format:

  • a - Sort processes automatically
  • c - Sort by CPU usage
  • m - Sort by memory usage
  • p - Sort by name
  • i - Sort by disk usage
  • d - Toggle disk I/O data display
  • f - Toggle filesystem data display
  • n - Toggle network data display
  • s - Toggle sensor data display
  • y - Toggle disk temperature data display
  • l - Toggle warning logs display
  • b - Show network usage in bytes
  • w - Clear warning logs
  • x - Clear warning and critical logs
  • 1 - Display global CPU or per-CPU data
  • t - View combined network usage
  • u - View cumulative network usage

Glances also uses different colors to represent data:

  • Green - Everything is normal
  • Blue - Be cautious
  • Violet - Warning
  • Red - Critical

Glances is a powerful and user-friendly monitoring tool for Linux operating systems, offering a comprehensive display of various system metrics, allowing system administrators to quickly understand the current state of the system.