mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 18:44:53 +01:00
ike
This commit is contained in:
@@ -1113,7 +1113,11 @@ else:
|
|||||||
#print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"]))
|
#print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"]))
|
||||||
#print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"]))
|
#print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"]))
|
||||||
#client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False)
|
#client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False)
|
||||||
|
<<<<<<< HEAD
|
||||||
client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False)
|
client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False)
|
||||||
|
=======
|
||||||
|
client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on","version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False)
|
||||||
|
>>>>>>> 74b22b8d43db9a5fce3a9a54c22c6f876043206c
|
||||||
elif host.lower() == "router":
|
elif host.lower() == "router":
|
||||||
check_router()
|
check_router()
|
||||||
elif host.lower() == "nas":
|
elif host.lower() == "nas":
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ for b in backups:
|
|||||||
client.disconnect()
|
client.disconnect()
|
||||||
|
|
||||||
print("Getting size of FS")
|
print("Getting size of FS")
|
||||||
cmnd = "du -h --max-depth=0 {}".format(BACKUP_FS)
|
#cmnd = "du -h --max-depth=0 {}".format(BACKUP_FS)
|
||||||
|
cmnd = "df -h /srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee |awk '{ print $3 }'|tail -1"
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
used_space = (output.split())[0]
|
used_space = (output.split())[0]
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|||||||
Reference in New Issue
Block a user