should now pass dry run flag in main()
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user