{"id":20541053,"url":"https://github.com/netways/check_elasticsearch","last_synced_at":"2025-07-05T03:03:24.447Z","repository":{"id":40690217,"uuid":"431903686","full_name":"NETWAYS/check_elasticsearch","owner":"NETWAYS","description":"Icinga check plugin to check Elasticsearch","archived":false,"fork":false,"pushed_at":"2025-02-17T13:11:07.000Z","size":186,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-27T22:11:23.772Z","etag":null,"topics":["elasticsearch","icinga","monitoring"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NETWAYS.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,"zenodo":null}},"created_at":"2021-11-25T16:04:26.000Z","updated_at":"2025-02-17T13:11:03.000Z","dependencies_parsed_at":"2023-12-06T09:27:55.168Z","dependency_job_id":"7b1f0759-f39b-4491-a50c-ec46ab563480","html_url":"https://github.com/NETWAYS/check_elasticsearch","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NETWAYS","download_url":"https://codeload.github.com/NETWAYS/check_elasticsearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248847977,"owners_count":21171274,"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":["elasticsearch","icinga","monitoring"],"created_at":"2024-11-16T01:19:04.660Z","updated_at":"2025-04-14T08:39:02.663Z","avatar_url":"https://github.com/NETWAYS.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check_elasticsearch\n\nIcinga check plugin to check the health status of an Elasticsearch cluster or the total hits/results of an Elasticsearch\nquery.\n\n## Usage\n\n```\nUsage:\n  check_elasticsearch [flags]\n  check_elasticsearch [command]\n\nAvailable Commands:\n  health      Checks the health status of an Elasticsearch cluster\n  query       Checks the total hits/results of an Elasticsearch query\n\nFlags:\n  -H, --hostname string   Hostname of the Elasticsearch instance (CHECK_ELASTICSEARCH_HOSTNAME) (default \"localhost\")\n  -p, --port int          Port of the Elasticsearch instance (default 9200)\n  -U, --username string   Username for HTTP Basic Authentication (CHECK_ELASTICSEARCH_USERNAME)\n  -P, --password string   Password for HTTP Basic Authentication (CHECK_ELASTICSEARCH_PASSWORD)\n  -S, --tls               Use a HTTPS connection\n      --insecure          Skip the verification of the server's TLS certificate\n      --ca-file string    Specify the CA File for TLS authentication (CHECK_ELASTICSEARCH_CA_FILE)\n      --cert-file string  Specify the Certificate File for TLS authentication (CHECK_ELASTICSEARCH_CERT_FILE)\n      --key-file string   Specify the Key File for TLS authentication (CHECK_ELASTICSEARCH_KEY_FILE)\n  -t, --timeout int       Timeout in seconds for the CheckPlugin (default 30)\n  -h, --help              help for check_elasticsearch\n  -v, --version           version for check_elasticsearch\n```\n\nThe check plugin respects the environment variables `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`.\n\nVarious flags can be set with environment variables, refer to the help to see which flags.\n\n### Health\n\nChecks the health status of an Elasticsearch cluster.\n\n```\nUsage:\n  check_elasticsearch health\n\nThe cluster health status is:\n  green = OK\n  yellow = WARNING\n  red = CRITICAL\n```\n\nExamples:\n\nElasticsearch cluster with green status (all nodes are running):\n\n```\n$ check_elasticsearch health -U exampleuser -P examplepassword -S --insecure\n[OK] - Cluster es-example-cluster is green | status=0 nodes=3 data_nodes=3 active_primary_shards=10 active_shards=20\n```\n\nElasticsearch cluster with yellow status (not all nodes are running):\n\n```\n$ check_elasticsearch health -U exampleuser -P examplepassword -S --insecure\n[WARNING] - Cluster es-example-cluster is yellow | status=1 nodes=2 data_nodes=2 active_primary_shards=10 active_shards=13```\n```\n\n### Query\n\nChecks the total hits/results of an Elasticsearch query.\n\nHint: The plugin is currently capable to return the total hits of documents based on a provided query string.\n\n```\nUsage:\n  check_elasticsearch query [flags]\n\nFlags:\n  -q, --query string      The Elasticsearch query\n  -I, --index string      Name of the Index which will be used (default \"_all\")\n  -k, --msgkey string     Message of messagekey to display\n  -m, --msglen int        Number of characters to display in the latest message (default 80)\n  -w, --warning string    Warning threshold for total hits (default \"20\")\n  -c, --critical string   Critical threshold for total hits (default \"50\")\n  -h, --help              help for query\n```\n\nExamples:\n\nSearch for total hits without any message:\n\n```\n$ check_elasticsearch query -q \"event.dataset:sample_web_logs and @timestamp:[now-5m TO now]\" -I \"kibana_sample_data_logs\"\n[CRITICAL] - Total hits: 14074 | total=14074;20;50\n```\n\nSearch for total hits with message:\n\n```\n$ check_elasticsearch query -q \"event.dataset:sample_web_logs and @timestamp:[now-5m TO now]\" -I \"kibana_sample_data_logs\" -k \"message\"\n[CRITICAL] - Total hits: 14074\n30.156.16.163 - - [2018-09-01T12:44:53.756Z] \"GET /wp-content/plugins/video-play\n | total=14074;20;50\n```\n\n### Ingest\n\nChecks the ingest statistics of Ingest Pipelines. Thresholds check against errors of an Elasticsearch Ingest Pipeline.\n\n```\nChecks the ingest statistics of Ingest Pipelines\n\nUsage:\n  check_elasticsearch ingest [flags]\n\nFlags:\n      --pipeline string          Pipeline Name\n      --failed-warning string    Warning threshold for failed ingest operations. Use min:max for a range. (default \"10\")\n      --failed-critical string   Critical threshold for failed ingest operations. Use min:max for a range. (default \"20\")\n  -h, --help                     help for ingest\n```\n\nExamples:\n\n```\ncheck_elasticsearch ingest --failed-warning 5 --failed-critical 10\n[WARNING] - Ingest operations may not be alright\n  \\_[WARNING] Failed ingest operations for mypipeline: 6; | pipelines.mypipeline.failed=6c\n\ncheck_elasticsearch ingest --pipeline foobar\n[OK] - Ingest operations alright\n  \\_[OK] Failed ingest operations for foobar: 5; | pipelines.foobar.failed=5c\n```\n\n### Snapshot\n\nChecks status of Snapshots.\n\n```\nChecks the status of Elasticsearch snapshots\nThe plugin maps snapshot status to the following status codes:\n\nSUCCESS, Exit code 0\nPARTIAL, Exit code 1\nFAILED, Exit code 2\nIN_PROGRESS, Exit code 3\n\nIf there are multiple snapshots the plugin uses the worst status\n\nUsage:\n  check_elasticsearch snapshot [flags]\n\nFlags:\n  -a, --all                         Check all retrieved snapshots. If not set only the latest snapshot is checked\n  -N, --number int                  Check latest N number snapshots. If not set only the latest snapshot is checked (default 1)\n  -r, --repository string           Comma-separated list of snapshot repository names used to limit the request (default \"*\")\n  -s, --snapshot string             Comma-separated list of snapshot names to retrieve. Wildcard (*) expressions are supported (default \"*\")\n  -T, --no-snapshots-state string   Set exit code to return if no snapshots are found. Supported values are 0, 1, 2, 3, OK, Warning, Critical, Unknown (case-insensitive - default \"Unknown\")\n  -h, --help                        help for snapshot\n```\n\nExamples:\n\n```\n$ check_elasticsearch snapshot\n[OK] - All evaluated snapshots are in state SUCCESS\n\n$ check_elasticsearch snapshot --all -r myrepo\n[CRITICAL] - At least one evaluated snapshot is in state FAILED\n\n$ check_elasticsearch snapshot --number 5 -s mysnapshot\n[WARNING] - At least one evaluated snapshot is in state PARTIAL\n```\n\n\n## License\n\nCopyright (c) 2022 [NETWAYS GmbH](mailto:info@netways.de)\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public\nLicense as published by the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied\nwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not,\nsee [gnu.org/licenses](https://www.gnu.org/licenses/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetways%2Fcheck_elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetways%2Fcheck_elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetways%2Fcheck_elasticsearch/lists"}