mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.1K
active users

#glances

0 posts0 participants0 posts today

Few years ago (2019?) it was like:

pip install glances

And voila, I could monitor CPU, disk etc. of my Raspberry remotely via web browser (if my memory servers but it’s probably not).

After I started tinkering AGAIN with my Raspberry PIs after 4 years, I found out things got … complicated. Or I’m just old.

Instead of ONE step, I had to research quite a bit how to enable Glances again. Now it’s like:

  1. Create virtual environment in Python just for Glances (venv something something)
    • sorry, no command here, my RBPI crashed in between and I don’t know how to find the history of commands.
    • probably not needed
    • The official Python docs are great: you have to 1. install venv and then 2. activate it. The commands below include <path to venv> because I didn’t know that I don’t need to use the path if I activate this venv.
  2. Install Glances
    • <path to venv>/bin/pip3 install glances
  3. Run Glances in web server mode just ot find out a bunch of stuff is missing (fastapi)
    • <path to venv>/bin/glances -w
  4. Spend 1 day figuring out why ‘pip install’ is not installing just to find out I have to use pip3 (thanks forums)
    • when I used ‘pip install’, it started installing, but threw a whole bunch of weird errors. I thought something was wrong with my internet connection.
  5. Install Fastapi (web framework)
    • <path to venv>/bin/pip3 install fastapi
  6. Run Glances again to find out more of stuff is missing (uvicorn)
  7. Install Uvicorn (web server)
    • <path to venv>/bin/pip3 install uvicorn
  8. Run Glances again to find out more of stuff is missing (jinja2)
  9. Install Jinja2 (templating language)
    • <path to venv>/bin/pip3 install jinja2

But hey, not everything is bleak. I finally learnt what venv is and used it for the first time. It’s just an island with an isolated python environment. Yes, I know, I’m slow.

Glances run at <your host>: 61208 and when I access it via web browser, it looks like this:

The whole reason why I wanted to install Glances is to monitor RBPI from Home Assistant. There is a nice Glances integration that works out of the box:

Glances consume ~40% of poor RBPI Zero W CPU, which is quite a lot.

I wonder if there is a tool to monitor CPU that is not CPU intensive…

Update: if I don’t access it via web browser (only via Home Assistant), the CPU usage is 12%. Much better.

Tags: #homeasistant #glances #raspberrypi

https://blog.rozman.info/monitoring-rbpi-with-glances-home-assistant-in-2024/