hostmon 0.0.1

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.
Files changed (74) hide show
  1. data/bin/hostmon +4 -0
  2. data/examples/config.yml +14 -0
  3. data/examples/reports/bad_exit_status/cluster1/mach1/report_2012-06-28-16:49:32.yaml +11 -0
  4. data/examples/reports/bad_exit_status/cluster2/mach1/report_2012-06-14-15:06:12.yaml +11 -0
  5. data/examples/reports/bad_exit_status/cluster2/mach2/report_2012-06-14-15:06:12.yaml +11 -0
  6. data/examples/reports/foo/cluster1/mach1/report_2012-06-28-16:49:32.yaml +10 -0
  7. data/examples/reports/foo/cluster2/mach1/report_2012-06-14-15:06:12.yaml +10 -0
  8. data/examples/reports/foo/cluster2/mach2/report_2012-06-14-15:06:12.yaml +10 -0
  9. data/examples/reports/missing_prelude/cluster1/mach1/report_2012-06-28-16:49:32.yaml +12 -0
  10. data/examples/reports/missing_prelude/cluster2/mach1/report_2012-06-14-15:06:12.yaml +12 -0
  11. data/examples/reports/missing_prelude/cluster2/mach2/report_2012-06-14-15:06:12.yaml +12 -0
  12. data/examples/reports/network/config/bootproto_dhcp/cluster1/mach1/report_2012-06-28-16:49:32.yaml +10 -0
  13. data/examples/reports/network/config/bootproto_dhcp/cluster2/mach1/report_2012-06-14-15:06:12.yaml +10 -0
  14. data/examples/reports/network/config/bootproto_dhcp/cluster2/mach2/report_2012-06-14-15:06:12.yaml +10 -0
  15. data/examples/reports/network/ethernet_bonded/cluster1/mach1/report_2012-06-28-16:49:32.yaml +31 -0
  16. data/examples/reports/network/ethernet_bonded/cluster2/mach1/report_2012-06-14-15:06:12.yaml +22 -0
  17. data/examples/reports/network/ethernet_bonded/cluster2/mach2/report_2012-06-14-15:06:12.yaml +22 -0
  18. data/examples/reports/nonexec/cluster1/mach1/report_2012-06-28-16:49:32.yaml +10 -0
  19. data/examples/reports/nonexec/cluster2/mach1/report_2012-06-14-15:06:12.yaml +10 -0
  20. data/examples/reports/nonexec/cluster2/mach2/report_2012-06-14-15:06:12.yaml +10 -0
  21. data/examples/reports/yum/badcheck/cluster1/mach1/report_2012-06-28-16:49:32.yaml +13 -0
  22. data/examples/reports/yum/badcheck/cluster2/mach1/report_2012-06-14-15:06:12.yaml +13 -0
  23. data/examples/reports/yum/badcheck/cluster2/mach2/report_2012-06-14-15:06:12.yaml +13 -0
  24. data/lib/hostmon.rb +208 -0
  25. data/lib/hostmon/config.rb +47 -0
  26. data/lib/hostmon/helpers.rb +174 -0
  27. data/lib/hostmon/models.rb +4 -0
  28. data/lib/hostmon/models/base.rb +39 -0
  29. data/lib/hostmon/models/check.rb +45 -0
  30. data/lib/hostmon/models/host.rb +211 -0
  31. data/lib/hostmon/models/report.rb +108 -0
  32. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_flat_30_cccccc_40x100.png +0 -0
  33. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_flat_50_5c5c5c_40x100.png +0 -0
  34. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_glass_20_333333_1x400.png +0 -0
  35. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_glass_40_000000_1x400.png +0 -0
  36. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_glass_40_ffc73d_1x400.png +0 -0
  37. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_gloss-wave_25_333333_500x100.png +0 -0
  38. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_highlight-soft_15_000000_1x100.png +0 -0
  39. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_highlight-soft_80_eeeeee_1x100.png +0 -0
  40. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_inset-soft_30_ff4e0a_1x100.png +0 -0
  41. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_222222_256x240.png +0 -0
  42. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_4b8e0b_256x240.png +0 -0
  43. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_a83300_256x240.png +0 -0
  44. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_cccccc_256x240.png +0 -0
  45. data/lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_ffffff_256x240.png +0 -0
  46. data/lib/hostmon/public/css/jquery_themes/hostmon/jquery-ui-1.8.16.custom.css +568 -0
  47. data/lib/hostmon/public/favicon.ico +0 -0
  48. data/lib/hostmon/public/js/cufon.js +7 -0
  49. data/lib/hostmon/public/js/gotham.font.js +40 -0
  50. data/lib/hostmon/public/js/hostmon.js +89 -0
  51. data/lib/hostmon/public/js/jquery-1.6.2.min.js +18 -0
  52. data/lib/hostmon/public/js/jquery-ui-1.8.16.custom.min.js +791 -0
  53. data/lib/hostmon/public/js/product-design.font.js +8 -0
  54. data/lib/hostmon/public/style.css +311 -0
  55. data/lib/hostmon/rubyfixes.rb +12 -0
  56. data/lib/hostmon/version.rb +3 -0
  57. data/lib/hostmon/views/check.erb +23 -0
  58. data/lib/hostmon/views/check_status.erb +16 -0
  59. data/lib/hostmon/views/cluster.erb +19 -0
  60. data/lib/hostmon/views/host.erb +15 -0
  61. data/lib/hostmon/views/host_status.erb +16 -0
  62. data/lib/hostmon/views/layout.erb +61 -0
  63. data/lib/hostmon/views/partials/check_status_selector.erb +6 -0
  64. data/lib/hostmon/views/partials/host_status_selector.erb +6 -0
  65. data/lib/hostmon/views/partials/hosts_selector.erb +9 -0
  66. data/lib/hostmon/views/partials/report.erb +7 -0
  67. data/lib/hostmon/views/partials/search.erb +18 -0
  68. data/lib/hostmon/views/partials/status_selector.erb +7 -0
  69. data/lib/hostmon/views/search_all.erb +25 -0
  70. data/lib/hostmon/views/search_checks.erb +12 -0
  71. data/lib/hostmon/views/search_host.erb +7 -0
  72. data/lib/hostmon/views/status.erb +15 -0
  73. data/lib/hostmon/views/view.erb +49 -0
  74. metadata +152 -0
@@ -0,0 +1,6 @@
1
+ <select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
2
+ <% @statuses.each do |s, o|
3
+ value = append_query_string("/check/#{@check}/#{s}") %>
4
+ <option value="<%= value %>" <%= "selected=\"selected\"" if @status == s %>><%= o %></option>
5
+ <% end %>
6
+ </select>
@@ -0,0 +1,6 @@
1
+ <select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
2
+ <% @statuses.each do |s, s2, s3, s4|
3
+ value = append_query_string("/host/#{@host.cluster}/#{@host}/#{s}") %>
4
+ <option value="<%= value %>" <%= "selected=\"selected\"" if @status == s %>><%= s3 %></option>
5
+ <% end %>
6
+ </select>
@@ -0,0 +1,9 @@
1
+ <select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
2
+ <option value="">-select host-</option>
3
+ <% Host.all.sort.each do |h|
4
+ option = "#{h.name}"
5
+ option << " [#{h.cluster}]"
6
+ value = append_query_string("/host/#{h.cluster}/#{h}") %>
7
+ <option value="<%= value %>" <%= "selected=\"selected\"" if @host == h %>><%= option %></option>
8
+ <% end %>
9
+ </select>
@@ -0,0 +1,7 @@
1
+ <%# Set @a and @report before calling this template %>
2
+ <div id="<%= @report.hostlint_id %>">
3
+ <li><%= @a %> <%= rstatus(@report) %></li>
4
+ <% if @report.body.size > 0 %>
5
+ <pre><%= @report.body %></pre>
6
+ <% end %>
7
+ </div>
@@ -0,0 +1,18 @@
1
+ <form name="search_cat_bar" method="get" action="/search">
2
+ <table width="700" border="0" cellpadding="3">
3
+ <tr>
4
+ <td>
5
+ Search:<input type="text" name="keyword" size="30" maxlength="50"> in
6
+ <select name="cat" size="1">
7
+ <option value="0">all
8
+ <option value="1">hosts
9
+ <option value="2">checks
10
+ <option value="3">failing
11
+ <option value="4">succeeding
12
+ </select>
13
+ <input type="submit" value="Find">
14
+ </td>
15
+ </tr>
16
+ </table>
17
+ </form>
18
+
@@ -0,0 +1,7 @@
1
+ <select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
2
+ <option value="">-status-</option>
3
+ <% Host.statuses.each do |s|
4
+ value = append_query_string("/status/#{s}") %>
5
+ <option value="<%= value %>" <%= "selected=\"selected\"" if params[:status] == s %>><%= s %></option>
6
+ <% end %>
7
+ </select>
@@ -0,0 +1,25 @@
1
+ <h2>search results for /<%= params["keyword"] %>/</h2>
2
+
3
+ <h3>hosts</h3>
4
+ <% @match_hosts.sort.each do |h| %>
5
+ <div>
6
+ <%= hostlink(h) %> <%= host_helper(h) %>
7
+ </div>
8
+ <% end %>
9
+
10
+ <h3>checks</h3>
11
+ <% @checks.each do |c| %>
12
+ <div>
13
+ <%= checklink(c) %> <%= stats_helper(c) %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <h3>reports</h3>
18
+ <% @reports.each do |host, checks| %>
19
+ <div>
20
+ <% checks.each do |c| %>
21
+ <%= hostlink(host) %>::<%= checklink(c.name) %> <%= status(c) %>
22
+ <pre><%= c.body %></pre>
23
+ <% end %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <h3><%= @banner %> checks matching /<%= params["keyword"] %>/</h3>
2
+
3
+ <% @checks.each do |host, checks| %>
4
+ <%= checks.size %>
5
+ <div>
6
+
7
+ <% checks.each do |c| %>
8
+ <%= hostlink(host) %>::<%= checklink(c.name) %> <%= status(c) %>
9
+ <pre><%= c.body %></pre>
10
+ <% end %>
11
+ </div>
12
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <h3>hosts matching /<%= params["keyword"] %>/</h3>
2
+
3
+ <% @match_hosts.sort.each do |h| %>
4
+ <div>
5
+ <%= hostlink(h) %> <%= host_helper(h) %>
6
+ </div>
7
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <h2><%= @title %></h2>
2
+
3
+ <% Check.each do |n, c| %>
4
+ <% if !(hosts = c.send(@method)).empty? %>
5
+ <h3><%= checklink(n) %></h3>
6
+ <ul><% end %>
7
+ <% hosts.sort.each do |h, c|
8
+ @report = c
9
+ @a = hostlink(h) %>
10
+ <%= erb :"partials/report", :layout => false %>
11
+ <% end %>
12
+ <% if !hosts.empty? %>
13
+ </ul>
14
+ <% end %>
15
+ <% end%>
@@ -0,0 +1,49 @@
1
+ <h2>hostlint checks</h2>
2
+ <h3>CHECK - OK/FAIL/EXEC_FAIL (total)</h3>
3
+
4
+ <table border="0">
5
+ <% Check.each do |c, v| %>
6
+ <tr>
7
+ <td><li><%= checklink(c) %></li></td>
8
+ <td><%= stats_helper(c) %></td>
9
+ </tr>
10
+ <% end %>
11
+ </table>
12
+
13
+ <h2>clusters :: hosts</h2>
14
+ <% Host.clusters.each do |c| # fixme sort elsewhere %>
15
+
16
+ <h3><a href="/cluster/<%= append_query_string(c) %>"><%= c %></a></h3>
17
+ <table>
18
+ <% Host.find_by_cluster(c).each do |h| %>
19
+ <tr>
20
+ <%= href = append_query_string("/host/#{h.cluster}/#{h}")
21
+ "<td><li><a href=\"#{href}\">#{h}</a></li></td>" %>
22
+ <td><%= host_helper(h) %></td>
23
+ </tr>
24
+ <% end %>
25
+ </table>
26
+ <% end %>
27
+
28
+ <%
29
+ =begin %>
30
+ <ul>
31
+ <% Check.each do |c, v| %>
32
+ <li><%= checklink(c) %> <%= stats_helper(c) %></li>
33
+ <% end %>
34
+ </ul>
35
+ <%
36
+
37
+ <h2>clusters :: hosts</h2>
38
+ <% Host.clusters.each do |c| # fixme sort elsewhere %>
39
+
40
+ <h3><a href="/cluster/<%= append_query_string(c) %>"><%= c %></a></h3>
41
+ <ul>
42
+ <% Host.find_by_cluster(c).each do |h| %>
43
+ <%= href = append_query_string("/host/#{h.cluster}/#{h}")
44
+ "<li><a href=\"#{href}\">#{h}</a> #{host_helper(h)}</li>" %>
45
+ <% end %>
46
+ </ul>
47
+ <% end %>
48
+ <%
49
+ =end %>
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hostmon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Wesley Dawson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rack
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: sinatra
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: hostlint web interface
47
+ email:
48
+ - wdawson@mozilla.com
49
+ executables:
50
+ - hostmon
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - lib/hostmon.rb
55
+ - lib/hostmon/config.rb
56
+ - lib/hostmon/version.rb
57
+ - lib/hostmon/public/css/jquery_themes/hostmon/jquery-ui-1.8.16.custom.css
58
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_inset-soft_30_ff4e0a_1x100.png
59
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_a83300_256x240.png
60
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_4b8e0b_256x240.png
61
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_glass_40_ffc73d_1x400.png
62
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_highlight-soft_15_000000_1x100.png
63
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_gloss-wave_25_333333_500x100.png
64
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_glass_40_000000_1x400.png
65
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_222222_256x240.png
66
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_flat_50_5c5c5c_40x100.png
67
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_glass_20_333333_1x400.png
68
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_cccccc_256x240.png
69
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_flat_30_cccccc_40x100.png
70
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-bg_highlight-soft_80_eeeeee_1x100.png
71
+ - lib/hostmon/public/css/jquery_themes/hostmon/images/ui-icons_ffffff_256x240.png
72
+ - lib/hostmon/public/js/jquery-ui-1.8.16.custom.min.js
73
+ - lib/hostmon/public/js/hostmon.js
74
+ - lib/hostmon/public/js/gotham.font.js
75
+ - lib/hostmon/public/js/jquery-1.6.2.min.js
76
+ - lib/hostmon/public/js/cufon.js
77
+ - lib/hostmon/public/js/product-design.font.js
78
+ - lib/hostmon/public/style.css
79
+ - lib/hostmon/public/favicon.ico
80
+ - lib/hostmon/views/view.erb
81
+ - lib/hostmon/views/search_host.erb
82
+ - lib/hostmon/views/host_status.erb
83
+ - lib/hostmon/views/cluster.erb
84
+ - lib/hostmon/views/search_checks.erb
85
+ - lib/hostmon/views/check_status.erb
86
+ - lib/hostmon/views/layout.erb
87
+ - lib/hostmon/views/status.erb
88
+ - lib/hostmon/views/check.erb
89
+ - lib/hostmon/views/search_all.erb
90
+ - lib/hostmon/views/host.erb
91
+ - lib/hostmon/views/partials/host_status_selector.erb
92
+ - lib/hostmon/views/partials/search.erb
93
+ - lib/hostmon/views/partials/hosts_selector.erb
94
+ - lib/hostmon/views/partials/status_selector.erb
95
+ - lib/hostmon/views/partials/check_status_selector.erb
96
+ - lib/hostmon/views/partials/report.erb
97
+ - lib/hostmon/models/report.rb
98
+ - lib/hostmon/models/host.rb
99
+ - lib/hostmon/models/check.rb
100
+ - lib/hostmon/models/base.rb
101
+ - lib/hostmon/models.rb
102
+ - lib/hostmon/helpers.rb
103
+ - lib/hostmon/rubyfixes.rb
104
+ - examples/config.yml
105
+ - examples/reports/network/config/bootproto_dhcp/cluster2/mach1/report_2012-06-14-15:06:12.yaml
106
+ - examples/reports/network/config/bootproto_dhcp/cluster2/mach2/report_2012-06-14-15:06:12.yaml
107
+ - examples/reports/network/config/bootproto_dhcp/cluster1/mach1/report_2012-06-28-16:49:32.yaml
108
+ - examples/reports/network/ethernet_bonded/cluster2/mach1/report_2012-06-14-15:06:12.yaml
109
+ - examples/reports/network/ethernet_bonded/cluster2/mach2/report_2012-06-14-15:06:12.yaml
110
+ - examples/reports/network/ethernet_bonded/cluster1/mach1/report_2012-06-28-16:49:32.yaml
111
+ - examples/reports/foo/cluster2/mach1/report_2012-06-14-15:06:12.yaml
112
+ - examples/reports/foo/cluster2/mach2/report_2012-06-14-15:06:12.yaml
113
+ - examples/reports/foo/cluster1/mach1/report_2012-06-28-16:49:32.yaml
114
+ - examples/reports/bad_exit_status/cluster2/mach1/report_2012-06-14-15:06:12.yaml
115
+ - examples/reports/bad_exit_status/cluster2/mach2/report_2012-06-14-15:06:12.yaml
116
+ - examples/reports/bad_exit_status/cluster1/mach1/report_2012-06-28-16:49:32.yaml
117
+ - examples/reports/yum/badcheck/cluster2/mach1/report_2012-06-14-15:06:12.yaml
118
+ - examples/reports/yum/badcheck/cluster2/mach2/report_2012-06-14-15:06:12.yaml
119
+ - examples/reports/yum/badcheck/cluster1/mach1/report_2012-06-28-16:49:32.yaml
120
+ - examples/reports/nonexec/cluster2/mach1/report_2012-06-14-15:06:12.yaml
121
+ - examples/reports/nonexec/cluster2/mach2/report_2012-06-14-15:06:12.yaml
122
+ - examples/reports/nonexec/cluster1/mach1/report_2012-06-28-16:49:32.yaml
123
+ - examples/reports/missing_prelude/cluster2/mach1/report_2012-06-14-15:06:12.yaml
124
+ - examples/reports/missing_prelude/cluster2/mach2/report_2012-06-14-15:06:12.yaml
125
+ - examples/reports/missing_prelude/cluster1/mach1/report_2012-06-28-16:49:32.yaml
126
+ - bin/hostmon
127
+ homepage: https://github.com/whd/hostlint
128
+ licenses:
129
+ - Mozilla Public License (2.0)
130
+ post_install_message:
131
+ rdoc_options: []
132
+ require_paths:
133
+ - lib
134
+ required_ruby_version: !ruby/object:Gem::Requirement
135
+ none: false
136
+ requirements:
137
+ - - ! '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ none: false
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ requirements: []
147
+ rubyforge_project:
148
+ rubygems_version: 1.8.24
149
+ signing_key:
150
+ specification_version: 3
151
+ summary: hostmon -- aggregate and display hostlint reports
152
+ test_files: []