Problems with getting reporting to work

Name : foreman-release
Arch : noarch
Version : 1.1stable
Release : 3.el6

I am currently able to have a client send information (facter etc… ) to
the forman host.

However I am moving on to getting reporting enabled.
[agent] on client
report = true

On puppetmaster foreman.rb has been copied per instructions and the URL is

$foreman_url="http://xxxxx…somedomain.com"

What is interesting is when I run on a client debug shows the report being
sent over b64_zlib_yaml so a report is being written.

However when I check on the foreman node (which is also the puppetmaster)
tail -f /var/log/messages on [foreman] shows during [client] puppet agent
-t --debug
the following

May 7 10:30:26 foreman.somedomain.com puppet-master[23511]: No report
named 'samehostname as puppetmaster'

Shouldn't this be complaining about the client?

What's in your puppet master's puppet.conf? Specifically the reports=
section in [master].

[master]

autosign = $confdir/autosign.conf { mode = 664 }

autosign       = $confdir/autosign.conf { owner = service, group = 

service, mode
= 664 }
reports = FQDNhostname.of.foremannode
external_nodes = /etc/puppet/node.rb
node_terminus = exec
ca = true
[development]
modulepath =
/etc/puppet/modules/development:/etc/puppet/modules/common:/usr
/share/puppet/modules
[production]
modulepath =
/etc/puppet/modules/production:/etc/puppet/modules/common:/usr/
share/puppet/modules

··· On Tuesday, May 7, 2013 3:27:38 PM UTC-4, Greg Sutcliffe wrote: > > What's in your puppet master's puppet.conf? Specifically the reports= > section in [master]. >

Though so, this should just be a literal:

reports = foreman

Give that a whirl.

Made the change as you requested.

HUP'd my foreman, foreman-proxy, and httpd

tailing thru /var/log/messages during a client puppet agent -t reveals
FQDNforeman.hostname puppet-master[19805]: Compiled catalog for
FQDNclient.puppet.hostname in environment production in 0.01 seconds

So the error has changed… however when I check the web interface to see
of a report has made it thru I still get the default page. =(

··· ##### Here is a dump of my /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb since this would be the other bit ##### # <%= ERB.new(File.read(File.expand_path("_header.erb",File.dirname(file)))).result(binding) -%> # 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://MYFQDN.foreman.hosname

if CA is specified, remote Foreman host will be verified

$foreman_ssl_ca = “<%= @ssl_ca -%>”

ssl_cert and key are required if require_ssl_puppetmasters is enabled in

Foreman
$foreman_ssl_cert = “<%= @ssl_cert -%>”
$foreman_ssl_key = “<%= @ssl_key -%>”

require ‘puppet’
require ‘net/http’
require ‘net/https’
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)
    http.use_ssl     = uri.scheme == 'https'
    if http.use_ssl?
      if $foreman_ssl_ca && !$foreman_ssl_ca.empty?
        http.ca_file = $foreman_ssl_ca
        http.verify_mode = OpenSSL::SSL::VERIFY_PEER
      else
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end
      if $foreman_ssl_cert && !$foreman_ssl_cert.empty? &&

$foreman_ssl_key && !$foreman_ssl_key.empty?
http.cert =
OpenSSL::X509::Certificate.new(File.read($foreman_ssl_cert))
http.key = OpenSSL::PKey::RSA.new(File.read($foreman_ssl_key),
nil)
end
end
req = Net::HTTP::Post.new(“#{uri.path}/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

On Tue, May 7, 2013 at 3:35 PM, Greg Sutcliffe greg.sutcliffe@gmail.comwrote:

Though so, this should just be a literal:

reports = foreman

Give that a whirl.


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/Sh65D5x2Bno/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-DG
<— He works out.

Looking at the ssl variables at the top of the file, it looks like you've
manually copied the report processor from the module - those should be
paths to your ssl certificates. I'm out of the house just now, so I can't
provide an exact example, but if your enc node.rb is working, it probably
has the same ssl certs specified at the top.

You've definitely got my gears working.

Using the variables from the node.rb file. Thanks for the assist. I will
have to send you some beer!

I will let you know what I find.

··· On Tue, May 7, 2013 at 3:50 PM, Greg Sutcliffe wrote:

Looking at the ssl variables at the top of the file, it looks like you’ve
manually copied the report processor from the module - those should be
paths to your ssl certificates. I’m out of the house just now, so I can’t
provide an exact example, but if your enc node.rb is working, it probably
has the same ssl certs specified at the top.


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/Sh65D5x2Bno/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-DG
<— He works out.

PROFIT! Where do I send you beer? Or donate to a favorite charity?

I took the same variables from the node.rb

They are (for other people that might need the paths):
:ssl_ca => "/var/lib/puppet/ssl/certs/ca.pem",

ssl_cert and key are required if require_ssl_puppetmasters is enabled

in Foreman
:ssl_cert => "/var/lib/puppet/ssl/certs/FQDN.foremans.hostname.pem",
:ssl_key => "/var/lib/puppet/ssl/private_keys/*FQDN.foremans.hostname
*.pem"

When you make this change the URL must be the FQDN.foremans.hostname or
foreman will complain in the /var/log/messages on the foreman host.
*FQDN.foremans.hostname = being your real hostname folks

··· *

On Tue, May 7, 2013 at 3:52 PM, Dan Girard shdobxr@gmail.com wrote:

You’ve definitely got my gears working.

Using the variables from the node.rb file. Thanks for the assist. I will
have to send you some beer!

I will let you know what I find.

On Tue, May 7, 2013 at 3:50 PM, Greg Sutcliffe greg.sutcliffe@gmail.comwrote:

Looking at the ssl variables at the top of the file, it looks like you’ve
manually copied the report processor from the module - those should be
paths to your ssl certificates. I’m out of the house just now, so I can’t
provide an exact example, but if your enc node.rb is working, it probably
has the same ssl certs specified at the top.


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/Sh65D5x2Bno/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

-DG
<— He works out.

-DG
<— He works out.