{"id":17132189,"url":"https://github.com/bitsofinfo/pingdom-check-loader","last_synced_at":"2025-08-14T21:08:51.160Z","repository":{"id":146759257,"uuid":"212515974","full_name":"bitsofinfo/pingdom-check-loader","owner":"bitsofinfo","description":"CLI for generating Pingdom checks from a declarative YAML configuration","archived":false,"fork":false,"pushed_at":"2020-08-25T20:10:00.000Z","size":230,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T11:12:55.797Z","etag":null,"topics":["devops","health","healthchecks","monitoring","pingdom","pingdom-api"],"latest_commit_sha":null,"homepage":"https://bitsofinfo.wordpress.com/2020/08/25/immutable-health-check-monitor-pingdom/","language":"Python","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/bitsofinfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-03T07:00:29.000Z","updated_at":"2020-10-04T18:12:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"725bc154-3138-419a-bff4-6894cd7aad3e","html_url":"https://github.com/bitsofinfo/pingdom-check-loader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fpingdom-check-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fpingdom-check-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fpingdom-check-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fpingdom-check-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitsofinfo","download_url":"https://codeload.github.com/bitsofinfo/pingdom-check-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245212311,"owners_count":20578443,"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":["devops","health","healthchecks","monitoring","pingdom","pingdom-api"],"created_at":"2024-10-14T19:26:19.306Z","updated_at":"2025-03-24T05:18:41.764Z","avatar_url":"https://github.com/bitsofinfo.png","language":"Python","readme":"# pingdom-check-loader\n\n[![Docker build](https://img.shields.io/docker/automated/bitsofinfo/pingdom-check-loader)](https://hub.docker.com/repository/docker/bitsofinfo/pingdom-check-loader)\n\nThis provides a simple CLI utility for managing \"checks\" in [Pingdom](https://pingdom.com) using the [3.1 API](https://docs.pingdom.com/api/)\n\n![diag](/docs/pingdom3.jpg \"Diagram1\")\n\nThis utility provides a CLI that lets you declare your desired check configuration state in YAML files; the CLI consumes that configuration, then generates one or more checks driven by the configuration. See the sample [checkconfigs.yaml](checkconfigs.yaml) for more docs and details on the configuration format.\n\nOnce checks are generated they can be created against a target Pingdom account. This CLI does not support mutating previously\ndefined checks. Checks changes are additive in nature. You can generate and produce new checks and delete old ones only. Existing checks (while editable in the Pingdom GUI) are not mutable via this CLI by design.\n\nThe checks generated and created by this utility are intended to be immutable; generated checks are tagged appropriately to be easy to find via Pingdom's GUI and APIs. Tags are automatically created based on a CLI invocation `timestamp` and `pathParts` (see YAML) so that all generated checks can be managed as a single set. You can then use these tags to delete checks (via this CLI) which can then be replaced by newer generated iterations of them as your requirements change. You can do things in any order you desire; for example create one version of checks, then interate and generate the 2nd iteration; after your 2nd iteration is functioning as desired you can cleanup the 1st iteration using the `--delete-tag-qualifers` flag passing the 1st iterations `timestamp` identifier.\n\n[Background info here](https://bitsofinfo.wordpress.com/2020/08/25/immutable-health-check-monitor-pingdom/)\n\n## Requirements, install, setup\n\n1. You need an account at Pingdom to actually create checks there (free trial or paid)\n2. You need a [Pingdom API token](https://my.pingdom.com/3/api-tokens) w/ read-write access to your account\n3. This was coded against the [Pingdom 3.1 API](https://docs.pingdom.com/api/)\n\nRun via Docker:\nhttps://hub.docker.com/r/bitsofinfo/pingdom-check-loader\n\nOtherwise you can run on the command line, but you will need **Python 3.7+** on your local, plus some dependencies: See [Dockerfile](Dockerfile) for `pip` installable dependencies.\n\n## Configuration\n\nSee the sample [checkconfigs.yaml](checkconfigs.yaml) for more docs and details on the configuration format.\n\n## How it works\n\nBefore even using this, you need an account at Pingdom (paid or free trial) and have your account configured w/ an read-write API token as stated above.\n\nOnce that is setup, the functionality is basically as follows:\n\n* `loader.py` consumes your arguments and reads the `--checks-config-file`\n  \n* For each declared check in the `sites.[yoursite].checks.[check]` it dynamically generates one or more check definitions using the `forEach` directives over declared `pathParts` to generate varying amounts of checks\n\n* The characteristics of generated checks is controlled by an inheritence based model, whereby your `defaults` can be overriden by `pathParts` and/or individual check blocks within `forEach` directives.\n\n* Once checks are generated, you are prompted for review, and can then apply them to Pingdom.\n\n* Each run of the CLI generates a `run identifier` in the format of `YYYmmDD_HHmmSSms` which is tagged on all created checks. This tag can be used to subsequently find and delete the checks should you wish to load a new-iteration w/ changes.\n\n* The CLI also supports deleting checks by check names and/or tag combinations\n\n## Some examples\n\nSetup a python virtual env:\n```bash\ncd pingdom-check-loader\npython3 -m venv venv\nsource venv/bin/activate\npip install --requirement requirements.txt\n```\n\nLets just see what would be generated for this [checkconfigs.yaml](checkconfigs.yaml) example: (you should get 17 checks)\n```bash\n ./loader.py     \\\n    --checks-config-file checkconfigs.yaml     \\\n    --dump-generated-checks \n```\n\nGreat, but lets only generate the `highPriority109Only` checks: (you should get 1 check)\n```bash\n ./loader.py     \\\n    --checks-config-file checkconfigs.yaml     \\\n    --check-names highPriority109Only \\\n    --dump-generated-checks \n```\n\nOk, but lets generate multiple checks: (you should get 3 checks)\n```bash\n ./loader.py     \\\n    --checks-config-file checkconfigs.yaml     \\\n    --check-names highPriority109Only,highPriorityAllTags \\\n    --dump-generated-checks \n```\n\nHow about we generate multiple the `highPriorityExamplesDirs` checks: (you should get 2 checks)\n```bash\n ./loader.py     \\\n    --checks-config-file checkconfigs.yaml     \\\n    --check-names highPriorityExamplesDirs \\\n    --dump-generated-checks \n```\n\nOk great, lets publish all these to Pingdom: (3 checks). Important: for this part of the example to work *you need to provide a api token file below in a file named trial.token*\n```bash\n ./loader.py     \\\n    --checks-config-file checkconfigs.yaml     \\\n    --check-names highPriority109Only,highPriorityAllTags \\\n    --dump-generated-checks \\\n    --create-in-pingdom \\\n    --pingdom-api-token-file trial.token\n```\n\nAfter they are created you will notice something like this in the logs:\n```\n...\n2019-10-03 22:13:40,529 - root - DEBUG - Finished: run identifier: 20191003_22285191\n...\n```\n\nWe can then use that identifier to cleanup the entire set of checks we just generated and created. *Note you need to use the `identifier` output form your example run, the below is a sample...*\n```bash\n ./loader.py     \\\n    --checks-config-file checkconfigs.yaml     \\\n    --delete-tag-qualifiers 20191003_22285191 \\\n    --delete-in-pingdom \\\n    --pingdom-api-token-file trial.token\n```\n\nIn addition the above examples there are other combinations of arguments you can use to more selectively select the checks you want to generate and or delete with the `--check-names` and `--delete-tag-qualifiers` arguments. \n\n## Running via Docker\n\nRunning via Docker is not much different than the command line directly, with the exception of you are using `docker run` in interactive mode. Below is simply a basic example.\n\n\nGenerate and dump only:\n```bash\ndocker run -i -v `pwd`:/configs \\\n    bitsofinfo/pingdom-check-loader:latest loader.py \\\n    --checks-config-file /configs/checkconfigs.yaml     \\\n    --dump-generated-checks     \n```\n\nGenerate and publish:\n```bash\ndocker run -i -v `pwd`:/configs \\\n    bitsofinfo/pingdom-check-loader:latest loader.py \\\n    --checks-config-file /configs/checkconfigs.yaml     \\\n    --dump-generated-checks     \\\n    --check-names test1     \\\n    --create-in-pingdom     \\\n    --pingdom-api-token-file /configs/my.token\n```\n\n## Pingdom API issues\n\nhttps://thwack.solarwinds.com/message/426746\n\n## Usage\n\n```\n./loader.py --help\n\nusage: loader.py [-h] [-f CHECKS_CONFIG_FILE] [-s SITES] [-c CHECK_NAMES]\n                 [-u PINGDOM_API_BASE_URL] [-t PINGDOM_API_TOKEN_FILE] [-d]\n                 [-x] [-D] [-q DELETE_TAG_QUALIFIERS] [-l LOG_LEVEL]\n                 [-b LOG_FILE]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -f CHECKS_CONFIG_FILE, --checks-config-file CHECKS_CONFIG_FILE\n                        Path to a YAML file containing the check configuration\n                        declarations to process (default: checkconfigs.yaml)\n  -s SITES, --sites SITES\n                        Optional comma delimited list of 'sites' to process.\n                        Default None (all sites) (default: None)\n  -c CHECK_NAMES, --check-names CHECK_NAMES\n                        Optional comma delimited list of 'checks.[name]' names\n                        to generate checks from. Default None (all checks)\n                        (default: None)\n  -u PINGDOM_API_BASE_URL, --pingdom-api-base-url PINGDOM_API_BASE_URL\n                        The Pingdom API base URL (inclusive of version)\n                        (default: https://api.pingdom.com/api/3.1)\n  -t PINGDOM_API_TOKEN_FILE, --pingdom-api-token-file PINGDOM_API_TOKEN_FILE\n                        Path to a file that contains an valid pingdom API\n                        token (default: None)\n  -d, --dump-generated-checks\n                        Dumps all generated checks to STDOUT (default: False)\n  -x, --create-in-pingdom\n                        CREATE all checks in Pingdom for the designated\n                        --check-names argument (default: False)\n  -D, --delete-in-pingdom\n                        DELETE all checks in Pingdom who's 'tags' contains any\n                        of the check names in the --check-names argument\n                        (default: False)\n  -q DELETE_TAG_QUALIFIERS, --delete-tag-qualifiers DELETE_TAG_QUALIFIERS\n                        Comma delimited list of one or more tags. To be used\n                        in conjunction w/ --delete-in-pingdom. Will only\n                        delete matching --check-names that also contain ALL of\n                        the specified tags in this comma delimited list of tag\n                        names (default: None)\n  -l LOG_LEVEL, --log-level LOG_LEVEL\n                        log level, DEBUG, INFO, etc (default: DEBUG)\n  -b LOG_FILE, --log-file LOG_FILE\n                        Path to log file; default None = STDOUT (default:\n                        None)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitsofinfo%2Fpingdom-check-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitsofinfo%2Fpingdom-check-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitsofinfo%2Fpingdom-check-loader/lists"}