<% alerting = {} %>

Contact Media

<% if !@contact.media || @contact.media.empty? %>

No media

<% else %> <% @contact.media.each_pair do |mk, mv| %> <% alerting_checks = @contact.alerting_checks_for_media(mk) %> <% alerting[mk] = alerting_checks unless (alerting_checks.nil? || alerting_checks.empty?) %> <% if 'pagerduty'.eql?(mk) %> <% else %> <% end %> <% end %>
Media Address Interval Summary Mode Summary Threshold
PagerDuty <% @pagerduty_credentials.each_pair do |pk, pv| %>

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

<% end %>
<%= h mk.capitalize %> <%= h mv %> <% if @contact.media_intervals[mk] %> <%= h @contact.media_intervals[mk] %> seconds <% else %> no custom interval <% end %> <% rollup_threshold = @contact.media_rollup_thresholds[mk] %> <% num_alerting = alerting[mk].nil? ? 0 : alerting[mk].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, not acknowledged, not in scheduled maintenance, and currently allowed by this contact's notification rules.

<% if alerting.empty? %>

There are no currently alerting checks.

<% else %> <% alerting.each_pair do |media, checks| %> <% if checks.length > 0 %> <% end %> <% end %>
Media Alerting Checks
<%= h media.capitalize %> <% checks.each do |entity_check| %> <% entity, check = entity_check.split(':', 2) %> <% check_link = "" + h(check) + ""%> <%= h entity %> :: <%= check_link %>
<% end %>
<% end %>

Notification Rules

<% rules = @contact.notification_rules %> <% if !rules || rules.empty? %>

No notification rules

<% else %> <% rules.each do |rule| %> <% blackholes = [] %> <% blackholes << 'Warning' if rule.warning_blackhole %> <% blackholes << 'Critical' if rule.critical_blackhole %> <% end %>
ID Entities Entities Regex Tags Tags Regex Warning Media Critical Media Time Restrictions Blackholes
<%= h rule.id %> <%= h( (rule.entities && !rule.entities.empty?) ? rule.entities.join(', ') : '-') %> <%= h( (rule.regex_entities && !rule.regex_entities.empty?) ? rule.regex_entities.join(', ') : '-') %> <%= h( (rule.tags && !rule.tags.empty?) ? rule.tags.to_a.join(', ') : '-') %> <%= h( (rule.regex_tags && !rule.regex_tags.empty?) ? rule.regex_tags.to_a.join(', ') : '-') %> <%= h( (rule.warning_media && !rule.warning_media.empty?) ? rule.warning_media.join(', ') : '-')%> <%= h( (rule.critical_media && !rule.critical_media.empty?) ? rule.critical_media.join(', ') : '-') %> <%= h(rule.time_restrictions) %><%= h(blackholes.join(', ')) %>
<% end %>

All Entities and Checks

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

No entities

<% else %> <% @entities_and_checks.each do |ec| %> <% entity = ec[:entity] checks = ec[:checks] %> <% end %>
Entity Checks
<%= h entity.name %> <% checks.each do |check| %> <%= "#{ h check }" %> <% end %>
<% end %>