Monitor systems: Monitoring in HomeAssistant with Glances

Diese Seite gibt es auch in Deutsch

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


Top articles in this section


Home Assistant Docker Conbee 2 and Zigbee2MQTT / deCONZ
Thanks to numerous integration options,Home Assistant is a simple platform for controlling a wide range of smart home devices. Compared to ioBroker, I found it much easier to get started with Home Assistant. While for ioBroker I was still searching for which frontend I could use for my dashboards, with Home-Assistant I had a ready-made system out of the box. Home Assistant's Lovelance dashboards can be easily clicked together in the GUI and adapted for special customizations in the code editor...

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

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.

Questions / Comments


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