Matthew Macdonald-Wallace
2010-Mar-04 14:09 UTC
[Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
Hi all, After troubleshooting my foreman installation on the Foreman mailing list (thanks Ohad!) I''ve come to the conclusion that the reason why reports aren''t being generated is that since I upgraded puppet master from 0.24.x to 0.25.4, the "foreman" report is not running correctly (if at all!). The puppetmasterd is running as a Rack application and despite the fact that puppetmasterd has the following in /etc/puppet/puppetmasterd.conf [puppetmasterd] reports = log,foreman storeconfigs = true And that the report appears to be configured correctly (the actual hostname is obscured but it resolves via DNS without issue): [root@<host> reports]# pwd /usr/lib/ruby/1.8/puppet/reports [root@<host> reports]# ls foreman.rb log.rb rrdgraph.rb store.rb tagmail.rb and that foreman.rb appears to be correct: # copy this file to your report dir - e.g. /usr/lib/ruby/1.8/puppet/reports/ # add this report in your puppetmaster reports - e.g, in your puppet.conf add: # reports=log, foreman # (or any other reports you want) # URL of your Foreman installation $foreman_url="http://foreman.<host>:3000" require ''puppet'' require ''net/http'' require ''uri'' Puppet::Reports.register_report(:foreman) do Puppet.settings.use(:reporting) desc "Sends reports directly to Foreman" def process begin uri = URI.parse($foreman_url) http = Net::HTTP.new(uri.host, uri.port) if uri.scheme == ''https'' then http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end req = Net::HTTP::Post.new("/reports/create?format=yml") req.set_form_data({''report'' => to_yaml}) response = http.request(req) rescue Exception => e raise Puppet::Error, "Could not send report to Foreman at #{$foreman_url}/reports/create?format=yml: #{e}" end end end and that the config.ru has been updated for puppetmaster 0.25.4: # a config.ru, for use with every rack-compatible webserver. # SSL needs to be handled outside this, though. # if puppet is not in your RUBYLIB: # $:.unshift(''/opt/puppet/lib'') $0 = "puppetmasterd" require ''puppet'' # if you want debugging: # ARGV << "--debug" ARGV << "--rack" require ''puppet/application/puppetmasterd'' # we''re usually running inside a Rack::Builder.new {} block, # therefore we need to call run *here*. run Puppet::Application[:puppetmasterd].run I am not even seeing an attempt to run the foreman report. Foreman is working fine and is serving web pages, it was also working fine with the reports up until the puppetmaster upgrade. Can anyone help? I can provide more information if required. PF -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Andrew Dickson
2010-Mar-04 21:09 UTC
Re: [Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
are you sure foreman-report.rb is in your lib directory and named "foreman.rb"? This caught me, but I think you would see error messages about not being able to find a report named foreman. If you copied it into a version specific location, and then updated your puppet gem to a new version, puppet might not be able to find the report. -drew On Thu, Mar 4, 2010 at 6:09 AM, Matthew Macdonald-Wallace <mattmacwall@gmail.com> wrote:> Hi all, > > After troubleshooting my foreman installation on the Foreman mailing > list (thanks Ohad!) I''ve come to the conclusion that the reason why > reports aren''t being generated is that since I upgraded puppet master > from 0.24.x to 0.25.4, the "foreman" report is not running correctly > (if at all!). >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Matthew Macdonald-Wallace
2010-Mar-04 21:33 UTC
Re: [Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
Yup, it''s definitely there and it''s definitely got the right name. :( M On 4 March 2010 21:09, Andrew Dickson <drew@number88.com> wrote:> are you sure foreman-report.rb is in your lib directory and named > "foreman.rb"? This caught me, but I think you would see error > messages about not being able to find a report named foreman. If you > copied it into a version specific location, and then updated your > puppet gem to a new version, puppet might not be able to find the > report. > > -drew > > On Thu, Mar 4, 2010 at 6:09 AM, Matthew Macdonald-Wallace > <mattmacwall@gmail.com> wrote: >> Hi all, >> >> After troubleshooting my foreman installation on the Foreman mailing >> list (thanks Ohad!) I''ve come to the conclusion that the reason why >> reports aren''t being generated is that since I upgraded puppet master >> from 0.24.x to 0.25.4, the "foreman" report is not running correctly >> (if at all!). >> > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Matthew Macdonald-Wallace
2010-Mar-05 10:11 UTC
Re: [Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
I''ve had a thought about this overnight (my brain seems to work better when I''m asleep!) Is there a newer version of the foreman.rb report intended for use with puppetmaster 0.25.x? I know the config.ru changed for the RACK application, I''m wondering if I need to make further changes. Thanks, M. On 4 March 2010 21:33, Matthew Macdonald-Wallace <mattmacwall@gmail.com> wrote:> Yup, it''s definitely there and it''s definitely got the right name. > > :( > > M > > On 4 March 2010 21:09, Andrew Dickson <drew@number88.com> wrote: >> are you sure foreman-report.rb is in your lib directory and named >> "foreman.rb"? This caught me, but I think you would see error >> messages about not being able to find a report named foreman. If you >> copied it into a version specific location, and then updated your >> puppet gem to a new version, puppet might not be able to find the >> report. >> >> -drew >> >> On Thu, Mar 4, 2010 at 6:09 AM, Matthew Macdonald-Wallace >> <mattmacwall@gmail.com> wrote: >>> Hi all, >>> >>> After troubleshooting my foreman installation on the Foreman mailing >>> list (thanks Ohad!) I''ve come to the conclusion that the reason why >>> reports aren''t being generated is that since I upgraded puppet master >>> from 0.24.x to 0.25.4, the "foreman" report is not running correctly >>> (if at all!). >>> >> >> -- >> You received this message because you are subscribed to the Google Groups "Puppet Users" group. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >> >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Matt
2010-Mar-05 10:38 UTC
Re: [Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
On 5 March 2010 10:11, Matthew Macdonald-Wallace <mattmacwall@gmail.com>wrote:> I''ve had a thought about this overnight (my brain seems to work better > when I''m asleep!) > > Is there a newer version of the foreman.rb report intended for use > with puppetmaster 0.25.x? > > I know the config.ru changed for the RACK application, I''m wondering > if I need to make further changes.Are you running Foreman 0.1.3? My foreman.rb on a x86_64 box is in :- /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb And consists of:- $foreman_url="http://your.foreman.url" require ''puppet'' require ''net/http'' require ''uri'' Puppet::Reports.register_report(:foreman) do Puppet.settings.use(:reporting) desc "Sends reports directly to Foreman" def process begin Net::HTTP.post_form(URI.parse("#{$foreman_url}/reports/create?format=yml"), {''report''=> to_yaml}) rescue Exception => e raise Puppet::Error, "Could not send report to Foreman: #{e}" end end end /etc/puppet/puppet.conf [puppetmasterd] reports=log, foreman -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Matthew Macdonald-Wallace
2010-Mar-05 11:53 UTC
Re: [Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
Um, yeah, so that''s completely different to what I''ve got... :( I''ll get a copy of that script and install it now. On 5 March 2010 10:38, Matt <mattmoran76@gmail.com> wrote:> On 5 March 2010 10:11, Matthew Macdonald-Wallace <mattmacwall@gmail.com> > wrote: >> >> I''ve had a thought about this overnight (my brain seems to work better >> when I''m asleep!) >> >> Is there a newer version of the foreman.rb report intended for use >> with puppetmaster 0.25.x? >> >> I know the config.ru changed for the RACK application, I''m wondering >> if I need to make further changes. > > Are you running Foreman 0.1.3? My foreman.rb on a x86_64 box is in :- > /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb > And consists of:- > $foreman_url="http://your.foreman.url" > require ''puppet'' > require ''net/http'' > require ''uri'' > Puppet::Reports.register_report(:foreman) do > Puppet.settings.use(:reporting) > desc "Sends reports directly to Foreman" > def process > begin > > Net::HTTP.post_form(URI.parse("#{$foreman_url}/reports/create?format=yml"), > {''report''=> to_yaml}) > rescue Exception => e > raise Puppet::Error, "Could not send report to Foreman: #{e}" > end > end > end > > /etc/puppet/puppet.conf > [puppetmasterd] > reports=log, foreman > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ohad Levy
2010-Mar-05 12:01 UTC
Re: [Puppet Users] Issues with reporting to foreman under puppet-server 0.25.4 (installed from Epel)
Matt actually has the older version (the diff between them is SSL support). can you check your puppet master logs? does it say something like processing report for foreman ? does your clients have the report=true option? Ohad On Fri, Mar 5, 2010 at 7:53 PM, Matthew Macdonald-Wallace < mattmacwall@gmail.com> wrote:> Um, yeah, so that''s completely different to what I''ve got... :( > > I''ll get a copy of that script and install it now. > > On 5 March 2010 10:38, Matt <mattmoran76@gmail.com> wrote: > > On 5 March 2010 10:11, Matthew Macdonald-Wallace <mattmacwall@gmail.com> > > wrote: > >> > >> I''ve had a thought about this overnight (my brain seems to work better > >> when I''m asleep!) > >> > >> Is there a newer version of the foreman.rb report intended for use > >> with puppetmaster 0.25.x? > >> > >> I know the config.ru changed for the RACK application, I''m wondering > >> if I need to make further changes. > > > > Are you running Foreman 0.1.3? My foreman.rb on a x86_64 box is in :- > > /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb > > And consists of:- > > $foreman_url="http://your.foreman.url" > > require ''puppet'' > > require ''net/http'' > > require ''uri'' > > Puppet::Reports.register_report(:foreman) do > > Puppet.settings.use(:reporting) > > desc "Sends reports directly to Foreman" > > def process > > begin > > > > > Net::HTTP.post_form(URI.parse("#{$foreman_url}/reports/create?format=yml"), > > {''report''=> to_yaml}) > > rescue Exception => e > > raise Puppet::Error, "Could not send report to Foreman: #{e}" > > end > > end > > end > > > > /etc/puppet/puppet.conf > > [puppetmasterd] > > reports=log, foreman > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.