Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#236) agent_state_summary: Count nodes without report as unhealthy
It's possible that a Puppet Agent was stopped or disabled and all old reports were garbage collected from PuppetDB. The node still exists in PuppetDB, but when checking for a report the timestamp is null: ``` puppet query nodes[certname,report_timestamp]{} ``` ```json [ { "certname": "pe.tim.local", "report_timestamp": "2024-09-30T13:21:17.042Z" }, { "certname": "pe2.tim.local", "report_timestamp": null } ] ``` Previously we always assumed that `report_timestamp` has a valid timestamp. With this patch we explicitly validate the timestamp and count nodes withhout a timestamp as unhealthy. Now with the fix: ``` puppet plan run pe_status_check::agent_state_summary --environment peadm log_healthy_nodes=true log_unhealthy_nodes=true ``` ```json { "responsive": [ "pe.tim.local", "pe2.tim.local" ], "healthy_counter": 0, "total_counter": 2, "unhealthy_counter": 2, "noop": [], "unhealthy": [ "pe2.tim.local", "pe.tim.local" ], "healthy": [], "changed": [ "pe.tim.local" ], "no_report": [ "pe.tim.local" ], "corrective_changes": [], "used_cached_catalog": [ "pe2.tim.local" ], "unresponsive": [], "failed": [] } ```
- Loading branch information