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 %>