Post

Glances for Homelab Monitoring

I’ve been looking at how I can monitor my Proxmox host’s status without having to look at the web-gui every time. Because of the issues I previously had issues with my Dashy install files via Portainer, it lead me to learning about Glances which is an open-source monitoring tool that Dashy widgets use to present info about your system.

I was able to reference this video along with the documentation on the Glances website.
The setup is fairly simple in Linux: If you don’t have PyPI installed, you would need to first install that on the machine via

1
sudo apt install python3 python3-pip

If you have PyPI, then you can install it by using

1
2
3
pip3 install glances
pip3 install bottle
pip3 install fastapi

or

1
pip3 install glances[all]

either or should work, but I did the first method because of an issue I ran into with my initial install.
I ran into an issue where it wouldn’t allow me to install it only using that command, I had to put --break-system-packages at the end of each line to bypass the restriction.

Next to run Glances as a constant web service, I used

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

to create a glances service file for the machine to run in case of a restart.
Inside that file you want to paste this text:

1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description = Glances in Web Server Mode
After = network.target

[Service]
ExecStart = /usr/local/bin/glances -w
Restart = always
RemainAfterExit = no

[Install]
WantedBy = multi-user.target

Because I am installing this on my entire Proxmox machine via the root user, my filepath is /usr/local/bin/glances, but yours may be different.
In that case you can do

1
which glances

to find the path you need to use instead.
I believe you would also have to add a line within the [Service] section that says User = nameofuser

After that you can start up Glances via.

1
2
3
sudo systemctl start glances.service
sudo systemctl enable glances.service
sudo systemctl status glances.service

and you should see Active: Running after the status command.
It will now be hosted as a internal website that you can access via: localhost:61208 or replace localhost with the ip of the machine it was installed on.

I was able to use an old iPhone 7 to run as a sort of quick-access screen to monitor
IMG_5822 (002)

This post is licensed under CC BY 4.0 by the author.