added sys clock speed and updated readme
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
# Rapsberry Pi MQTT monitor
|
# Rapsberry Pi MQTT monitor
|
||||||
Python 2 script to check cpu load, cpu temperature and free space,
|
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.
|
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)
|
||||||
|
|
||||||
# Installation:
|
# Installation:
|
||||||
|
|
||||||
Install these two modules needed for the script
|
Install these two modules needed for the script
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ def publish_to_mqtt (cpu_load, cpu_temp, used_space, voltage, sys_clock_speed):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
client.publish(mqtt_topic_prefix+"/"+hostname+"/voltage", voltage, qos=1)
|
client.publish(mqtt_topic_prefix+"/"+hostname+"/voltage", voltage, qos=1)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
client.publish(mqtt_topic_prefix+"/"+hostname+"/sys_clock_speed", sys_clock_speed, qos=1)
|
||||||
#disconect from mqtt server
|
#disconect from mqtt server
|
||||||
client.disconnect()
|
client.disconnect()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user