fix: resolve infinite loop on nfs share discovery
feat: switched to dynamic coretemp for defpoll temp
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
class DiskMonitor:
|
||||
def __init__(self, path="/"):
|
||||
self.path = path
|
||||
|
||||
def get_free_gb(self):
|
||||
try:
|
||||
st = os.statvfs(self.path)
|
||||
free_bytes = st.f_bavail * st.f_frsize
|
||||
return round(free_bytes / (1024**3), 1)
|
||||
except Exception:
|
||||
return 0.0
|
||||
|
||||
def push_update(self):
|
||||
sys.stdout.write(f"{self.get_free_gb()}\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
if __name__ == "__main__":
|
||||
DiskMonitor().push_update()
|
||||
Reference in New Issue
Block a user