A Better Server Status Monitoring Tool - Glances (htop/top Alternative)

Recently, I’m looking for a temperture and cpu status monitor for my Pi nas server. vcgencmd command and htop get the jobs done, but it’s always better to have them in the same window (htop can’t show temperture which bothers me alot). So I found an cross-platform, python-based htop alternative - Glances, it’s easy to install and super handy. The only downside is that it uses a bit more cpu resources than I expected (on Pi4 4GB version).

Installation

In Linux (Debian, Ubuntu, etc.) you can simply use apt-get to install.

sudo apt-get install glances

If you have Homebrew installed on MacOS, use brew to install.

brew install glances

Note that I have run into some trouble when installing on MacOS, it shows the error message like this:

1
2
3
4
Traceback (most recent call last):
File "/usr/local/Cellar/glances/3.1.3/libexec/bin/glances", line 6, in <module>
from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

After googling, post-install should solved the problem.

brew postinstall python3

Windows need to install python first, and use pip to get glances

pip install glances

Usage

Host mode

Open Terminal and run glances

glances

Show RAW JSON status

glances --stdout cpu.user,mem.used,load

or in CSV format

glances --stdout-csv now,cpu.user,mem.used,load

Enter q or Esc to quit

Server/Client Mode

Server side:

glances -s

Client side (change SERVER-IP to your own server ip):

glances -s SERVER-IP

Remote mode (Web-UI)

Server side:

glances -w

Client side (change SERVER-IP to your own server ip, default port 61208):

http://SERVER-IP:61208

Done! Now you can monitoring all status (including cpu-temperture) in comfort! (Image shows my Pi nas’ status)

Reference

Glances

fails after brew installation: ModuleNotFoundError: No module named ‘pkg_resources’ #260

Using Raspberry Pi to Control a PWM Fan and Monitor its Speed 安裝 Aria2 在 RaspberryPi 上搭建低耗下載機

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×