{"id":51165072,"url":"https://github.com/yagilm/pingdom2stats","last_synced_at":"2026-06-26T18:02:15.804Z","repository":{"id":64306852,"uuid":"96415896","full_name":"yagilm/pingdom2stats","owner":"yagilm","description":"Pulls data from pingdom's API and stores it in a data store","archived":false,"fork":false,"pushed_at":"2018-06-07T11:22:39.000Z","size":179,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T19:21:26.341Z","etag":null,"topics":["database","db","historical-data","pingdom","pingdom-api"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yagilm.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}},"created_at":"2017-07-06T09:57:39.000Z","updated_at":"2020-05-19T14:00:08.000Z","dependencies_parsed_at":"2023-01-15T10:45:46.345Z","dependency_job_id":null,"html_url":"https://github.com/yagilm/pingdom2stats","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/yagilm/pingdom2stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagilm%2Fpingdom2stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagilm%2Fpingdom2stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagilm%2Fpingdom2stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagilm%2Fpingdom2stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yagilm","download_url":"https://codeload.github.com/yagilm/pingdom2stats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yagilm%2Fpingdom2stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34827536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["database","db","historical-data","pingdom","pingdom-api"],"created_at":"2026-06-26T18:02:14.911Z","updated_at":"2026-06-26T18:02:15.798Z","avatar_url":"https://github.com/yagilm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is it\nPulls data from Pingdom's API and pushes them to a mysql or postgres table.\n\n# How to use\nA database is needed with the appropriate rights.\nNote: if you are using postgres, change `--mysqlurl` with `--pgurl` with the appropriate DSN format.\n## DB configuration\nYou can use mysql or postgres with the appropriate flags. The DSN for each are:\n- Mysql: \"username:password@(address)/dbname\"\n- postgres: \"postgres://username:password@address:port/dbname?sslmode=disable\"\n  - (sslmode can be disable, require, verify-ca, verify-full depending on your server configuration)\n  - for a postgres db you might need to use the --pgschema flag to define the schema. (default:\"postgres\")\n\n## DB table\nOn first run, the user must create the table. They can do that manually or by running:\n`pingdom2stats --inittable --mysqlurl=\"username:password@(address)/dbname\"` (mysql)\nor\n`pingdom2stats --inittable --pgurl=\"postgres://username:password@address:port/dbname?sslmode=disable\"` (postgres)\nin order to create the table (and check the DB connection)\n\n## Adding checks\nFor every check that it's added, run with `--addcheck` in order to add the appropriate columns to the table.\n**Attention!** For very big tables this might take some time.\n`pingdom2stats --addcheck --checkid=$YOUR_CHECK_ID --mysqlurl=\"username:password@(address)/dbname\"`\nTwo new columns will be created with the name of the check and the check result fields. So your table will look like this:\n```\nmysql\u003e describe summary_performances;\n+-----------------------------+----------+------+-----+---------+-------+\n| Field                       | Type     | Null | Key | Default | Extra |\n+-----------------------------+----------+------+-----+---------+-------+\n| timestamp                   | datetime | NO   | PRI | NULL    |       |\n| $Name_of_check_avgresponse  | int(11)  | YES  |     | NULL    |       |\n| $Name_of_check_downtime     | int(11)  | YES  |     | NULL    |       |\n+-----------------------------+----------+------+-----+---------+-------+\n7 rows in set (0.00 sec)\n```\nThe program will use $checkid and pull the name of the check which will use for naming the columns(`checkname.go`).\nRun the --addcheck multiple times to add multiple checks.\n\n## Populating statistics\nAdd it to a job scheduler like cron or chronos. I prefer to run it every 20 hours (it pulls the last 24 hours' statistics). Note that if the timestamp exists the program will just update the values. No double timestamps are possible in the datastore.\n\n- The program should be used like this:\n```\n pingdom2stats --appkey=$YOURAPPKEY --checkid=$CHECKID --email=$ACCOUNTMAIL --pass=$ACCOUNTPASSWORD --mysqlurl=\"$DBUSER:$DBPASS@($DBIP:$DBPORT)/$DBNAME\" --output=\"mysql\"\n```\nYou might want to use `--output=\"console\"` first to see the data that will end up in your database.\n\n## Running in docker\nFor running it inside docker create the docker image by running\n`make pingdom2stats-docker` and then run it like (mysql example)\n```\ndocker run --rm pingdom2stats --appkey=$YOURAPPKEY --checkid=$CHECKID --email=$ACCOUNTMAIL --pass=$ACCOUNTPASSWORD  --mysqlurl=\"$DBUSER:$DBPASS@($DBIP:$DBPORT)/$DBNAME\" --output=\"mysql\"\n```\n\n## Pulling the historical data from Pingdom\nIn order to pull the historical data and write it in the data store, you need to run `fetch_history $UNIX_TIMESTAMP_OF_CHECK_CREATION`.\nYou would need to add the configuration variables, lines 4-9 of `fetch_history`.\n\n# Usage information\n```\n./pingdom2stats --help\nUsing Pingdom's API as described in: https://www.pingdom.com/resources/api\nVersion: v0.3.2\nUsage: pingdom2stats [options]\nMost options are required (and some have defaults):\n  --addcheck\n        Add new check into the mysql table, requires a data store, --checkid\n  --appkey string\n        Appkey for pingdom's API\n  --checkid string\n        ID of the check, aka the domain are we checking.\n  --email string\n        Pingdom's API configured e-mail account\n  --from value\n        from which (Unix)time we are asking, default 24 hours ago which is  (default 1522878124)\n  --inittable\n        Initialize the table, requires --mysqlurl\n  --mysqlurl string\n        mysql connection in DSN, like: username:password@(address)/dbname.\n        Cannot use together with --pgurl\n  --output string\n        Output destination (console, db) (default \"console\")\n  --pass string\n        password for pingdom's API\n  --pgschema string\n        Postgres schema (default \"postgres\")\n  --pgurl string\n        postgres connection in DSN, like: postgres://username:password@address:port/dbname?sslmode=disable.\n        Cannot use together with --mysqlurl\n  --to value\n        until which (Unix)time we are asking, default now which is  (default 1522964524)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyagilm%2Fpingdom2stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyagilm%2Fpingdom2stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyagilm%2Fpingdom2stats/lists"}