Actions
Feature #226
closedReturn OutofSync, Error Host list from Dashboard controller as YAML
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
Actions