Glances: Installation and autostarting on Linux

  • Post author:
  • Post category:Other

Glances is a cross-platform system monitoring tool that is possible to install on most operating systems, it is free and it has a open API.

This is a simple guide on how to install it and make it start as a web-server on boot.
I have myself tested these steps on multiple Raspberry Pi’s with Raspbian Buster, but you should be able to install Glances on most Linux systems with the same steps.

Installation

Run the install-script by running this command from CLI on the system:

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

For slow systems (like Raspberry Pi) this can take a long time. Specially "Running setup.py bdist_wheel for cassandra-driver … \” is slow, this can take hours. Be patient.

After installation start the web interface by typing:

glances -w

Create a auto-start service file by typing:

sudo nano /etc/systemd/system/glances.service

Nano will start, paste in the following:

[Unit]
Description=Glances
After=network.target

[Service]
ExecStart=/usr/local/bin/glances -w
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Press CTRL+X to exit and Y to save. Press Enter to Confirm file/location.
Next step is to create a symlink by typing:

 sudo systemctl enable glances.service

The respons should be Created symlink /etc/systemd/system/multi-user.target.wants/glances.service → /etc/systemd/system/glances.service.

Start the service with:

sudo systemctl start glances.service

Done.

SOURCES

Share