Replace the sensors subprocess with psutil for the CPU tempature

This commit is contained in:
2025-06-18 15:41:05 -04:00
parent ef56b6075c
commit a0091fd1e2
4 changed files with 20 additions and 28 deletions

View File

@ -6,6 +6,7 @@ def Interface():
parser = argparse.ArgumentParser(
prog="Proxmox monitoring",
description="Proxmox monitoring tool for phone notifications using ntfy.sh")
parser.add_argument("server_address_no_topic", help="The ntfy server address.")
parser.add_argument("-t", "--topic", default="proxmox", help="The ntfy topic name that notifications will be sent to. Default = proxmox")
@ -16,6 +17,8 @@ def Interface():
parser.add_argument("--disable-cpu-temp", action="store_true", help="Disable notifications for CPU tempature.")
parser.add_argument("--disable-ntfy-logs", action="store_true", help="Disable logging ntfy activity to the output.")
parser.add_argument("--cpu-temp-zone", default="k10temp", help="The tempature zone for getting CPU info. default = k10temp")
parser.add_argument("--cpu-temp-zone-label", default="Tctl", help="The label for getting the current CPU tempature. default = Tctl")
parser.add_argument("--cpu-temp-warning", type=int, default=cpu.Tempature.thermal_warn_c, help=f"CPU tempature for the warning alert. default = {cpu.Tempature.thermal_warn_c}")
parser.add_argument("--cpu-temp-warning-timeout", type=int, default=cpu.Tempature.timeout_check_warn, help=f"Timeout in seconds until another CPU tempature related notification can be pushed. default = {cpu.Tempature.timeout_check_warn}")
parser.add_argument("--cpu-temp-warning-message", default=cpu.Tempature.warning_message, help="The notification message if the CPU is at a high tempature. (message) [TEMP] C")