Project

General

Profile

« Previous | Next » 

Revision ad7ccf6a

Added by Brian Gupta about 12 years ago

  • ID ad7ccf6aa1e4cf49fce182f82b512e630741b4cd

Dashboard "Good hosts" should exclude "pending" hosts, refs #1617

View differences:

app/controllers/dashboard_controller.rb
:active_hosts_ok => @hosts.recent.with_changes.without_error.count,
:active_hosts_ok_enabled => @hosts.recent.with_changes.without_error.alerts_enabled.count,
:ok_hosts => @hosts.recent.successful.count,
:ok_hosts_enabled => @hosts.recent.successful.count,
:ok_hosts_enabled => @hosts.recent.successful.alerts_enabled.count,
:out_of_sync_hosts => @hosts.out_of_sync.count,
:out_of_sync_hosts_enabled => @hosts.out_of_sync.alerts_enabled.count,
:disabled_hosts => @hosts.alerts_disabled.count,
app/helpers/dashboard_helper.rb
def render_overview report, options = {}
data = [[:Active, report[:active_hosts_ok_enabled]],
[:Error, report[:bad_hosts_enabled]],
[:OK, report[:ok_hosts]],
[:OK, report[:ok_hosts_enabled]],
[:'Pending changes', report[:pending_hosts_enabled]],
[:'Out of sync', report[:out_of_sync_hosts_enabled]],
[:'No report', report[:reports_missing]],
app/views/dashboard/index.html.erb
<td><%= @report[:bad_hosts_enabled] %> </td>
</tr>
<tr>
<td><%=searchable_links "Good Host Reports in the last #{Setting[:puppet_interval]+5} minutes", "last_report > \"#{Setting[:puppet_interval]+5} minutes ago\" and status.enabled = true and status.applied = 0 and status.failed = 0" %></td>
<td> <%= "#{@report[:good_hosts_enabled] - @report[:active_hosts_ok_enabled]} / #{@report[:total_hosts]}" %> hosts (<%= @report[:percentage] %>%)</td>
<td><%=searchable_links "Good Host Reports in the last #{Setting[:puppet_interval]+5} minutes", "last_report > \"#{Setting[:puppet_interval]+5} minutes ago\" and status.enabled = true and status.applied = 0 and status.failed = 0 and status.pending = 0" %></td>
<td> <%= "#{@report[:ok_hosts_enabled]} / #{@report[:total_hosts]}" %> hosts (<%= @report[:percentage] %>%)</td>
</tr>
<tr>
<td><%= searchable_links 'Hosts that had pending changes', 'status.pending > 0 and status.enabled = true' %></td>

Also available in: Unified diff