bin/metrics-es-cluster.rb in sensu-plugins-elasticsearch-1.1.3 vs bin/metrics-es-cluster.rb in sensu-plugins-elasticsearch-1.2.0
- old
+ new
@@ -175,13 +175,13 @@
end
def acquire_allocation_status
cluster_config = get_es_resource('/_cluster/settings')
transient_settings = cluster_config['transient']
- if transient_settings.empty?
- return nil
- else
+ if transient_settings.key?('cluster')
return %w(none new_primaries primaries all).index(transient_settings['cluster']['routing']['allocation']['enable'])
+ else
+ return nil
end
end
def run
if config[:allow_non_master] || master?