diff --git a/src/cli.py b/src/cli.py index 63d5525..cd65a65 100644 --- a/src/cli.py +++ b/src/cli.py @@ -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() \ No newline at end of file diff --git a/src/main.py b/src/main.py index 8837ac1..ab3cbdc 100644 --- a/src/main.py +++ b/src/main.py @@ -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,