List of all datacenters
-
<% datacenters.each do |dc| %>
- <%= dc %> with <%= services(dc:dc).keys.count %> services, <%= nodes(dc:dc).count %> nodes <% end %>
% # This template can be configure the following way with environment variables # Environment variables to filter services/instances # SERVICES_TAG_FILTER: basic tag filter for service (default HTTP) require 'base64' require 'json' require 'date' services_tag_filter = ENV['SERVICES_TAG_FILTER'] def status_to_class(status) if status == 'passing' 'success' elsif status == 'warning' 'warning' elsif status == 'critical' 'danger' else 'info' end end def compute_node_status(snode) state = 'passing' return state unless snode['Checks'] snode['Checks'].each do |c| case c['Status'] when 'critical' return 'critical' when 'warning' state = 'warning' end end state end def compute_service_status(snodes) passing = 0 warning = 0 critical = 0 sum = 0 snodes.each do |snode| st = compute_node_status(snode) sum += 1 case st when 'passing' passing += 1 when 'warning' warning += 1 else critical += 1 end end [passing, warning, critical, sum] end %><%= render_file('common/header.html.erb', title: 'Services') %>