flapjack 0.7.35 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -1
- data/Gemfile +3 -4
- data/Guardfile +1 -1
- data/README.md +38 -19
- data/Rakefile +1 -3
- data/etc/flapjack_config.yaml.example +11 -1
- data/features/steps/cli_steps.rb +3 -3
- data/features/steps/events_steps.rb +7 -6
- data/features/steps/flapjack-netsaint-parser_steps.rb +8 -8
- data/features/steps/notifications_steps.rb +10 -10
- data/features/steps/packaging-lintian_steps.rb +5 -9
- data/features/steps/time_travel_steps.rb +1 -1
- data/flapjack.gemspec +4 -3
- data/lib/flapjack/data/contact.rb +78 -6
- data/lib/flapjack/data/entity.rb +11 -2
- data/lib/flapjack/data/notification_rule.rb +67 -59
- data/lib/flapjack/data/semaphore.rb +44 -0
- data/lib/flapjack/gateways/api.rb +24 -28
- data/lib/flapjack/gateways/api/contact_methods.rb +1 -2
- data/lib/flapjack/gateways/api/entity_methods.rb +3 -3
- data/lib/flapjack/gateways/jsonapi.rb +249 -0
- data/lib/flapjack/gateways/jsonapi/contact_methods.rb +544 -0
- data/lib/flapjack/gateways/jsonapi/entity_check_presenter.rb +217 -0
- data/lib/flapjack/gateways/jsonapi/entity_methods.rb +350 -0
- data/lib/flapjack/gateways/jsonapi/entity_presenter.rb +75 -0
- data/lib/flapjack/gateways/jsonapi/rack/json_params_parser.rb +32 -0
- data/lib/flapjack/gateways/web.rb +78 -12
- data/lib/flapjack/gateways/web/public/css/bootstrap-theme.css +397 -0
- data/lib/flapjack/gateways/web/public/css/bootstrap-theme.min.css +7 -0
- data/lib/flapjack/gateways/web/public/css/bootstrap.css +7118 -0
- data/lib/flapjack/gateways/web/public/css/bootstrap.min.css +6 -8
- data/lib/flapjack/gateways/web/public/css/font-awesome.css +1338 -0
- data/lib/flapjack/gateways/web/public/css/font-awesome.min.css +4 -0
- data/lib/flapjack/gateways/web/public/css/screen.css +80 -0
- data/lib/flapjack/gateways/web/public/css/select2-bootstrap.css +87 -0
- data/lib/flapjack/gateways/web/public/css/select2.css +615 -0
- data/lib/flapjack/gateways/web/public/fonts/FontAwesome.otf +0 -0
- data/lib/flapjack/gateways/web/public/fonts/fontawesome-webfont.eot +0 -0
- data/lib/flapjack/gateways/web/public/fonts/fontawesome-webfont.svg +414 -0
- data/lib/flapjack/gateways/web/public/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/flapjack/gateways/web/public/fonts/fontawesome-webfont.woff +0 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/flapjack/gateways/web/public/img/flapjack-2013-notext-transparent-300-300.png +0 -0
- data/lib/flapjack/gateways/web/public/img/select2.png +0 -0
- data/lib/flapjack/gateways/web/public/img/select2x2.png +0 -0
- data/lib/flapjack/gateways/web/public/js/backbone-min.js +2 -0
- data/lib/flapjack/gateways/web/public/js/backbone.js +1581 -0
- data/lib/flapjack/gateways/web/public/js/backbone.jsonapi.js +75 -0
- data/lib/flapjack/gateways/web/public/js/bootstrap.js +2276 -0
- data/lib/flapjack/gateways/web/public/js/contacts.js +225 -0
- data/lib/flapjack/gateways/web/public/js/jquery-1.10.2.js +9789 -0
- data/lib/flapjack/gateways/web/public/js/jquery-1.10.2.min.js +6 -0
- data/lib/flapjack/gateways/web/public/js/select2.js +3255 -0
- data/lib/flapjack/gateways/web/public/js/select2.min.js +22 -0
- data/lib/flapjack/gateways/web/public/js/underscore-min.js +6 -0
- data/lib/flapjack/gateways/web/public/js/underscore.js +1276 -0
- data/lib/flapjack/gateways/web/views/check.html.erb +423 -193
- data/lib/flapjack/gateways/web/views/checks.html.erb +51 -71
- data/lib/flapjack/gateways/web/views/contact.html.erb +142 -164
- data/lib/flapjack/gateways/web/views/contacts.html.erb +20 -40
- data/lib/flapjack/gateways/web/views/edit_contacts.html.erb +83 -0
- data/lib/flapjack/gateways/web/views/entities.html.erb +18 -37
- data/lib/flapjack/gateways/web/views/entity.html.erb +46 -65
- data/lib/flapjack/gateways/web/views/index.html.erb +6 -27
- data/lib/flapjack/gateways/web/views/layout.erb +95 -0
- data/lib/flapjack/gateways/web/views/self_stats.html.erb +100 -114
- data/lib/flapjack/pikelet.rb +4 -2
- data/lib/flapjack/version.rb +1 -1
- data/spec/lib/flapjack/coordinator_spec.rb +120 -120
- data/spec/lib/flapjack/data/contact_spec.rb +66 -58
- data/spec/lib/flapjack/data/entity_check_spec.rb +179 -179
- data/spec/lib/flapjack/data/entity_spec.rb +71 -71
- data/spec/lib/flapjack/data/event_spec.rb +34 -30
- data/spec/lib/flapjack/data/message_spec.rb +6 -6
- data/spec/lib/flapjack/data/notification_rule_spec.rb +24 -24
- data/spec/lib/flapjack/data/notification_spec.rb +19 -19
- data/spec/lib/flapjack/data/semaphore_spec.rb +24 -0
- data/spec/lib/flapjack/data/tag_spec.rb +11 -10
- data/spec/lib/flapjack/gateways/api/contact_methods_spec.rb +201 -201
- data/spec/lib/flapjack/gateways/api/entity_check_presenter_spec.rb +55 -55
- data/spec/lib/flapjack/gateways/api/entity_methods_spec.rb +257 -257
- data/spec/lib/flapjack/gateways/api/entity_presenter_spec.rb +26 -26
- data/spec/lib/flapjack/gateways/api_spec.rb +1 -1
- data/spec/lib/flapjack/gateways/email_spec.rb +4 -4
- data/spec/lib/flapjack/gateways/jabber_spec.rb +77 -77
- data/spec/lib/flapjack/gateways/jsonapi/contact_methods_spec.rb +830 -0
- data/spec/lib/flapjack/gateways/jsonapi/entity_check_presenter_spec.rb +211 -0
- data/spec/lib/flapjack/gateways/jsonapi/entity_methods_spec.rb +863 -0
- data/spec/lib/flapjack/gateways/jsonapi/entity_presenter_spec.rb +108 -0
- data/spec/lib/flapjack/gateways/jsonapi_spec.rb +8 -0
- data/spec/lib/flapjack/gateways/oobetet_spec.rb +35 -35
- data/spec/lib/flapjack/gateways/pagerduty_spec.rb +40 -40
- data/spec/lib/flapjack/gateways/sms_messagenet_spec.rb +3 -3
- data/spec/lib/flapjack/gateways/web/views/check.html.erb_spec.rb +1 -1
- data/spec/lib/flapjack/gateways/web/views/contact.html.erb_spec.rb +5 -5
- data/spec/lib/flapjack/gateways/web/views/index.html.erb_spec.rb +1 -1
- data/spec/lib/flapjack/gateways/web_spec.rb +73 -74
- data/spec/lib/flapjack/logger_spec.rb +13 -13
- data/spec/lib/flapjack/pikelet_spec.rb +33 -33
- data/spec/lib/flapjack/processor_spec.rb +22 -22
- data/spec/lib/flapjack/redis_pool_spec.rb +1 -1
- data/spec/lib/flapjack/utility_spec.rb +12 -12
- data/spec/spec_helper.rb +9 -9
- data/spec/support/erb_view_helper.rb +4 -0
- metadata +107 -96
- data/lib/flapjack/gateways/web/public/css/flapjack.css +0 -49
- data/lib/flapjack/gateways/web/views/_css.html.erb +0 -42
- data/lib/flapjack/gateways/web/views/_foot.html.erb +0 -3
- data/lib/flapjack/gateways/web/views/_head.html.erb +0 -5
- data/lib/flapjack/gateways/web/views/_nav.html.erb +0 -10
@@ -1,77 +1,57 @@
|
|
1
|
-
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<% nav = render_erb('_nav.html.erb', binding) %>
|
5
|
-
<% head = render_erb('_head.html.erb', binding) %>
|
6
|
-
<% foot = render_erb('_foot.html.erb', binding) %>
|
7
|
-
<title>Flapjack - <%= @adjective.capitalize %> Checks</title>
|
8
|
-
<%= head %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="wrap">
|
12
|
-
<div class="container">
|
13
|
-
<div class="page-header">
|
14
|
-
<%= nav %>
|
15
|
-
<h2><%= @adjective.capitalize %> Checks</h2>
|
16
|
-
</div>
|
1
|
+
<% page_title "#{@adjective.capitalize} Checks" %>
|
17
2
|
|
18
|
-
|
3
|
+
<div class="page-header">
|
4
|
+
<h2><%= @adjective.capitalize %> Checks</h2>
|
5
|
+
</div>
|
19
6
|
|
20
|
-
|
21
|
-
<tr>
|
22
|
-
<th>Entity</th>
|
23
|
-
<th>Check</th>
|
24
|
-
<th>State</th>
|
25
|
-
<th>Summary</th>
|
26
|
-
<th>Last State Change</th>
|
27
|
-
<th>Last Update</th>
|
28
|
-
<th>Last Notification</th>
|
29
|
-
</tr>
|
30
|
-
<% @entities_sorted.each do |entity| %>
|
31
|
-
<% row_entity = nil %>
|
32
|
-
<% entity_link = "/entity/" << u(entity) %>
|
33
|
-
<% @states[entity].each do |check, status, summary, changed, updated, in_unscheduled_outage, in_scheduled_outage, notified| %>
|
34
|
-
<%
|
35
|
-
row_colour = case status
|
36
|
-
when 'critical', 'unknown'
|
37
|
-
'error'
|
38
|
-
when 'ok', 'up'
|
39
|
-
'success'
|
40
|
-
else
|
41
|
-
status
|
42
|
-
end
|
7
|
+
<p><%= h @count_failing_checks %> failing out of <%= h @count_all_checks %></p>
|
43
8
|
|
44
|
-
|
9
|
+
<table class="table table-bordered table-hover table-condensed">
|
10
|
+
<tr>
|
11
|
+
<th>Entity</th>
|
12
|
+
<th>Check</th>
|
13
|
+
<th>State</th>
|
14
|
+
<th>Summary</th>
|
15
|
+
<th>Last State Change</th>
|
16
|
+
<th>Last Update</th>
|
17
|
+
<th>Last Notification</th>
|
18
|
+
</tr>
|
19
|
+
<% @entities_sorted.each do |entity| %>
|
20
|
+
<% row_entity = nil %>
|
21
|
+
<% entity_link = "/entity/" << u(entity) %>
|
22
|
+
<% @states[entity].each do |check, status, summary, changed, updated, in_unscheduled_outage, in_scheduled_outage, notified| %>
|
23
|
+
<%
|
24
|
+
row_colour = case status
|
25
|
+
when 'critical', 'unknown'
|
26
|
+
'error'
|
27
|
+
when 'ok', 'up'
|
28
|
+
'success'
|
29
|
+
else
|
30
|
+
status
|
31
|
+
end
|
45
32
|
|
46
|
-
|
47
|
-
<tr class="<%= row_colour %>">
|
48
|
-
<% unless row_entity && entity == row_entity %>
|
49
|
-
<td rowspan=<%= @states[entity].length %>>
|
50
|
-
<a href="<%= entity_link %>"><%= h entity %></a>
|
51
|
-
</td>
|
52
|
-
<% row_entity = entity %>
|
53
|
-
<% end %>
|
54
|
-
<td><a href="<%= check_link %>" title="check detail"><%= h check %></a></td>
|
55
|
-
<td class="<%= status %>">
|
56
|
-
<%= h status.upcase %>
|
57
|
-
<% if in_unscheduled_outage%> (Ack'd)<% end %>
|
58
|
-
<% if in_scheduled_outage %> (Sched)<% end %>
|
59
|
-
</td>
|
60
|
-
<td><%= h summary %></td>
|
61
|
-
<td><%= h changed %></td>
|
62
|
-
<td><%= h updated %></td>
|
63
|
-
<td><%= h notified %></td>
|
64
|
-
</tr>
|
33
|
+
check_link = "/check?entity=" << u(entity) << "&check=" << u(check)
|
65
34
|
|
66
|
-
|
67
|
-
|
68
|
-
|
35
|
+
%>
|
36
|
+
<tr class="<%= row_colour %>">
|
37
|
+
<% unless row_entity && entity == row_entity %>
|
38
|
+
<td rowspan=<%= @states[entity].length %>>
|
39
|
+
<a href="<%= entity_link %>"><%= h entity %></a>
|
40
|
+
</td>
|
41
|
+
<% row_entity = entity %>
|
42
|
+
<% end %>
|
43
|
+
<td><a href="<%= check_link %>" title="check detail"><%= h check %></a></td>
|
44
|
+
<td class="<%= status %>">
|
45
|
+
<%= h status.upcase %>
|
46
|
+
<% if in_unscheduled_outage%> (Ack'd)<% end %>
|
47
|
+
<% if in_scheduled_outage %> (Sched)<% end %>
|
48
|
+
</td>
|
49
|
+
<td><%= h summary %></td>
|
50
|
+
<td><%= h changed %></td>
|
51
|
+
<td><%= h updated %></td>
|
52
|
+
<td><%= h notified %></td>
|
53
|
+
</tr>
|
69
54
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="footer">
|
74
|
-
<%= foot %>
|
75
|
-
</div>
|
76
|
-
</body>
|
77
|
-
</html>
|
55
|
+
<% end %>
|
56
|
+
<% end %>
|
57
|
+
</table>
|
@@ -1,174 +1,152 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
<% nav = render_erb('_nav.html.erb', binding) %>
|
5
|
-
<% head = render_erb('_head.html.erb', binding) %>
|
6
|
-
<% foot = render_erb('_foot.html.erb', binding) %>
|
7
|
-
<title>Flapjack - <%= h @contact.name %> (contact)</title>
|
8
|
-
<%= head %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="wrap">
|
12
|
-
<div class="container">
|
13
|
-
<div class="page-header">
|
14
|
-
<%= nav %>
|
15
|
-
<h2><%= h @contact.name %></h2>
|
16
|
-
</div>
|
1
|
+
<div class="page-header">
|
2
|
+
<h2><%= h @contact.name %></h2>
|
3
|
+
</div>
|
17
4
|
|
18
|
-
|
5
|
+
<% alerting = {} %>
|
19
6
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
<% end %>
|
42
|
-
</td>
|
43
|
-
<td></td>
|
44
|
-
<td></td>
|
45
|
-
<td></td>
|
46
|
-
<% else %>
|
47
|
-
<td><%= h mk.capitalize %></td>
|
48
|
-
<td><%= h mv %></td>
|
49
|
-
<td>
|
50
|
-
<% if @contact.media_intervals[mk] %>
|
51
|
-
<%= h @contact.media_intervals[mk] %> seconds
|
52
|
-
<% else %>
|
53
|
-
no custom interval
|
54
|
-
<% end %>
|
55
|
-
</td>
|
56
|
-
<td>
|
57
|
-
<% rollup_threshold = @contact.media_rollup_thresholds[mk] %>
|
58
|
-
<% num_alerting = alerting[mk].nil? ? 0 : alerting[mk].length %>
|
59
|
-
<% if rollup_threshold.nil? || (num_alerting < rollup_threshold.to_i) %>
|
60
|
-
No -
|
61
|
-
<% else %>
|
62
|
-
Yes -
|
63
|
-
<% end %>
|
64
|
-
<%= num_alerting %> alerting
|
65
|
-
</td>
|
66
|
-
<td>
|
67
|
-
<% if rollup_threshold.nil? %>
|
68
|
-
-
|
69
|
-
<% else %>
|
70
|
-
<%= h rollup_threshold %>
|
71
|
-
<% end %>
|
72
|
-
</td>
|
73
|
-
<% end %>
|
74
|
-
</tr>
|
7
|
+
<h3>Contact Media</h3>
|
8
|
+
<% if !@contact.media || @contact.media.empty? %>
|
9
|
+
<p>No media</p>
|
10
|
+
<% else %>
|
11
|
+
<table class="table table-bordered table-hover table-condensed">
|
12
|
+
<tr>
|
13
|
+
<th>Media</th>
|
14
|
+
<th>Address</th>
|
15
|
+
<th>Interval</th>
|
16
|
+
<th>Summary Mode</th>
|
17
|
+
<th>Summary Threshold</th>
|
18
|
+
</tr>
|
19
|
+
<% @contact.media.each_pair do |mk, mv| %>
|
20
|
+
<% alerting_checks = @contact.alerting_checks_for_media(mk) %>
|
21
|
+
<% alerting[mk] = alerting_checks unless (alerting_checks.nil? || alerting_checks.empty?) %>
|
22
|
+
<tr>
|
23
|
+
<% if 'pagerduty'.eql?(mk) %>
|
24
|
+
<td>PagerDuty</td>
|
25
|
+
<td>
|
26
|
+
<% @pagerduty_credentials.each_pair do |pk, pv| %>
|
27
|
+
<p><%= 'password'.eql?(pk) ? h("#{pk}: ...") : h("#{pk}: #{pv}") %></p>
|
75
28
|
<% end %>
|
76
|
-
</
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
<p>Alerting checks are any that are failing, not acknowledged, not in scheduled maintenance, and currently allowed by this contact's notification rules.</p>
|
81
|
-
|
82
|
-
<% if alerting.empty? %>
|
83
|
-
<p><em>There are no currently alerting checks.</em></p>
|
29
|
+
</td>
|
30
|
+
<td></td>
|
31
|
+
<td></td>
|
32
|
+
<td></td>
|
84
33
|
<% else %>
|
85
|
-
<
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
<%
|
91
|
-
|
92
|
-
<tr>
|
93
|
-
<td><%= h media.capitalize %></td>
|
94
|
-
<td>
|
95
|
-
<% checks.each do |entity_check| %>
|
96
|
-
<% entity, check = entity_check.split(':', 2) %>
|
97
|
-
<% check_link = "<a href=\"/check?entity=#{u(entity)}&check=#{u(check)}\" title=\"check status\">" +
|
98
|
-
h(check) + "</a>"%>
|
99
|
-
<a href="/entity/<%= u(entity) %>" title="entity status"><%= h entity %></a> ::
|
100
|
-
<%= check_link %> <br />
|
101
|
-
<% end %>
|
102
|
-
</td>
|
103
|
-
</tr>
|
104
|
-
<% end %>
|
34
|
+
<td><%= h mk.capitalize %></td>
|
35
|
+
<td><%= h mv %></td>
|
36
|
+
<td>
|
37
|
+
<% if @contact.media_intervals[mk] %>
|
38
|
+
<%= h @contact.media_intervals[mk] %> seconds
|
39
|
+
<% else %>
|
40
|
+
no custom interval
|
105
41
|
<% end %>
|
106
|
-
</
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
<th>Blackholes</th>
|
123
|
-
</tr>
|
124
|
-
<% rules.each do |rule| %>
|
125
|
-
<tr>
|
126
|
-
<td><%= h rule.id %></td>
|
127
|
-
<td><%= h( (rule.entities && !rule.entities.empty?) ? rule.entities.join(', ') : '-') %></td>
|
128
|
-
<td><%= h( (rule.tags && !rule.tags.empty?) ? rule.tags.to_a.join(', ') : '-') %></td>
|
129
|
-
<td><%= h( (rule.warning_media && !rule.warning_media.empty?) ? rule.warning_media.join(', ') : '-')%></td>
|
130
|
-
<td><%= h( (rule.critical_media && !rule.critical_media.empty?) ? rule.critical_media.join(', ') : '-') %></td>
|
131
|
-
<td><%= h(rule.time_restrictions) %></td>
|
132
|
-
<% blackholes = [] %>
|
133
|
-
<% blackholes << 'Warning' if rule.warning_blackhole %>
|
134
|
-
<% blackholes << 'Critical' if rule.critical_blackhole %>
|
135
|
-
<td><%= h(blackholes.join(', ')) %></td>
|
136
|
-
</tr>
|
42
|
+
</td>
|
43
|
+
<td>
|
44
|
+
<% rollup_threshold = @contact.media_rollup_thresholds[mk] %>
|
45
|
+
<% num_alerting = alerting[mk].nil? ? 0 : alerting[mk].length %>
|
46
|
+
<% if rollup_threshold.nil? || (num_alerting < rollup_threshold.to_i) %>
|
47
|
+
No -
|
48
|
+
<% else %>
|
49
|
+
Yes -
|
50
|
+
<% end %>
|
51
|
+
<%= num_alerting %> alerting
|
52
|
+
</td>
|
53
|
+
<td>
|
54
|
+
<% if rollup_threshold.nil? %>
|
55
|
+
-
|
56
|
+
<% else %>
|
57
|
+
<%= h rollup_threshold %>
|
137
58
|
<% end %>
|
138
|
-
</
|
59
|
+
</td>
|
139
60
|
<% end %>
|
61
|
+
</tr>
|
62
|
+
<% end %>
|
63
|
+
</table>
|
64
|
+
<% end %>
|
140
65
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
66
|
+
<h3>Alerting Checks</h3>
|
67
|
+
<p>Alerting checks are any that are failing, not acknowledged, not in scheduled maintenance, and currently allowed by this contact's notification rules.</p>
|
68
|
+
|
69
|
+
<% if alerting.empty? %>
|
70
|
+
<p><em>There are no currently alerting checks.</em></p>
|
71
|
+
<% else %>
|
72
|
+
<table class="table table-bordered table-hover table-condensed">
|
73
|
+
<tr>
|
74
|
+
<th>Media</th>
|
75
|
+
<th>Alerting Checks</th>
|
76
|
+
</tr>
|
77
|
+
<% alerting.each_pair do |media, checks| %>
|
78
|
+
<% if checks.length > 0 %>
|
79
|
+
<tr>
|
80
|
+
<td><%= h media.capitalize %></td>
|
81
|
+
<td>
|
82
|
+
<% checks.each do |entity_check| %>
|
83
|
+
<% entity, check = entity_check.split(':', 2) %>
|
84
|
+
<% check_link = "<a href=\"/check?entity=#{u(entity)}&check=#{u(check)}\" title=\"check status\">" +
|
85
|
+
h(check) + "</a>"%>
|
86
|
+
<a href="/entity/<%= u(entity) %>" title="entity status"><%= h entity %></a> ::
|
87
|
+
<%= check_link %> <br />
|
163
88
|
<% end %>
|
164
|
-
</
|
165
|
-
|
89
|
+
</td>
|
90
|
+
</tr>
|
91
|
+
<% end %>
|
92
|
+
<% end %>
|
93
|
+
</table>
|
94
|
+
<% end %>
|
95
|
+
|
96
|
+
<h3>Notification Rules</h3>
|
97
|
+
<% rules = @contact.notification_rules %>
|
98
|
+
<% if !rules || rules.empty? %>
|
99
|
+
<p>No notification rules</p>
|
100
|
+
<% else %>
|
101
|
+
<table class="table table-bordered table-hover table-condensed">
|
102
|
+
<tr>
|
103
|
+
<th>ID</th>
|
104
|
+
<th>Entities</th>
|
105
|
+
<th>Tags</th>
|
106
|
+
<th>Warning Media</th>
|
107
|
+
<th>Critical Media</th>
|
108
|
+
<th>Time Restrictions</th>
|
109
|
+
<th>Blackholes</th>
|
110
|
+
</tr>
|
111
|
+
<% rules.each do |rule| %>
|
112
|
+
<tr>
|
113
|
+
<td><%= h rule.id %></td>
|
114
|
+
<td><%= h( (rule.entities && !rule.entities.empty?) ? rule.entities.join(', ') : '-') %></td>
|
115
|
+
<td><%= h( (rule.tags && !rule.tags.empty?) ? rule.tags.to_a.join(', ') : '-') %></td>
|
116
|
+
<td><%= h( (rule.warning_media && !rule.warning_media.empty?) ? rule.warning_media.join(', ') : '-')%></td>
|
117
|
+
<td><%= h( (rule.critical_media && !rule.critical_media.empty?) ? rule.critical_media.join(', ') : '-') %></td>
|
118
|
+
<td><%= h(rule.time_restrictions) %></td>
|
119
|
+
<% blackholes = [] %>
|
120
|
+
<% blackholes << 'Warning' if rule.warning_blackhole %>
|
121
|
+
<% blackholes << 'Critical' if rule.critical_blackhole %>
|
122
|
+
<td><%= h(blackholes.join(', ')) %></td>
|
123
|
+
</tr>
|
124
|
+
<% end %>
|
125
|
+
</table>
|
126
|
+
<% end %>
|
166
127
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
</
|
128
|
+
<h3>All Entities and Checks</h3>
|
129
|
+
<% if !@entities_and_checks || @entities_and_checks.empty? %>
|
130
|
+
<p>No entities</p>
|
131
|
+
<% else %>
|
132
|
+
<table class="table table-bordered table-hover table-condensed">
|
133
|
+
<tr>
|
134
|
+
<th>Entity</th>
|
135
|
+
<th>Checks</th>
|
136
|
+
</tr>
|
137
|
+
<% @entities_and_checks.each do |ec| %>
|
138
|
+
<%
|
139
|
+
entity = ec[:entity]
|
140
|
+
checks = ec[:checks]
|
141
|
+
%>
|
142
|
+
<tr>
|
143
|
+
<td><a href="/entity/<%= u(entity.name) %>" title="entity status"><%= h entity.name %></a></td>
|
144
|
+
<td>
|
145
|
+
<% checks.each do |check| %>
|
146
|
+
<%= "<a href=\"/check?entity=#{u(entity.name)}&check=#{u(check)}\" title=\"check status\">#{ h check }</a>" %>
|
147
|
+
<% end %>
|
148
|
+
</td>
|
149
|
+
</tr>
|
150
|
+
<% end %>
|
151
|
+
</table>
|
152
|
+
<% end %>
|
@@ -1,42 +1,22 @@
|
|
1
|
-
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<% nav = render_erb('_nav.html.erb', binding) %>
|
5
|
-
<% head = render_erb('_head.html.erb', binding) %>
|
6
|
-
<% foot = render_erb('_foot.html.erb', binding) %>
|
7
|
-
<title>Flapjack - Contacts</title>
|
8
|
-
<%= head %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="wrap">
|
12
|
-
<div class="container">
|
13
|
-
<div class="page-header">
|
14
|
-
<%= nav %>
|
15
|
-
<h2>Contacts</h2>
|
16
|
-
</div>
|
1
|
+
<% page_title 'Contacts' %>
|
17
2
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<table class="table table-bordered table-hover table-condensed">
|
22
|
-
<tr>
|
23
|
-
<th>Name</th>
|
24
|
-
<th>Email</th>
|
25
|
-
</tr>
|
26
|
-
<% @contacts.sort_by {|c| [c.last_name, c.first_name] }.each do |contact| %>
|
27
|
-
<tr>
|
28
|
-
<td><a href="/contacts/<%= contact.id %>" title="contact details"><%= h contact.name %></a></td>
|
29
|
-
<td><%= h contact.email %></td>
|
30
|
-
</tr>
|
31
|
-
<% end %>
|
32
|
-
</table>
|
33
|
-
<% end %>
|
3
|
+
<div class="page-header">
|
4
|
+
<h2>Contacts</h2>
|
5
|
+
</div>
|
34
6
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
</
|
7
|
+
<% if !@contacts || @contacts.empty? %>
|
8
|
+
<p>No contacts</p>
|
9
|
+
<% else %>
|
10
|
+
<table class="table table-bordered table-hover table-condensed">
|
11
|
+
<tr>
|
12
|
+
<th>Name</th>
|
13
|
+
<th>Email</th>
|
14
|
+
</tr>
|
15
|
+
<% @contacts.sort_by {|c| [c.last_name, c.first_name] }.each do |contact| %>
|
16
|
+
<tr>
|
17
|
+
<td><a href="/contacts/<%= contact.id %>" title="contact details"><%= h contact.name %></a></td>
|
18
|
+
<td><%= h contact.email %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
<% end %>
|