diff --git a/hwmonDaemon.py b/hwmonDaemon.py index 25276ba..da8bcf8 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -374,12 +374,25 @@ class SystemHealthMonitor: def main(): try: + # Argument parser for CLI options + parser = argparse.ArgumentParser(description="System Health Monitor") + parser.add_argument( + "--dry-run", + action="store_true", + help="Enable dry-run mode (simulate ticket creation without actual API calls)." + ) + args = parser.parse_args() + # Parse command-line arguments or read from configuration file ticket_api_url = "http://10.10.10.45/create_ticket_api.php" state_file = "/tmp/last_health_check.json" # Instantiate the SystemHealthMonitor class - monitor = SystemHealthMonitor(ticket_api_url=ticket_api_url, state_file=state_file) + monitor = SystemHealthMonitor( + ticket_api_url=ticket_api_url, + state_file=state_file, + dry_run=args.dry_run # Pass the dry-run flag + ) # Run the health checks monitor.run()