{"id":15952236,"url":"https://github.com/albatrossflavour/puppet_health_check","last_synced_at":"2025-03-17T23:32:37.238Z","repository":{"id":57665023,"uuid":"147266457","full_name":"albatrossflavour/puppet_health_check","owner":"albatrossflavour","description":"A set of tasks to carry out health checks on puppet infrastructure","archived":false,"fork":false,"pushed_at":"2025-02-27T01:38:30.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T03:41:23.644Z","etag":null,"topics":["health-check","healthcheck","puppet","puppet-enterprise","puppet-module"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albatrossflavour.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-04T00:25:55.000Z","updated_at":"2025-02-27T01:38:23.000Z","dependencies_parsed_at":"2022-09-26T20:31:14.755Z","dependency_job_id":null,"html_url":"https://github.com/albatrossflavour/puppet_health_check","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albatrossflavour%2Fpuppet_health_check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albatrossflavour%2Fpuppet_health_check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albatrossflavour%2Fpuppet_health_check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albatrossflavour%2Fpuppet_health_check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albatrossflavour","download_url":"https://codeload.github.com/albatrossflavour/puppet_health_check/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243680981,"owners_count":20330155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["health-check","healthcheck","puppet","puppet-enterprise","puppet-module"],"created_at":"2024-10-07T13:07:36.573Z","updated_at":"2025-03-17T23:32:37.233Z","avatar_url":"https://github.com/albatrossflavour.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# puppet_health_check\n\n\n#### Table of Contents\n\n1. [Description](#description)\n2. [Setup - The basics of getting started with puppet_health_check](#setup)\n    * [What puppet_health_check affects](#what-puppet_health_check-affects)\n    * [Setup requirements](#setup-requirements)\n    * [Beginning with puppet_health_check](#beginning-with-puppet_health_check)\n3. [Usage - Configuration options and additional functionality](#usage)\n4. [Limitations - OS compatibility, etc.](#limitations)\n5. [Development - Guide for contributing to the module](#development)\n\n## Description\n\nA set of tasks (and plan) to carry out health checks on puppet agents.  Includes things such as :\n\n* Validating the puppetmaster/compile masters are reachable from the agent\n* The puppet agent is enabled and running\n* The run interval is set to the desired value\n* The last run was within the run interval\n* If the catalog failed to compile\n* If any errors were encountered on the last puppet run\n\n\n## Setup\n\nProviding you can run tasks, you should be ok.  The tasks and plan have been tested on Linux (centos, ubuntu, redhat, and debian) and various Windows versions.  It **SHOULD** work on anything with a puppet agent capable of running tasks.\n\n### Beginning with puppet_health_check\n\n`puppet task show puppet_health_check::agent_health` should get you going, everything is driven through tasks and plans which can be accessed from the command line or the PE console.  When you run the task, you'll see output like:\n\n```bash\n# puppet task run puppet_health_check::agent_health -q 'inventory[certname] {}'\nStarting job ...\nNote: The task will run only on permitted nodes.\nNew job ID: 487\nNodes: 4\n\nStarted on puppetmaster.example.com ...\nStarted on client01.example.com ...\nStarted on win-3ebipmjenlq.example.com ...\nStarted on client02.example.com ...\nFinished on node client02.example.com\n  date : 2018-09-04T14:24:55+10:00\n  state : clean\n  certname : client02.example.com\nFinished on node puppetmaster.example.com\n  date : 2018-09-04T14:24:55+10:00\n  state : clean\n  certname : puppetmaster.example.com\nFinished on node client01.example.com\n  date : 2018-09-04T14:24:56+10:00\n  state : clean\n  certname : client01.example.com\nFailed on win-3ebipmjenlq.example.com\n  Error: Task finished with exit-code 1\n  date : 2018-09-04T14:26:28+10:00\n  state : issues found\n  service : Puppet service not configured to run\n  certname : win-3ebipmjenlq.example.com\n\nJob completed. 4/4 nodes succeeded.\nDuration: 5 sec\n```\n\n## Usage\n\nAll driven through tasks, either from the CLI, the console or via the API\n\nThe health check task will check the following things :\n\n* Is the agent running?\n* Is the agent enabled?\n* Is agent noop set?\n* Is the agent lockfile present?\n* Is the run interval set correctly?\n* Is a signed certificate present?\n* Was the last agent run within the right timeframe?\n* Were there failures in the last run?\n* Did the catalog compilation fail?\n* Can the agent reach a (compile)master on the right port?\n\nA `bolt plan` exists which automates the end to end check and resolution of (most) issue.\n\nThe plan executes the health check, picks up failures which it can deal with (see below), tries to resolve them, re-checks the failed nodes and then reports on the results.\n\n* Start the agent\n* Enable the agent\n* Reset noop mode\n* Reset run interval\n* Remove lockfile\n* Trigger an agent run\n\n### Example\n\n```\n# bolt plan --modulepath '/etc/puppetlabs/code/environments/production/modules/' run puppet_health_check::fix_nodes  --query='inventory[certname] {}' --transport pcp --format json\nStarting: plan puppet_health_check::fix_nodes\nclient01.example.com,0,heath check passed\npuppetmaster.example.com,0,heath check passed\nclient02.example.com,3,runinterval fixed\nclient02.example.com,4,puppet agent failed\nFinished: plan puppet_health_check::fix_nodes in 6.14 sec\n```\n\nThe exit codes from the plan are :\n\n*  0   : Clean\n*  1   : Health check couldn't run\n*  3   : Issue found but fixed\n*  4   : Issue found but automated fix failed\n*  100 : Issues remaining at the end of the check\n\n## Limitations\n\nI'm sure there are many, but not found anything obvious yet\n\n## Development\n\nFork, develop, submit a PR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbatrossflavour%2Fpuppet_health_check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbatrossflavour%2Fpuppet_health_check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbatrossflavour%2Fpuppet_health_check/lists"}