{"id":23468271,"url":"https://github.com/werrett/check-json","last_synced_at":"2025-04-12T21:15:32.367Z","repository":{"id":79163575,"uuid":"77497874","full_name":"werrett/check-json","owner":"werrett","description":"Nagios-compatible check to monitor JSON endpoints","archived":false,"fork":false,"pushed_at":"2016-12-28T03:55:51.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T04:43:54.095Z","etag":null,"topics":["devops","json","nagios"],"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/werrett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support.go","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-28T02:50:14.000Z","updated_at":"2021-01-27T10:03:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"08320960-2b9c-44a7-a70b-693d64ed8c4c","html_url":"https://github.com/werrett/check-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werrett%2Fcheck-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werrett%2Fcheck-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werrett%2Fcheck-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/werrett%2Fcheck-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/werrett","download_url":"https://codeload.github.com/werrett/check-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631679,"owners_count":21136562,"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","json","nagios"],"created_at":"2024-12-24T13:50:32.758Z","updated_at":"2025-04-12T21:15:32.342Z","avatar_url":"https://github.com/werrett.png","language":"Go","readme":"# JSON API Check\n\n**check-json - Use Nagios / Icinga to monitor JSON endpoints**\n\nThis plugin tests JSON API endpoints served over HTTP. It can check for the\nexistence of keys or do simple checks against values in the JSON response.\n\nCommand line flags have been chosen to be compatible with the common Nagios\n[check_http](https://www.monitoring-plugins.org/doc/man/check_http.html) plugin.\nPattern for JSON tests from [Python JSON\nCheck](https://github.com/drewkerrigan/nagios-http-json). This version allows\nregex test of string values and is a stand-alone binary.\n\nBasic Usage:\n```bash\n  check-json --hostname=time.jsontest.com \\\n    --key-exists=time --key-equals=date:2016\n```\n\nResponse Check Options:\n```\n  -e, --key-exists=    Checks existence of these keys from JSON response\n  -q, --key-equals=    A regex to check the value of specific key values from\n                       JSON response\n  -l, --key-lte=       Check the returned value is less than this for a JSON key\n  -g, --key-gte=       Check the returned value is greater than this for a JSON\n                       key\n  -d, --header-equals= Key=value checks for HTTP response headers (key:value)\n  -s, --status=        Checks the numerical HTTP return status (eg. 200)\n  -r, --regexp=        Checks the response body for a string using a regular\n                       expression.\n  -v, --verbose        Display extra details (eg. response bodies) for debugging\n                       (false)\n```\n\nHTTP Options:\n```\n  -H, --hostname=      Web server to query\n  -u, --uri=           URI to GET or POST (/)\n  -j, --method=        HTTP method (eg. HEAD, OPTIONS, TRACE, PUT, DELETE) (GET)\n  -P, --post=          Body of POST Request\n  -a, --authorization= Basic HTTP auth (username:password)\n  -S, --ssl            Enforce SSL (false)\n  -k, --header=        Key,value pairs to add as headers in HTTP request\n                       (name:value format)\n```\n\nHelp Options:\n```bash\n  -h, --help           Show this help message\n```\n\n## Installation\n\nEnsure you have go installed. On a mac you can use [homebrew](http://brew.sh):\n```bash\nbrew install go\n```\n\nEnsure your environment is setup correctly by putting vars in your `.bashrc`\nfile:\n\n```bash\nexport GOPATH=$HOME/go\nexport PATH=$PATH:$GOPATH/bin\n```\nYour GOHOME can be anywhere you choose.\n\nBuilding is more painful than normal because it is not a public repo.\n\n```\ngo build github.com/werrett/check-json\n```\n\nNow Check that you have it installed OK:\n\n```bash\ncheck-json --help\n\nUsage:\n  check-json [OPTIONS]\n\nApplication Options:\n  ...\n```\n## Example Commands\n\nSimple JSON key exists and regex against key value:\n\n```bash\ncheck-json --hostname=time.jsontest.com  \\\n  --key-exists=time --key-equals=date:2016 --verbose\n```\n\nSimple check using SSL:\n\n```bash\ncheck-json --ssl --hostname=api.foursquare.com \\\n   --uri='/v2/venues/4e37bb6aa809a0c63b3882e8?client_id=AA...\u0026client_secret=XX...\u0026v=20150313' \\\n   --key-exists=response\n```\n\nCheck adding an authentication header:\n\n```bash\ncheck-json --hostname=company.clearbit.co \\\n  --uri=/v1/companies/domain/clearbit.co --ssl \\\n  --header=\"Authorization:Bearer sk_...\" \\\n  --key-equals=\"name:Clearbit\" --verbose\n```\n\n\n## Todo\n\n - Nagios performance data\n - Checks on load times (warning / critical)\n - Integration tests\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwerrett%2Fcheck-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwerrett%2Fcheck-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwerrett%2Fcheck-json/lists"}