Skip to content

Commit

Permalink
elasticsearch: monitor cluster status
Browse files Browse the repository at this point in the history
changes in cluster status currently generate events, but i would like to
generate custom alerts (with custom notifications) as well. this adds the
metric i would alert on.
  • Loading branch information
igor47 committed Feb 14, 2014
1 parent 53dbe3e commit 2e34daf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion checks.d/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"elasticsearch.relocating_shards": ("gauge", "relocating_shards"),
"elasticsearch.initializing_shards": ("gauge", "initializing_shards"),
"elasticsearch.unassigned_shards": ("gauge", "unassigned_shards"),
"elasticsearch.cluster_status": ("gauge", "status", lambda v: {"red":0,"yellow":1,"green":2}.get(v, -1)),
}


Expand Down Expand Up @@ -285,7 +286,7 @@ def _process_health_data(self, config_url, data, tags=None):
self.event(event)

def process_metric(metric, xtype, path, xform=None):
# closure over node_data
# closure over data
self._process_metric(data, metric, path, xform, tags=tags)
self._map_metric(process_metric)

Expand Down

0 comments on commit 2e34daf

Please sign in to comment.