nOidZddlmZddlZddlmZmZddlmZmZm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZdd lmZdd Zdd ZddZedk(reyy)z?Unified diagnostic entry point for the flotta monitoring stack.) annotationsN)datetimetimezone)AnyCallableDict)check_backup_status)check_docker_services)check_hardware) check_logbook)check_network_tunnel)check_web_servicesc |}t|tsd|dt|jiS|S#t$r}d|d|icYd}~Sd}~wwxYw)a# Execute a diagnostic function and capture unexpected exceptions. Args: name: Human readable check identifier. func: Zero-argument callable returning a dictionary. Returns: The dictionary from the callable, or an error payload when the check fails. errorz check failed: Nz" check returned non-dict payload: ) Exception isinstancedicttype__name__)namefuncresultexcs sentinel.py _run_checkrsi8 fd #D6!CDLDYDYCZ[\\ M 8D66778s7 AAAAc tdttdttdttdttdt tdt tjtjjdS)z3Run all diagnostics and return a structured report.hardwarezdocker servicesz web servicesznetwork tunnelz backup statuslogbook)rservices web_servicesnetworkbackupsrreport_timestamp_utc) rr r rr r r rnowrutc isoformatrrun_full_diagnosticsr)'siz>:02GH">3EF.0DEo/BCi7 ( X\\ : D D F r(cZt}ttj|ddy)NT)indent sort_keys)r)printjsondumps) diagnosticss rmainr25s&(K $**[d ;r@sLE" '&&-/*(/., =  zFr(