Do you personally use something 
more comprehensive with all fields
enabled?

> On Dec 12, 2013, at 4:59 PM, Dan White <y...@comcast.net> wrote:
> 
> 
>> On Dec 12, 2013, at 6:20 PM, Stuart Cracraft <smcracr...@gmail.com> wrote:
>> 
>> 
>> Hi everybody,
>> 
>> Is there a command-line program which parses:
>> 
>>  puppetmasters*:/var/lib/puppet/reports/*/*.yaml
>> 
>> into simple a simple (though lengthy) report perhaps with
>> column/field/etc. selection based on a straightforward method.
>> 
>> Holler if you know of any. I know this was queried by me
>> on this list recently and all sorts of stuff was posted. If
>> I don't get it here, I'll need to go over to puppet-developers
>> and ask there.
>> 
>> Surely, someone has written something they're proud of and
>> will share it forward.
>> 
>> Stuart
> 
> 
>> On Nov 26, 2013, at 2:27 PM, Dan White <y...@comcast.net> wrote:
>> 
>> Reference: http://docs.puppetlabs.com/puppet/3/reference/format_report.html
>> 
>> Start with this:
>> ----------------------------------------------------------------------------------------
>> #!/usr/bin/ruby 
>> 
>> require 'puppet'
>> if defined?(ARGV)
>>   filename = ARGV.first
>> 
>>   if defined?(filename)
>>       report = YAML.load_file(filename)
>>       print "Report for : "
>>       puts report.host
>>       print "Started : "
>>       puts report.time
>>       print "Log count: "
>>       puts report.logs.size
>>       print "Metrics count: "
>>       puts report.metrics.size
>>       print "Resource Status count: "
>>       puts report.resource_statuses.size
>>       print "Status: "
>>       puts report.status
>> 
>>       report.logs.each do |logg|
>>           puts "LOG ---------------------------------------------"
>>           if logg.file
>>               print "File: "
>>               puts logg.file
>>           end
>> 
>>           if logg.line
>>               print "Line: "
>>               puts logg.line
>>           end
>> 
>>           print "Level: "
>>           puts logg.level
>>           print "Message: "
>>           puts logg.message
>>           print "Source: "
>>           puts logg.source
>>           print "Tags: "
>>           puts logg.tags.join(" ")
>>           print "Time: "
>>           puts logg.time
>>       end
>> 
>>       report.resource_statuses.keys.each do |kk|
>>           if report.resource_statuses["#{kk}"].change_count > 0
>>               puts "RESOURCE STATUS ===================================="
>>               puts "#{kk} "
>>               report.resource_statuses["#{kk}"].events.each do |line|
>>                   print "property: "
>>                   puts line.property
>>                   print "message: "
>>                   puts line.message
>>                   print "name: "
>>                   puts line.name
>>                   print "status: "
>>                   puts line.status
>>                   print "when: "
>>                   puts line.time
>>               end
>>           end
>>       end
>>       puts "-------------------------------------------------"
>>   end
>> end
>> ------------------------------------------------------------------------------------------
>> 
>> Good luck.
>> 
>> 
>> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
>> the universe is that none of it has tried to contact us.”
>> Bill Waterson (Calvin & Hobbes)
>> 
>> ----- Original Message -----
>> From: "Stuart Cracraft" <smcracr...@me.com>
>> To: puppet-users@googlegroups.com
>> Sent: Tuesday, November 26, 2013 2:10:53 PM
>> Subject: Re: [Puppet Users] get a *structured* version of the puppet agent 
>> output
>> 
>> Who will share a report generator for the yaml reports generated by puppet 
>> so that we do not have to reinvent wheel after wheel after wheel!!!!!!
>> 
>>> On Nov 26, 2013, at 11:08 AM, "R.I.Pienaar" <r...@devco.net> wrote:
>>> 
>>> 
>>> 
>>> ----- Original Message -----
>>>> From: "Stuart Cracraft" <smcracr...@gmail.com>
>>>> To: puppet-users@googlegroups.com
>>>> Sent: Tuesday, November 26, 2013 7:02:42 PM
>>>> Subject: Re: [Puppet Users] get a *structured* version of the puppet agent 
>>>> output
>>>> 
>>>> What we want is not more complexity, but more simplicity!
>>>> 
>>>> I could go into
>>>> 
>>>> puppet config print reportdir
>>>> 
>>>> and then to its
>>>> 
>>>> /var/lib/puppet/reports
>>>> 
>>>> then to the host directories of interest and grep out message.
>>>> 
>>>> But that seems a very sorry state of affairs.
>>>> 
>>>> Puppetmasters speak UP!
>>> 
>>> you do not need to grep out anything, as I showed you there is a ruby API
>>> for accessing this data.
>>> 
>>> If you use PuppetDB it will also be able to store this information and it 
>>> has
>>> APIs for extracting these logs in a structured manner.
>>> 
>>> API access is about as much as you can hope for I think.  Your alternatives 
>>> are
>>> to write a logger plugin for Puppet that outputs JSON, I've done this and it
>>> was not clear sailing.
> 
> 
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.” 
> Bill Waterson (Calvin & Hobbes)
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Puppet Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/puppet-users/GxeE-URziu8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/F5C8FE40-A9A0-4A8C-84B6-4BFDDD937ADD%40comcast.net.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/F00BCA03-423F-4381-AA78-01F2A75318C7%40me.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to