]> arthur.barton.de Git - netdata.git/commitdiff
elasticsearch plugin: cluster health status chart added
authorIlya <ilyamaschenko@gmail.com>
Fri, 20 Jan 2017 06:52:52 +0000 (15:52 +0900)
committerIlya <ilyamaschenko@gmail.com>
Fri, 20 Jan 2017 06:52:52 +0000 (15:52 +0900)
python.d/elasticsearch.chart.py

index 735ef32b6c637545969ca0099e808d95ce10e113..3ea0885b6b1e4d63e955daa2b4366748da17d47c 100644 (file)
@@ -20,7 +20,7 @@ retries = 60
 # charts order (can be overridden if you want less charts, or different order)
 ORDER = ['search_perf_total', 'search_perf_time', 'search_latency', 'index_perf_total', 'index_perf_time',
          'index_latency', 'jvm_mem_heap', 'jvm_gc_count', 'jvm_gc_time', 'thread_pool_qr', 'fdata_cache',
-         'fdata_ev_tr', 'cluster_health_nodes', 'cluster_health_shards', 'cluster_stats_nodes',
+         'fdata_ev_tr', 'cluster_health_status', 'cluster_health_nodes', 'cluster_health_shards', 'cluster_stats_nodes',
          'cluster_stats_query_cache', 'cluster_stats_docs', 'cluster_stats_store', 'cluster_stats_indices_shards']
 
 CHARTS = {
@@ -121,6 +121,17 @@ CHARTS = {
             ["health_number_of_pending_tasks", 'pending_tasks', 'absolute'],
             ["health_number_of_in_flight_fetch", 'inflight_fetch', 'absolute']
         ]},
+    'cluster_health_status': {
+        'options': [None, 'Cluster status', 'status', 'Cluster health API',
+                    'es.cluster_health_status', 'area'],
+        'lines': [
+            ["status_green", 'green', 'absolute'],
+            ["status_red", 'red', 'absolute'],
+            ["status_foo1", None, 'absolute'],
+            ["status_foo2", None, 'absolute'],
+            ["status_foo3", None, 'absolute'],
+            ["status_yellow", 'yellow', 'absolute']
+        ]},
     'cluster_health_shards': {
         'options': [None, 'Shards statistics', 'shards', 'Cluster health API',
                     'es.cluster_health_sharts', 'stacked'],
@@ -273,6 +284,10 @@ class Service(UrlService):
 
             to_netdata = dict()
             to_netdata.update(update_key('health', data))
+            to_netdata['status_green'] = 1 if to_netdata.get('health_status') == 'green' else 0
+            to_netdata['status_red'] = 1 if to_netdata.get('health_status') == 'red' else 0
+            to_netdata['status_yellow'] = 1 if to_netdata.get('health_status') == 'yellow' else 0
+            to_netdata['status_foo1'], to_netdata['status_foo2'], to_netdata['status_foo3'] = 0, 0, 0
 
             queue.put(to_netdata)