mirror of
https://github.com/unixtensor/proxmox-ntfy.git
synced 2025-06-28 14:18:05 +00:00
Start up message
This commit is contained in:
@ -9,9 +9,11 @@ def Interface():
|
||||
parser.add_argument("--disable-uptime-notifys", action="store_true", help="Disable uptime notifications.")
|
||||
parser.add_argument("--disable-startup-ping", action="store_true", help="Disable the start up ping.")
|
||||
parser.add_argument("--disable-cpu-temp", action="store_true", help="Disable notifications for CPU tempature.")
|
||||
|
||||
parser.add_argument("--cpu-temp-warning", type=int, default=70, help="CPU tempature for the warning alert. default = 70")
|
||||
parser.add_argument("--update-rate", type=int, default=1, help="How often updates happen in seconds. default = 1")
|
||||
|
||||
parser.add_argument("--cpu-temp-warning-message", default=cpu.Tempature.cpu_temp_warning_message, help="The notification message if the CPU is at a high tempature. (message) [TEMP] C")
|
||||
parser.add_argument("--startup-ping-message", default="🖥️ Ntfy proxmox monitoring started.", help="The notification message when the program is started.")
|
||||
|
||||
return parser.parse_args()
|
@ -21,6 +21,7 @@ class Config(TypedDict):
|
||||
cpu_temp_warning_message: str
|
||||
cpu_temp_check_disabled: bool
|
||||
startup_ping_disabled: bool
|
||||
startup_ping_message: str
|
||||
cpu_warning_temp: int
|
||||
update_interval: int
|
||||
ntfy_server_url: str
|
||||
@ -43,7 +44,8 @@ class Init:
|
||||
print(f"{self.config}\n" + start_prompt(self.config["ntfy_server_url"]))
|
||||
|
||||
if not self.config["startup_ping_disabled"]:
|
||||
self.ntfy.send("started")
|
||||
self.ntfy.send(self.config["startup_ping_message"])
|
||||
|
||||
self.__listen()
|
||||
|
||||
if __name__ == "__main__":
|
||||
@ -53,6 +55,7 @@ if __name__ == "__main__":
|
||||
"cpu_temp_warning_message": cli_args.cpu_temp_warning_message,
|
||||
"cpu_temp_check_disabled": cli_args.disable_cpu_temp,
|
||||
"startup_ping_disabled": cli_args.disable_startup_ping,
|
||||
"startup_ping_message": cli_args.startup_ping_message,
|
||||
"cpu_warning_temp": cli_args.cpu_temp_warning,
|
||||
"update_interval": cli_args.update_rate,
|
||||
"ntfy_server_url": cli_args.server_address,
|
||||
|
Reference in New Issue
Block a user