Sha256: 62ecc71239b24127506bc05fea8b496cee8164051dddaaf23e93a835b2002ee2

Contents?: true

Size: 808 Bytes

Versions: 41

Compression:

Stored size: 808 Bytes

Contents

node ; Status
<%
# find all the failing services.
# Usage: consul-templaterb --once samples/tools/find_all_failing_services.txt.erb
#
# Environment variables:
# * `CONSUL_SERVICE_FILTER` : regexp to filter services `.*` by default
# * `CONSUL_DC_FILTER`:       regexp to filter datacenters `.*` by default

node_filter = Regexp.new(ENV['CONSUL_NODE_FILTER'] || '.*')
dc_filter = Regexp.new(ENV['CONSUL_DC_FILTER'] || '.*')
datacenters.each do |dc|
  next unless dc_filter.match(dc)
  nodes(dc: dc).each do |node|
    #warn node.inspect
    next unless node_filter.match(node['Node'])
    checks_for_node(node['Node'], dc: dc).each do |check|
      if check['Status'] != 'passing' && check['CheckID'] == '_node_maintenance'
%>"<%= check['Node'] %>" ; "<%= check['Notes'] %>"
<%
      end
    end
  end
end
%>

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
consul-templaterb-1.36.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.35.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.34.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.33.3 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.33.2 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.33.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.33.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.32.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.32.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.31.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.31.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.30.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.29.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.28.2 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.28.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.28.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.27.2 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.27.1 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.27.0 samples/tools/find_all_maintenance_nodes.txt.erb
consul-templaterb-1.26.3 samples/tools/find_all_maintenance_nodes.txt.erb