should now pass dry run flag in main()

This commit is contained in:
2024-12-05 20:42:50 -05:00
parent 572bb5e386
commit ca28cddfd0

View File

@ -374,12 +374,25 @@ class SystemHealthMonitor:
def main(): def main():
try: 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 # Parse command-line arguments or read from configuration file
ticket_api_url = "http://10.10.10.45/create_ticket_api.php" ticket_api_url = "http://10.10.10.45/create_ticket_api.php"
state_file = "/tmp/last_health_check.json" state_file = "/tmp/last_health_check.json"
# Instantiate the SystemHealthMonitor class # 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 # Run the health checks
monitor.run() monitor.run()