flapjack 0.7.35 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<%
|
|
2
|
+
require_css 'select2'
|
|
3
|
+
|
|
4
|
+
require_js 'underscore'
|
|
5
|
+
require_js 'jquery-1.10.2'
|
|
6
|
+
require_js 'select2'
|
|
7
|
+
require_js 'backbone'
|
|
8
|
+
require_js 'backbone.jsonapi'
|
|
9
|
+
require_js 'bootstrap.min'
|
|
10
|
+
require_js 'contacts'
|
|
11
|
+
%>
|
|
12
|
+
|
|
13
|
+
<script type="text/template" id="contact-actions-template">
|
|
14
|
+
<button class="btn btn-success" id="addContact">
|
|
15
|
+
Add contact
|
|
16
|
+
</button>
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script type="text/template" id="contact-list-item-template">
|
|
20
|
+
<td><@- first_name @></td>
|
|
21
|
+
<td><@- last_name @></td>
|
|
22
|
+
<td><@- email @></td>
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div id="data-api-url" data-api-url="<%= @api_url %>">
|
|
26
|
+
<div class="page-header">
|
|
27
|
+
<h2>Edit Contacts</h2>
|
|
28
|
+
</div>
|
|
29
|
+
<div id="container">
|
|
30
|
+
<table class="table">
|
|
31
|
+
<thead>
|
|
32
|
+
<tr>
|
|
33
|
+
<th>First Name</th>
|
|
34
|
+
<th>Last Name</th>
|
|
35
|
+
<th>Email</th>
|
|
36
|
+
</tr>
|
|
37
|
+
</thead>
|
|
38
|
+
<tbody id="contactList">
|
|
39
|
+
</tbody>
|
|
40
|
+
</table>
|
|
41
|
+
|
|
42
|
+
<!-- Modal -->
|
|
43
|
+
<div class="modal fade" id="contactModal" tabindex="-1" role="dialog" aria-labelledby="contactModalLabel" aria-hidden="true">
|
|
44
|
+
<div class="modal-dialog">
|
|
45
|
+
<div class="modal-content">
|
|
46
|
+
<div class="modal-header">
|
|
47
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
48
|
+
<h4 class="modal-title" id="contactModalLabel">New Contact</h4>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="modal-body">
|
|
51
|
+
|
|
52
|
+
<form action="/contacts" method="post" role="form" class="form-horizontal">
|
|
53
|
+
<div class="form-group">
|
|
54
|
+
<label class="col-sm-3 control-label" for="contact_first_name">First name</label>
|
|
55
|
+
<div class="col-sm-9">
|
|
56
|
+
<input type="text" name="contact_first_name" class="form-control" value="">
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="form-group">
|
|
60
|
+
<label class="col-sm-3 control-label" for="contact_last_name">Last name</label>
|
|
61
|
+
<div class="col-sm-9">
|
|
62
|
+
<input type="text" name="contact_last_name" class="form-control" value="">
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="form-group">
|
|
66
|
+
<label class="col-sm-3 control-label" for="contact_email">Email</label>
|
|
67
|
+
<div class="col-sm-9">
|
|
68
|
+
<input type="text" name="contact_email" class="form-control" value="">
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</form><!-- form-horizontal-->
|
|
72
|
+
|
|
73
|
+
</div>
|
|
74
|
+
<div class="modal-footer">
|
|
75
|
+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
76
|
+
<button type="button" class="btn btn-success">Create Contact</button>
|
|
77
|
+
</div>
|
|
78
|
+
</div><!-- /.modal-content -->
|
|
79
|
+
</div><!-- /.modal-dialog -->
|
|
80
|
+
</div><!-- /.modal -->
|
|
81
|
+
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
@@ -1,39 +1,20 @@
|
|
|
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 - <%= h @adjective.capitalize %> Entities</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 @adjective.capitalize %> Entities</h2>
|
|
16
|
-
</div>
|
|
1
|
+
<% page_title "#{@adjective.capitalize} Entities" %>
|
|
17
2
|
|
|
18
|
-
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h2><%= h @adjective.capitalize %> Entities</h2>
|
|
5
|
+
</div>
|
|
19
6
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
<div id="footer">
|
|
36
|
-
<%= foot %>
|
|
37
|
-
</div>
|
|
38
|
-
</body>
|
|
39
|
-
</html>
|
|
7
|
+
<p><%= h @count_failing_entities %> failing out of <%= h @count_all_entities %></p>
|
|
8
|
+
|
|
9
|
+
<% if @entities.length > 0 %>
|
|
10
|
+
<table class="table table-bordered table-hover table-condensed">
|
|
11
|
+
<% @entities.sort.each do |entity| %>
|
|
12
|
+
<tr>
|
|
13
|
+
<td><a href="/entity/<%= CGI.escape(entity) %>"><%= h entity %></a>
|
|
14
|
+
</td>
|
|
15
|
+
</tr>
|
|
16
|
+
<% end %>
|
|
17
|
+
</table>
|
|
18
|
+
<% else %>
|
|
19
|
+
<p>No check output has been processed yet, so there are no entities we can show you here.</p>
|
|
20
|
+
<% end %>
|
|
@@ -1,67 +1,48 @@
|
|
|
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 - <%=h @entity %> (entity) </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 @entity %></h2>
|
|
16
|
-
</div>
|
|
17
|
-
<% if @states.empty? %>
|
|
18
|
-
<div>
|
|
19
|
-
<p>This entity has no check output associated with it</p>
|
|
20
|
-
</div>
|
|
21
|
-
<% else %>
|
|
22
|
-
<table class="table table-bordered table-hover table-condensed">
|
|
23
|
-
<tr>
|
|
24
|
-
<th>Check</th>
|
|
25
|
-
<th>State</th>
|
|
26
|
-
<th>Summary</th>
|
|
27
|
-
<th>Last State Change</th>
|
|
28
|
-
<th>Last Update</th>
|
|
29
|
-
<th>Last Notification</th>
|
|
30
|
-
</tr>
|
|
31
|
-
<% @states.each do |check, status, summary, changed, updated, in_unscheduled_outage, in_scheduled_outage, notified| %>
|
|
32
|
-
<%
|
|
33
|
-
row_colour = case status
|
|
34
|
-
when 'critical', 'unknown'
|
|
35
|
-
'error'
|
|
36
|
-
when 'ok', 'up'
|
|
37
|
-
'success'
|
|
38
|
-
else
|
|
39
|
-
status
|
|
40
|
-
end
|
|
1
|
+
<% page_title "#{h(@entity)} (entity)" %>
|
|
41
2
|
|
|
42
|
-
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h2><%= h @entity %></h2>
|
|
5
|
+
</div>
|
|
6
|
+
<% if @states.empty? %>
|
|
7
|
+
<div>
|
|
8
|
+
<p>This entity has no check output associated with it</p>
|
|
9
|
+
</div>
|
|
10
|
+
<% else %>
|
|
11
|
+
<table class="table table-bordered table-hover table-condensed">
|
|
12
|
+
<tr>
|
|
13
|
+
<th>Check</th>
|
|
14
|
+
<th>State</th>
|
|
15
|
+
<th>Summary</th>
|
|
16
|
+
<th>Last State Change</th>
|
|
17
|
+
<th>Last Update</th>
|
|
18
|
+
<th>Last Notification</th>
|
|
19
|
+
</tr>
|
|
20
|
+
<% @states.each do |check, status, summary, changed, updated, in_unscheduled_outage, in_scheduled_outage, notified| %>
|
|
21
|
+
<%
|
|
22
|
+
row_colour = case status
|
|
23
|
+
when 'critical', 'unknown'
|
|
24
|
+
'error'
|
|
25
|
+
when 'ok', 'up'
|
|
26
|
+
'success'
|
|
27
|
+
else
|
|
28
|
+
status
|
|
29
|
+
end
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</div>
|
|
63
|
-
<div id="footer">
|
|
64
|
-
<%= foot %>
|
|
65
|
-
</div>
|
|
66
|
-
</body>
|
|
67
|
-
</html>
|
|
31
|
+
check_link = "/check?entity=" << u(@entity) << "&check=" << u(check)
|
|
32
|
+
|
|
33
|
+
%>
|
|
34
|
+
<tr class="<%= row_colour %>">
|
|
35
|
+
<td><a href="<%= check_link %>" title="check detail"><%= h check %></a></td>
|
|
36
|
+
<td class="<%= status %>">
|
|
37
|
+
<%= h status.upcase %>
|
|
38
|
+
<% if in_unscheduled_outage%> (Ack'd)<% end %>
|
|
39
|
+
<% if in_scheduled_outage %> (Sched)<% end %>
|
|
40
|
+
</td>
|
|
41
|
+
<td><%= summary %></td>
|
|
42
|
+
<td><%= changed %></td>
|
|
43
|
+
<td><%= updated %></td>
|
|
44
|
+
<td><%= notified %></td>
|
|
45
|
+
</tr>
|
|
46
|
+
<% end %>
|
|
47
|
+
</table>
|
|
48
|
+
<% end %>
|
|
@@ -1,29 +1,8 @@
|
|
|
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 - Summary</title>
|
|
8
|
-
<%= head %>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="wrap">
|
|
12
|
-
<div class="container">
|
|
13
|
-
<div class="page-header">
|
|
14
|
-
<%= nav %>
|
|
15
|
-
<h2>Summary</h2>
|
|
16
|
-
</div>
|
|
1
|
+
<% page_title 'Summary' %>
|
|
17
2
|
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h2>Summary</h2>
|
|
5
|
+
</div> <!-- page header -->
|
|
20
6
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<div id="push"></div>
|
|
24
|
-
</div>
|
|
25
|
-
<div id="footer">
|
|
26
|
-
<%= foot %>
|
|
27
|
-
</div>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
|
7
|
+
<h4><a href="/entities_failing" title="failing entities"><%= h @count_failing_entities %></a> out of <a href="/entities_all" title="all entities"><%= h @count_all_entities %></a> entities have failing checks</h4>
|
|
8
|
+
<h4><a href="/checks_failing" title="failing checks"><%= h @count_failing_checks %></a> out of <a href="/checks_all" title="all checks"><%= h @count_all_checks %></a> checks are failing</h4>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title><%= include_page_title %></title>
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<link rel="stylesheet" href="/css/bootstrap.min.css" media="screen">
|
|
7
|
+
<link rel="stylesheet" href="/css/bootstrap-responsive.min.css" media="screen">
|
|
8
|
+
<link rel="stylesheet" href="/css/screen.css" media="screen">
|
|
9
|
+
<link rel="stylesheet" href="/css/font-awesome.min.css">
|
|
10
|
+
<link rel="shortcut icon" href="/img/flapjack-favicon-64-32-24-16.ico"> <!-- thank you http://xiconeditor.com/ -->
|
|
11
|
+
<%= include_required_css %>
|
|
12
|
+
<%= include_required_js %>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<nav class="navbar navbar-default navbar-inverse" role="navigation">
|
|
16
|
+
|
|
17
|
+
<div class="navbar-header">
|
|
18
|
+
<a class="navbar-brand" title="Summary" href="/">
|
|
19
|
+
<img alt="Flapjack" class="logo" src="/img/flapjack-2013-notext-transparent-300-300.png">
|
|
20
|
+
</a>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
|
24
|
+
|
|
25
|
+
<ul class="nav navbar-nav">
|
|
26
|
+
<li>
|
|
27
|
+
<a title="Summary" href="/">
|
|
28
|
+
<i class="fa fa-trophy fa-lg"></i>
|
|
29
|
+
Summary
|
|
30
|
+
</a>
|
|
31
|
+
</li>
|
|
32
|
+
<li>
|
|
33
|
+
<a title="All Entities" href="/entities_all">
|
|
34
|
+
<i class="fa fa-bullseye fa-lg"></i>
|
|
35
|
+
All Entities
|
|
36
|
+
</a>
|
|
37
|
+
</li>
|
|
38
|
+
<li>
|
|
39
|
+
<a title="Failing Entities" href="/entities_failing">
|
|
40
|
+
<i class="fa fa-bullhorn fa-lg"></i>
|
|
41
|
+
Failing Entities
|
|
42
|
+
</a>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<a title="All Checks" href="/checks_all">
|
|
46
|
+
<i class="fa fa-check-circle-o fa-lg"></i>
|
|
47
|
+
All Checks
|
|
48
|
+
</a>
|
|
49
|
+
</li>
|
|
50
|
+
<li>
|
|
51
|
+
<a title="Failing Checks" href="/checks_failing">
|
|
52
|
+
<i class="fa fa-times-circle-o fa-lg"></i>
|
|
53
|
+
Failing Checks
|
|
54
|
+
</a>
|
|
55
|
+
</li>
|
|
56
|
+
<li>
|
|
57
|
+
<a title="Contacts" href="/contacts">
|
|
58
|
+
<i class="fa fa-users fa-lg"></i>
|
|
59
|
+
Contacts
|
|
60
|
+
</a>
|
|
61
|
+
</li>
|
|
62
|
+
</ul>
|
|
63
|
+
|
|
64
|
+
<ul class="nav navbar-nav navbar-right">
|
|
65
|
+
<li>
|
|
66
|
+
<a title="Internal Statistics" href="/self_stats">
|
|
67
|
+
<i class="fa fa-tachometer fa-lg"></i>
|
|
68
|
+
Internal Statistics
|
|
69
|
+
</a>
|
|
70
|
+
</li>
|
|
71
|
+
</ul>
|
|
72
|
+
|
|
73
|
+
</div>
|
|
74
|
+
</nav>
|
|
75
|
+
|
|
76
|
+
<div class="container">
|
|
77
|
+
<%= yield %>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<footer>
|
|
81
|
+
<p class="credits">Flapjack version <%= ::Flapjack::VERSION %>
|
|
82
|
+
<span class="separator">|</span>
|
|
83
|
+
<a href="http://flapjack.io" target="_website">
|
|
84
|
+
<i class="fa fa-cloud"></i>
|
|
85
|
+
Flapjack Website
|
|
86
|
+
</a>
|
|
87
|
+
<span class="separator">|</span>
|
|
88
|
+
<a href="https://github.com/flpjck/flapjack" target="_github">
|
|
89
|
+
<i class="fa fa-github"></i>
|
|
90
|
+
Flapjack on GitHub
|
|
91
|
+
</a>
|
|
92
|
+
</p>
|
|
93
|
+
</footer>
|
|
94
|
+
</body>
|
|
95
|
+
</html>
|
|
@@ -1,116 +1,102 @@
|
|
|
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 - Internal Statistics</title>
|
|
8
|
-
<%= head %>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="wrap">
|
|
12
|
-
<div class="container">
|
|
13
|
-
<div class="page-header">
|
|
14
|
-
<%= nav %>
|
|
15
|
-
<h2>Internal Statistics</h2>
|
|
16
|
-
</div>
|
|
1
|
+
<% page_title 'Internal Statistics' %>
|
|
17
2
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<table class="table table-bordered table-hover table-condensed">
|
|
22
|
-
<tr>
|
|
23
|
-
<td>Events queued:</td>
|
|
24
|
-
<td><%= h @events_queued %></td>
|
|
25
|
-
</tr>
|
|
26
|
-
<tr>
|
|
27
|
-
<td>Number of entities:</td>
|
|
28
|
-
<td><%= h @count_all_entities %></td>
|
|
29
|
-
</tr>
|
|
30
|
-
<tr>
|
|
31
|
-
<td>Number of failing entities:</td>
|
|
32
|
-
<td><%= h @count_failing_entities %></td>
|
|
33
|
-
</tr>
|
|
34
|
-
<tr>
|
|
35
|
-
<td>Number of checks:</td>
|
|
36
|
-
<td><%= h @count_all_checks %></td>
|
|
37
|
-
</tr>
|
|
38
|
-
<tr>
|
|
39
|
-
<td>Number of failing checks:</td>
|
|
40
|
-
<td><%= h @count_failing_checks %></td>
|
|
41
|
-
</tr>
|
|
42
|
-
<tr>
|
|
43
|
-
<td>Events processed (all time)</td>
|
|
44
|
-
<td>
|
|
45
|
-
<ul>
|
|
46
|
-
<li>all: <%= h @event_counters['all'] %> events</li>
|
|
47
|
-
<li>ok: <%= h @event_counters['ok'] %> events</li>
|
|
48
|
-
<li>failure: <%= h @event_counters['failure'] %> events</li>
|
|
49
|
-
<li>action: <%= h @event_counters['action'] %> events</li>
|
|
50
|
-
</ul>
|
|
51
|
-
</td>
|
|
52
|
-
</tr>
|
|
53
|
-
<tr>
|
|
54
|
-
<td>Check Freshness</td>
|
|
55
|
-
<td>
|
|
56
|
-
<ul>
|
|
57
|
-
<% @current_checks_ages.each_pair do |age, check_count| %>
|
|
58
|
-
<li>>= <%= age %>: <%= check_count %></li>
|
|
59
|
-
<% end %>
|
|
60
|
-
</ul>
|
|
61
|
-
</td>
|
|
62
|
-
</tr>
|
|
63
|
-
<tr>
|
|
64
|
-
<td>Total keys in redis</td>
|
|
65
|
-
<td><%= h @dbsize %></td>
|
|
66
|
-
</tr>
|
|
67
|
-
<tr>
|
|
68
|
-
<td>Current time</td>
|
|
69
|
-
<td><%= h Time.now.to_s %></td>
|
|
70
|
-
</tr>
|
|
71
|
-
</table>
|
|
72
|
-
</div>
|
|
73
|
-
<div class="span7">
|
|
74
|
-
<h4>Processor Instances:</h4>
|
|
75
|
-
<table class="table table-bordered table-hover">
|
|
76
|
-
<tr>
|
|
77
|
-
<th>Hostname</th>
|
|
78
|
-
<th>PID</th>
|
|
79
|
-
<th>Uptime</th>
|
|
80
|
-
<th>Events Processed</th>
|
|
81
|
-
</tr>
|
|
82
|
-
<% @executive_instances.sort_by {|i, d| d['uptime']}.each do |ei| %>
|
|
83
|
-
<%
|
|
84
|
-
instance_id, details = ei
|
|
85
|
-
hostname, pid = instance_id.split(':')
|
|
86
|
-
started = details['uptime_string']
|
|
87
|
-
event_counters = details['event_counters']
|
|
88
|
-
event_rates = details['event_rates']
|
|
89
|
-
%>
|
|
90
|
-
<tr>
|
|
91
|
-
<td><%= h hostname %></td>
|
|
92
|
-
<td><%= h pid %></td>
|
|
93
|
-
<td><%= h started %></td>
|
|
94
|
-
<td>
|
|
95
|
-
<ul>
|
|
96
|
-
<li>all: <%= h event_counters['all'] %> (<%= h event_rates['all'] %> events/s)</li>
|
|
97
|
-
<li>ok: <%= h event_counters['ok'] %> (<%= h event_rates['ok'] %> events/s)</li>
|
|
98
|
-
<li>failure: <%= h event_counters['failure'] %> (<%= h event_rates['failure'] %> events/s)</li>
|
|
99
|
-
<li>action: <%= h event_counters['action'] %> (<%= h event_rates['action'] %> events/s)</li>
|
|
100
|
-
</ul>
|
|
101
|
-
</td>
|
|
102
|
-
</tr>
|
|
103
|
-
<% end %>
|
|
104
|
-
</table>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h2>Internal Statistics</h2>
|
|
5
|
+
</div>
|
|
107
6
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col-md-6">
|
|
9
|
+
<h4>Global Statistics:</h4>
|
|
10
|
+
<table class="table table-bordered table-hover table-condensed">
|
|
11
|
+
<tr>
|
|
12
|
+
<td>Events queued:</td>
|
|
13
|
+
<td><%= h @events_queued %></td>
|
|
14
|
+
</tr>
|
|
15
|
+
<tr>
|
|
16
|
+
<td>Number of entities:</td>
|
|
17
|
+
<td><%= h @count_all_entities %></td>
|
|
18
|
+
</tr>
|
|
19
|
+
<tr>
|
|
20
|
+
<td>Number of failing entities:</td>
|
|
21
|
+
<td><%= h @count_failing_entities %></td>
|
|
22
|
+
</tr>
|
|
23
|
+
<tr>
|
|
24
|
+
<td>Number of checks:</td>
|
|
25
|
+
<td><%= h @count_all_checks %></td>
|
|
26
|
+
</tr>
|
|
27
|
+
<tr>
|
|
28
|
+
<td>Number of failing checks:</td>
|
|
29
|
+
<td><%= h @count_failing_checks %></td>
|
|
30
|
+
</tr>
|
|
31
|
+
<tr>
|
|
32
|
+
<td>Events processed (all time)</td>
|
|
33
|
+
<td>
|
|
34
|
+
<ul>
|
|
35
|
+
<li>all: <%= h @event_counters['all'] %> events</li>
|
|
36
|
+
<li>ok: <%= h @event_counters['ok'] %> events</li>
|
|
37
|
+
<li>failure: <%= h @event_counters['failure'] %> events</li>
|
|
38
|
+
<li>action: <%= h @event_counters['action'] %> events</li>
|
|
39
|
+
</ul>
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td>Check Freshness</td>
|
|
44
|
+
<td>
|
|
45
|
+
<ul>
|
|
46
|
+
<% @current_checks_ages.each_pair do |age, check_count| %>
|
|
47
|
+
<li>>= <%= age %>: <%= check_count %></li>
|
|
48
|
+
<% end %>
|
|
49
|
+
</ul>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>Total keys in redis</td>
|
|
54
|
+
<td><%= h @dbsize %></td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td>Current time</td>
|
|
58
|
+
<td><%= h Time.now.to_s %></td>
|
|
59
|
+
</tr>
|
|
60
|
+
</table>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="col-md-6">
|
|
63
|
+
<h4>Processor Instances:</h4>
|
|
64
|
+
<table class="table table-bordered table-hover">
|
|
65
|
+
<tr>
|
|
66
|
+
<th>Hostname</th>
|
|
67
|
+
<th>PID</th>
|
|
68
|
+
<th>Uptime</th>
|
|
69
|
+
<th>Events Processed</th>
|
|
70
|
+
</tr>
|
|
71
|
+
<% @executive_instances.sort_by {|i, d| d['uptime']}.each do |ei| %>
|
|
72
|
+
<%
|
|
73
|
+
instance_id, details = ei
|
|
74
|
+
hostname, pid = instance_id.split(':')
|
|
75
|
+
started = details['uptime_string']
|
|
76
|
+
event_counters = details['event_counters']
|
|
77
|
+
event_rates = details['event_rates']
|
|
78
|
+
%>
|
|
79
|
+
<tr>
|
|
80
|
+
<td><%= h hostname %></td>
|
|
81
|
+
<td><%= h pid %></td>
|
|
82
|
+
<td><%= h started %></td>
|
|
83
|
+
<td>
|
|
84
|
+
<ul>
|
|
85
|
+
<li>all: <%= h event_counters['all'] %> (<%= h event_rates['all'] %> events/s)</li>
|
|
86
|
+
<li>ok: <%= h event_counters['ok'] %> (<%= h event_rates['ok'] %> events/s)</li>
|
|
87
|
+
<li>failure: <%= h event_counters['failure'] %> (<%= h event_rates['failure'] %> events/s)</li>
|
|
88
|
+
<li>action: <%= h event_counters['action'] %> (<%= h event_rates['action'] %> events/s)</li>
|
|
89
|
+
</ul>
|
|
90
|
+
</td>
|
|
91
|
+
</tr>
|
|
92
|
+
<% end %>
|
|
93
|
+
</table>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<p>
|
|
98
|
+
<a class="btn btn-success" href="/self_stats.json">View as JSON</a>.
|
|
99
|
+
Learn how to
|
|
100
|
+
<a href="https://github.com/flpjck/flapjack/wiki/Gathering-internal-statistics-with-collectd">
|
|
101
|
+
use these metrics</a>.
|
|
102
|
+
</p>
|