Monitor systems: Monitoring in HomeAssistant with Glances

For collecting system data from other operating systems, HomeAssistant offers Glances integration, among other things. Glances is a terminal program for monitoring system status such as CPU, memory or disk usage. The additional WebServer mode allows to retrieve the status without SSH. For information about the integration in Home-Assistant, see: Home-Assistant.

Prerequisite:

The Python based tool can be used on almost all operating systems where Python is available, see: github.com/nicolargo/glances.

Linux

Glances can be enabled on a Linux system as follows:

 sudo apt install glances python3-pip

For the WebServer mode the bottle module is required, otherwise the server thanks with the following message: Bottle module not found. Glances cannot start in web server mode.

Bottle can be activated with this command:

pip install bottle

For security reasons, a password should be set for access.

glances -w --password

And for Glances to start automatically, the package can be created as a service:

Start as service

echo "[Unit]" > /usr/lib/systemd/system/glances.service
echo "Description = Glances in Web Server Mode" >> /usr/lib/systemd/system/glances.service
echo "After = network.target" >> /usr/lib/systemd/system/glances.service
echo "" >> /usr/lib/systemd/system/glances.service
echo "[Service]" >> /usr/lib/systemd/system/glances.service
echo "ExecStart = /usr/bin/glances -w " >> /usr/lib/systemd/system/glances.service
echo "" >> /usr/lib/systemd/system/glances.service
echo "[Install]" >> /usr/lib/systemd/system/glances.service
echo "WantedBy = multi-user.target" >> /usr/lib/systemd/system/glances.service
sudo systemctl enable glances.service
sudo systemctl start glances.service
sudo systemctl status glances.service

Optional Docker Integration

If you want to collect statistics on running Docker containers, you can do so with the following command:

pip install glances[docker]

Conclusion

Glances allows easy monitoring of various operating systems and their performance counters and offers Home-Assistant a way to monitor them, see: Home-Assistant.

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Publication: 2022-05-09 from Bernhard | Übersetzung Deutsch |🔔

Grafana: Docker - visualize data and define alarms | Smart Home | InfluxDB: Time series database in Docker

Top articles in this section


Monitor water meter, record consumption: ESP32-Cam

First of all a big thank you to the creators of the "AI-on-the-edge-device" digitizer. The project allows to digitize the water consumption of an analog water meter with a 10 € cheap ESP32 cam. I describe exactly how this works in this article.


Smart-Home-Plattform - ioBroker vs. Home-Assistant

For home automation, there are numerous different standards and a large number of different platforms. Open source platforms often offer the possibility to connect different automation standards with each other. As an example, a small mini-computer, a Raspberry Pi or a NAS equipped with multiple receivers could control different automation solutions via one platform.


Commissioning Zigbee2MQTT in Docker - step by step

Zigbee2MQTT is an open source Zigbee bridge which can be easily integrated into existing smart home solutions thanks to the MQTT network protocol. As an example, Zigbee2MQTT combined with MQTT broker Mosquitto and Home Assistant can collect, display, record and control data from Zigbee devices. The setup described here uses Docker as a base. Manufacturer's website: https://www.zigbee2mqtt.io

Questions / Comments


By continuing to browse the site, you agree to our use of cookies. More Details