Contact Media

<% if @media.nil? || @media.empty? %>

No media

<% else %> <% @media.each do |med| %> <% alerting_checks = @alerting_checks_by_media_id[med[:id]] %> <% media_transport = med[:transport] %> <% if 'pagerduty'.eql?(media_transport) %> <% else %> <% if 'sms'.eql?(media_transport) %> <% else %> <% end %> <% end %> <% end %>
Media Address Interval Summary Mode Summary Threshold
PagerDuty <% [:pagerduty_subdomain, :pagerduty_user_name, :pagerduty_password, :pagerduty_token, :pagerduty_ack_duration].each do |pk| %> <% pv = med[pk] %> <% unless pv.empty? %>

<%= :pagerduty_password.eql?(pk) ? h("#{pk}: ...") : h("#{pk}: #{pv}") %>

<% end %> <% end %>
<%= h media_transport.upcase %><%= h media_transport.capitalize %><%= h med[:address] %> <% if med[:interval] %> <%= h med[:interval] %> seconds <% else %> no custom interval <% end %> <% rollup_threshold = med[:rollup_threshold] %> <% num_alerting = alerting_checks.nil? ? 0 : alerting_checks.length %> <% if rollup_threshold.nil? || (num_alerting < rollup_threshold.to_i) %> No - <% else %> Yes - <% end %> <%= num_alerting %> alerting <% if rollup_threshold.nil? %> - <% else %> <%= h rollup_threshold %> <% end %>
<% end %>

Alerting Checks

Alerting checks are any that are failing (and have alerted), not acknowledged, not in scheduled maintenance, and currently allowed by this contact's notification rules.

<% if @alerting_checks_by_media_id.nil? || @alerting_checks_by_media_id.empty? %>

There are no currently alerting checks.

<% else %> <% @alerting_checks_by_media_id.each_pair do |media_id, checks| %> <% if checks.length > 0 %> <% end %> <% end %>
Medium Alerting Checks
<%= h @media.detect {|m| m[:id].eql?(media_id) }[:transport].capitalize %> <% checks.each do |check| %> <%= h(check[:name]) %>
<% end %>
<% end %>

Rules

<% if !@rules || @rules.empty? %>

No rules

<% else %> <% @rules.each do |rule| %> <% rule_name = rule[:name].nil? || rule[:name].empty? ? rule[:id] : rule[:name] %> <% blackhole = rule[:blackhole] ? 'true' : 'false' %> <% tags = @tags_by_rule_id[rule[:id]] %> <% tag_names = tags.nil? ? [] : tags.map {|t| t[:name] } %> <% rule_conds = rule[:conditions_list] %> <% media = @media_by_rule_id[rule[:id]] %> <% transports = media.nil? ? [] : media.map {|m| m[:transport] } %> <% end %>
Name/ID Blackhole Strategy Tags Conditions Media Time Restrictions
<%= h( rule_name ) %> <%= h( blackhole ) %> <%= h( rule[:strategy]) %> <%= h( !tag_names.empty? ? tag_names.join(', ') : '-') %> <%= h( (!rule_conds.nil? && !rule_conds.empty?) ? rule_conds : '-')%> <%= h( !transports.empty? ? transports.join(', ') : '-') %> <%= h rule[:time_restriction_ical] %>
<% end %>

All Checks

<% if @checks.empty? %>

No checks

<% else %>
Checks
<% @checks.each do |check| %> <%= h check[:name] %> <% end %>
<% end %>