updated zabbix state
This commit is contained in:
parent
20506f52c5
commit
3a737bf6fa
15
states/zabbix/scripts/pcsensor.py
Normal file
15
states/zabbix/scripts/pcsensor.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
tempre = re.compile(r" *(\d*\.\d*) C.*")
|
||||||
|
|
||||||
|
def temp_c():
|
||||||
|
res = subprocess.run("pcsensor", shell=True, capture_output=True)
|
||||||
|
line = res.stdout.decode().strip()
|
||||||
|
results = tempre.findall(line)
|
||||||
|
return float(results[0])
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print(temp_c())
|
Loading…
Reference in New Issue
Block a user