Project

General

Profile

Actions

Feature #124

closed

Support run interval other than default 30 minutes

Added by John Warburton over 14 years ago. Updated about 14 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 #1

Updated by Ohad Levy over 14 years ago

yes, this makes a lot of sense. I'll try to get it in 0-1.4

Actions #2

Updated by Karl Pietri over 14 years ago

the image that was mentioned is fixed by changing no_report method in app/models/host.rb

just a helpful note as i don't have a patch i just changed the hard coded value =)

Actions #3

Updated by Ohad Levy over 14 years ago

  • Target version set to 0.1-3
Actions #4

Updated by Ohad Levy over 14 years ago

  • Category changed from Dashboard to Puppet integration
  • Status changed from New to Assigned
  • Assignee set to Ohad Levy
Actions #5

Updated by Ohad Levy over 14 years ago

  • Target version changed from 0.1-3 to 0.1-4
Actions #6

Updated by Ohad Levy about 14 years ago

  • Status changed from Assigned to Ready For Testing
  • % Done changed from 0 to 100
Actions #7

Updated by Ohad Levy about 14 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF