Project

General

Profile

Actions

Feature #124

closed

Support run interval other than default 30 minutes

Added by John Warburton almost 15 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet integration
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Our run interval is set to 1 hour rather than the puppet default of 30 minutes. It is currently hardwired in foreman rather than a global variable

This means the foreman dashboard shows servers as being out of sync half the time.

I have made changes locally to the following files but my ruby is very poor, so I really shouldn't submit a patch, but more like pseudo code:

need to define runinterval global variable - default to 30

./app/controllers/dashboard_controller.rb

<     time = Time.now.utc - 35.minutes
>     time = Time.now.utc - (@runinterval+5).minutes

./app/views/dashboard/index.html.erb

<   <p>Good Host Reports in the last 30 minutes <%= "#{@good_hosts} / #{@total_hosts}" %> hosts</p>
---
>   <p>Good Host Reports in the last <%= "#{@runinterval}" %> minutes <%= "#{@good_hosts} / #{@total_hosts}" %> hosts</p>
10,12c10,12
<   <%= graph("bar",:title => "Run Distribution in the last 30 minutes", :data =>  @puppet_runs,
<             :line_colors => '0077CC', :bar_width_and_spacing => 25,:axis_with_labels => ["x","y"],
<             :axis_labels => [(1..(30/@interval)).map{|t| t*@interval}, @puppet_runs.sort.uniq], :legend => "Clients")
---
>   <%= graph("bar",:title => "Run Distribution in the last #{@runinterval} minutes", :data =>  @puppet_runs,
>             :line_colors => '0077CC', :bar_width_and_spacing => 20,:axis_with_labels => ["x","y"],
>             :axis_labels => [(1..(@runinterval/@interval)).map{|t| t*@interval}, @puppet_runs.sort.uniq], :legend => "Clients")

./app/models/report.rb

<       no_report       = (host.puppet_status & 0x40000000) >> 30
---
>       no_report       = (host.puppet_status & 0x40000000) >> @runinterval
99c99
<     (1..(30 / interval)).each do |i|
---
>     (1..(@runinterval / interval)).each do |i|

I can't find the code in the "Hosts" view which determines whether the "Last report" should be a green tick or red cross, but it looks time dependent too.

Thanks

John

Actions

Also available in: Atom PDF