Project

General

Profile

Actions

Feature #226

closed

Return OutofSync, Error Host list from Dashboard controller as YAML

Added by Bash Shell about 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

It is helpful to retrieve the OutofSync Host list via YAML.

This list can be copied easily from the browser or can be retrieved via wget as input to a script.

The script can then use ssh/func/mcollective etc to login and check why the host is Out of Sync (or in Error and restart puppet if necessary)

A patch for OutofSync against "develop" is attached.

diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 3bf6384..e0e81cb 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -20,10 +20,16 @@ class DashboardController < ApplicationController
   end

   def OutOfSync
-    hosts = Host.out_of_sync.paginate(:page => params[:page], :order => 'last_report DESC')
-    render :partial => "hosts/minilist", :layout => true, :locals => {
-      :hosts => hosts,
-      :header => "Hosts which didnt run puppet in the last #{SETTINGS[:puppet_interval]} minutes" }
+    respond_to do |format|
+      format.html {
+      hosts = Host.out_of_sync.paginate(:page => params[:page], :order => 'last_report DESC')
+         render :partial => "hosts/minilist", :layout => true, :locals => {
+                :hosts => hosts,
+                :header => "Hosts which didnt run puppet in the last #{SETTINGS[:puppet_interval]} minutes" }
+      }
+      oos_list = Host.out_of_sync.each {|host| host.name<<"\n"}
+      format.yml { render :text => oos_list }
+    end
   end

   private


Files

dashboard_oos_yaml.patch dashboard_oos_yaml.patch 1.09 KB Bash Shell, 04/28/2010 11:32 PM
dash226.patch dash226.patch 2.58 KB Bash Shell, 05/02/2010 07:05 AM
Actions

Also available in: Atom PDF