From 541789792473a61e9f62842c8c7b2ea830891474 Mon Sep 17 00:00:00 2001 From: "U-ANALOG\\lli" Date: Sat, 31 Mar 2018 23:34:52 -0700 Subject: [PATCH 01/14] renamed README.rst to README.md for formatting --- README.rst => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.rst => README.md (100%) diff --git a/README.rst b/README.md similarity index 100% rename from README.rst rename to README.md From e1238440a66b60e7412fff3aaa5131c5c9d8a89c Mon Sep 17 00:00:00 2001 From: "U-ANALOG\\lli" Date: Sat, 31 Mar 2018 23:40:38 -0700 Subject: [PATCH 02/14] display title in README --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fc3d790..c69b7e1 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -#Nagios-ElasticSearch +# Nagios-ElasticSearch A few simple scripts for checking the state of your [ElasticSearch] cluster using Nagios the endpoints of ElasticSearch [![Build Status](https://secure.travis-ci.org/opentable/nagios-elasticsearch.png)](https://secure.travis-ci.org/opentable/nagios-elasticsearch.png) -##How they work +## How they work These plugins work by submitting API requests to a local or remote ElasticSearch server via the [cluster-health] and [node stats] endpoints -###Check Nodes in Cluster +### Check Nodes in Cluster This can be used to specify the nodes that are expected in the cluster. Currently, the check will return as **CRITICAL** if there are any unaccounted for nodes @@ -29,7 +29,7 @@ Options: python check_es_nodes.py --host=myescluster.com --expected_nodes_in_cluster=13 ``` -###Check Cluster Health Status +### Check Cluster Health Status This plugin can be used to get the current cluster health. This will return OK for Green, Warning for Yellow and Critical for Red. @@ -47,7 +47,7 @@ Options: python check_es_cluster_status.py --host=myescluster.com ``` -###Check for Unassigned Nodes in Cluster +### Check for Unassigned Nodes in Cluster This plugin can be used to check for unassigned shards in the cluster. This can potentially indicate that a node is missing from the cluster. The alert will currently indicate a CRITICAL error if an unassigned shard is found @@ -65,7 +65,7 @@ Options: python check_es_unassigned_shards.py --host=myescluster.com ``` -###Check Node JVM Usage +### Check Node JVM Usage This plugin can be used to ensure that the nodes in the cluster are not approaching, or exceeding, the thresholds that we determine that the JVM needs to run at. Currently, if any of the nodes exceed the critical limt, then the cluster will throw a CRITICAL error. If no nodes exceed the critical threshold but a node exceeds the warning threshold, then the cluster will throw a WARNING. @@ -89,11 +89,11 @@ Options: python check_es_unassigned_shards.py --host=myescluster.com ``` -###Installation +### Installation -###Development +### Development -###License +### License This project is licensed under MIT [cluster-health]: http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html From 59f6b1a23fb6fad1675651fec0a869c74f6c9c4b Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 16:43:07 -0700 Subject: [PATCH 03/14] when there are failed nodes and there's no split brain problem, the status will be WARNING instead of OK --- check_es_split_brain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 check_es_split_brain.py diff --git a/check_es_split_brain.py b/check_es_split_brain.py old mode 100644 new mode 100755 index e3643d6..ebce492 --- a/check_es_split_brain.py +++ b/check_es_split_brain.py @@ -61,7 +61,7 @@ def check(self, opts, args): raise Status('OK', "%d/%d nodes have same master" % (len(responding_nodes), len(nodes))) else: - raise Status('OK', "%d/%d nodes have same master\r\n" + raise Status('Warning', "%d/%d nodes have same master\r\n" "%d unresponsive nodes:\r\n%s" % (len(responding_nodes), len(nodes), From fa51346b7093c8a515d22162b4d37b450a04068c Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 17:05:45 -0700 Subject: [PATCH 04/14] conform to pep8 --- check_es_split_brain.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/check_es_split_brain.py b/check_es_split_brain.py index ebce492..9be7ab9 100755 --- a/check_es_split_brain.py +++ b/check_es_split_brain.py @@ -48,8 +48,8 @@ def check(self, opts, args): if len(responding_nodes) == 0: raise Status('Unknown', - "All cluster nodes unresponsive:\r\n" - "%s" % (str("\r\n".join(failed_nodes)))) + "All cluster nodes unresponsive:\r\n" + "%s" % (str("\r\n".join(failed_nodes)))) elif len(masters) != 1: raise Status('Critical', "%d masters (%s) found in %s cluster" % (len(masters), @@ -59,14 +59,14 @@ def check(self, opts, args): else: if len(failed_nodes) == 0: raise Status('OK', "%d/%d nodes have same master" - % (len(responding_nodes), len(nodes))) + % (len(responding_nodes), len(nodes))) else: - raise Status('Warning', "%d/%d nodes have same master\r\n" - "%d unresponsive nodes:\r\n%s" - % (len(responding_nodes), - len(nodes), - len(failed_nodes), - str("\r\n".join(failed_nodes)))) + raise Status('Warning', "%d/%d nodes have same master\r\n"" + "%d unresponsive nodes:\r\n%s" + % (len(responding_nodes), + len(nodes), + len(failed_nodes), + str("\r\n".join(failed_nodes)))) if __name__ == "__main__": ESSplitBrainCheck().run() From 771b0194066197d03bbe3bd4bcd7453725a5de45 Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 17:08:17 -0700 Subject: [PATCH 05/14] changed Travis image URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 README.md diff --git a/README.md b/README.md old mode 100644 new mode 100755 index c69b7e1..c7a1636 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A few simple scripts for checking the state of your [ElasticSearch] cluster using Nagios the endpoints of ElasticSearch [![Build -Status](https://secure.travis-ci.org/opentable/nagios-elasticsearch.png)](https://secure.travis-ci.org/opentable/nagios-elasticsearch.png) +Status](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)](https://secure.travis-ci.org/opentable/nagios-elasticsearch.png) ## How they work From 6a1ad4f11dbb0e58e9e3faa54e0b89568fe19aae Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 17:21:01 -0700 Subject: [PATCH 06/14] removed invalid use-mirrors option --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 .travis.yml diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index f79e86b..5b1b32c --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,11 @@ python: - 2.7 install: - - pip install -r requirements.txt --use-mirrors + - pip install -r requirements.txt + before_script: - "pep8 ." + script: - python setup.py test + From 9150e4af9a7c96eaa4c54657dae6be08a80d10b0 Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 17:25:50 -0700 Subject: [PATCH 07/14] added pep8 to requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 requirements.txt diff --git a/requirements.txt b/requirements.txt old mode 100644 new mode 100755 index 3324418..f7ff7c0 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ nagioscheck==0.1.6 +pep8==1.7.0 \ No newline at end of file From 0e442f8c4b0bb34279db2f409b5176fc6af19c2b Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:07:16 -0700 Subject: [PATCH 08/14] ignore egg and pyc files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 3b315b2..993e5c9 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ build/ dist/ venv/ nagios_elasticsearch.egg-info/ +*.egg* +*.pyc \ No newline at end of file From 02277ec137e87f0cf90ba2b18dabbf7096d9e0fb Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:12:12 -0700 Subject: [PATCH 09/14] added requirement for setuptools --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f7ff7c0..6b8439e 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ nagioscheck==0.1.6 -pep8==1.7.0 \ No newline at end of file +pep8==1.7.0 +setuptools==38.3.0 From c6c4cc681d0801513312bf67d9219e4dc434035d Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:12:35 -0700 Subject: [PATCH 10/14] changed README extension --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 setup.py diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 35c3863..7c5993b --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def parse_requirements(filename): setup( name="nagios-elasticsearch", description="A selection of Nagios plugins to monitor ElasticSearch.", - long_description=open('README.rst').read(), + long_description=open('README.md').read(), version="0.1.4", packages=find_packages(), author='Paul Stack', From 84d5b28d07972f06b7c9179756432a2fcf20c9ca Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:16:59 -0700 Subject: [PATCH 11/14] removed setuptools --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6b8439e..88eb166 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ nagioscheck==0.1.6 pep8==1.7.0 -setuptools==38.3.0 From b552aeec0905c76b8277fea579a041cc38655575 Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:31:19 -0700 Subject: [PATCH 12/14] conform to pep8 --- check_es_cluster_status.py | 3 ++- check_es_nodes.py | 5 +++-- setup.py | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 check_es_cluster_status.py mode change 100644 => 100755 check_es_nodes.py diff --git a/check_es_cluster_status.py b/check_es_cluster_status.py old mode 100644 new mode 100755 index e6878d4..54cd17b --- a/check_es_cluster_status.py +++ b/check_es_cluster_status.py @@ -42,7 +42,8 @@ def check(self, opts, args): cluster_status = es_cluster_health['status'].lower() if cluster_status == 'red': - raise Status("CRITICAL", "Cluster status is currently reporting as " + raise Status("CRITICAL", + "Cluster status is currently reporting as " "Red") elif cluster_status == 'yellow': raise Status("WARNING", "Cluster status is currently reporting as " diff --git a/check_es_nodes.py b/check_es_nodes.py old mode 100644 new mode 100755 index ba7c0a1..dba9702 --- a/check_es_nodes.py +++ b/check_es_nodes.py @@ -49,8 +49,9 @@ def check(self, opts, args): "reporting as '%s' but we expected '%s'" % (active_cluster_nodes, nodes_in_cluster)) else: - raise Status('OK', "Number of nodes in the cluster is '%s'" - "which is >= %s as expected" % (active_cluster_nodes, nodes_in_cluster)) + raise Status('OK', "Number of nodes in the cluster is '%s'" + "which is >= %s as expected" % (active_cluster_nodes, + nodes_in_cluster)) if __name__ == "__main__": ESNodesCheck().run() diff --git a/setup.py b/setup.py index 7c5993b..057d137 100755 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ def parse_requirements(filename): author='Paul Stack', author_email='public@paulstack.co.uk', url="https://github.com/stack72/nagios-elasticsearch", - download_url='http://github.com/stack72/nagios-elasticsearch/tarball/0.1.4', scripts=["check_es_nodes.py", "check_es_cluster_status.py", "check_es_jvm_usage.py", From ce4bc3e12d887461a770b782c97b2e9bd74c6dd2 Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:40:24 -0700 Subject: [PATCH 13/14] changed travis url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7a1636..3668310 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A few simple scripts for checking the state of your [ElasticSearch] cluster using Nagios the endpoints of ElasticSearch [![Build -Status](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)](https://secure.travis-ci.org/opentable/nagios-elasticsearch.png) +Status](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)) ## How they work From 07d255ad29b4e977353e1deaf4e26f15540b6395 Mon Sep 17 00:00:00 2001 From: 192dot Date: Tue, 10 Apr 2018 21:44:01 -0700 Subject: [PATCH 14/14] removed extra bracket --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3668310..3782af7 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A few simple scripts for checking the state of your [ElasticSearch] cluster using Nagios the endpoints of ElasticSearch [![Build -Status](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)) +Status](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master)](https://travis-ci.org/192dot/nagios-elasticsearch.svg?branch=master) ## How they work