Hristo Jelev aa7e7d336c update readmi
2020-04-27 20:38:04 +03:00
2020-04-27 16:58:50 +03:00
2020-04-27 16:51:26 +03:00
2020-04-27 20:38:04 +03:00
2020-04-27 19:25:51 +03:00

Rapsberry Pi MQTT monitor

Python 2 script to check cpu load, cpu temperature, free space, voltage and system clock speed on a Raspberry Pi computer and publish the data to a MQTT server.

I wrote this so I can monitor my raspberries at home with home assistant. The script is writen for python 2 as when I wrote it one of the used python modules was not available for python 3. (if the modules are available for python 3 now the script shuold have no problems running on python 3 - plan to check that in the near feature) The script if very light, it takes 4 seconds as there are 4 one second sleeps in the code - due to mqtt have problems if I shoot the messages with no delay.

Installation:

If you don't have pip installed:

$ sudo apt install python-pip

Then install this module needed for the script:

$ pip install paho-mqtt

Rename config.py.example to config.py and populate the needed variables

Test the script.

Create a cron entry like this (you might need to update the path on the cron entry below, depending on where you put the script):

*/2 * * * * /usr/bin/python /home/pi/scripts/rpi-cpu2mqtt.py

Description
No description provided
Readme GPL-3.0 1.9 MiB
Languages
Python 85.5%
Shell 14.5%