Debian system monitor (Ubuntu and RPi)

I’m excited to present to you my Linux system monitor - a Python script that collects system information and sends it to Home Assistant via MQTT.

This script is designed to work seamlessly with both Raspberry Pi and Ubuntu systems. It supports auto-discovery, updates, and can be installed with a single bash command, making it incredibly easy to start monitoring your system’s health and performance.

I first presented this script about 4 years ago, and since then it has matured significantly. If you’re using an old version, it’s definitely worth taking a look at the new features and considering an upgrade.

Here are some of the key features:

  • Easy to start: You can start monitoring your system in just a few minutes.
  • Comprehensive monitoring: Monitor cpu load, cpu temperature, free space, used memory, swap usage, uptime, wifi signal quality, voltage, and system clock speed.
  • Automatic HASS configuration: Supports discovery messages, so no manual configuration in Home Assistant configuration.yaml is needed.
  • Automated installation and configuration: You can install it and schedule it with a service or cron with just one command from shell.
  • Configurable: You can select what is monitored and how the message(s) is sent (separately or as one CSV message).
  • Easy update: You can update the script by calling it with command line argument --update.

Check out the project on GitHub: Raspberry Pi MQTT Monitor

I hope you find this tool useful, and I look forward to hearing your feedback!

5 Likes

It’s cool, installed without a hitch on my rpi with pihole on it.

I also installed on a rpi running picoreplayer, which is based a very light distro called core linux. It is very common way of running a music player (squeezelite based) on a pi. It was a bit of a mission, so I’ll do a write up and put it somewhere convenient. I could do it in the wiki section here - what do you prefer?

Thank you for trying the script. I am glad you like it. Regarding the write up, I have enabled the github wiki, so please post it where its convenient for you.

1 Like

Thanks for the share, it looks really nice and works like a charm on my Desktop Debian :ok_hand:

1 Like

I saw your initial message and improved the error handling for the MQTT connection.
Now if there is a problem you’ll see an error.

thanks :ok_hand: will be useful for dumbs like me not able to properly copy/paste a password :rofl:
The flag to indicate a new version is always on on my system, I have just done a git pull in the directory, it told me that it updated 3 files and then restart service but it still says that an update is avalaible :wink:

Side question: do I need a different mqtt user per computer/sbc or one for all is ok ? and HA will differntiate them ?
Thanks

One user for all is ok, each system will use its host name as unique name.
Regarding the update sensor, pls run this in your repository folder and show me the output:
git remote update && git status -uno

:ok_hand:

Sorry it’s in french but it states that my branch is up-to-date with origin/master:

root@fixe:/usr/rpi-mqtt-monitor# git remote update && git status -uno
Récupération de origin
Sur la branche master
Votre branche est à jour avec 'origin/master'.

rien à valider (utilisez -u pour afficher les fichiers non suivis)
root@fixe:/usr/rpi-mqtt-monitor#

If you update now git status should work fine.
The problem was that my script didn’t know french and its checking the output of that command i asked you to run.
Regards,

Thanks and I confirm it’s all good now :ok_hand:

Hi. Is it possible to have a sensor of when there is an update of packages available to update on a rpi? I am referring to this cmd.

sudo apt-get update

Is there a config option for temperature in Fahrenheit?

Just installed on my Ubuntu server. 2 mins and monitoring from my HA. Thank you @masoko!

This sounds perfect - been looking for something equivalent to Open Hardware Monitor for Windows PCs but for Linux.

Will this work on Intel based Debian or Ubuntu boxes or only RasPI?

Thanks

Had this running on my ubuntu server but had to remove it. My system kept “hanging/crashing” and I was getting unusual results. Any updates?

I’ve switched to the glances integration and loaded ubuntu glances in a docker. I’m monitoring the results but so far, so good.

Just excellent app :white_check_mark:,
It works straight within home assistant.
i just had to change in config.py cpu_thermal_zone = ‘x86_pkg_temp’ to get it working on Debian 12 on a mini PC Beelink S12 pro.
i’m just getting an error when running the CLI command :
$ sudo rpi-cpu2mqtt.py -v
sudo rpi-cpu2mqtt.py : commande introuvable
thank’s again :pray:

reply to myself : solved after reboot

Nice! Any way to get USB hard drive to the list? Also mine says uptime: 210:00, this is not days? And was I dot. See how many application updates there are either?