reduced "verbose" output

123 views
Skip to first unread message

David Bishop

unread,
Feb 15, 2011, 4:27:00 PM2/15/11
to puppet...@googlegroups.com
We're starting to integrate mcollective into our puppet usage here at
work, and we've discovered a (heretofore unknown) need for more logging
"levels".

Using the puppetd mcollective agent, we would like to kick off single
puppet runs. What we're hoping for is that we could take the output from
puppet, and return the results to the person running mc-puppetd. That's
possible now, but the results are pretty ugly (even when using
--color=false, to take out most of the odd control-characters).

In a perfect world, we could have three possible "verbosity" levels:

1) Only show errors (failures to compile the catalog, "fails", etc)

2) #1 + all changes (Anything "notice", in a normal --test run), but
without the diffs that you would normally get or anything "info" level.

3) The full output (What you get with --verbose now) including info
(loading custom facts, diffs to changed files, etc).

Does this sound reasonable? Is it currently possible (and if so,
pointers are welcome!)? If I could make my trained developer monkey do
the actual work, would patches implementing this be accepted?

Have a great day!

David

signature.asc

donavan

unread,
Feb 16, 2011, 2:50:32 AM2/16/11
to Puppet Users
On Feb 15, 1:27 pm, David Bishop <tean...@gmail.com> wrote:
> Does this sound reasonable?  Is it currently possible (and if so,
> pointers are welcome!)?  If I could make my trained developer monkey do
> the actual work, would patches implementing this be accepted?

You may also be interested in the --summarize option if you're
catching stdout.

As far as I know transaction reports are only serialized and sent to
the server[1]. The server is what actually processes the 'reports'
config parameter.

I'd really like alternate agent report methods as well. I think you'd
be well served by outputting structured 'report' data from the agent.
Emitting something like @metrics.to_json and then catching it with
'reply[:output] = JSON.parse(%x[#{@puppetd} --onetime --
reports=json,rest])' would be swell.

[1] lib/puppet/application/agent.rb:
Puppet::Transaction::Report.terminus_class = :rest

donavan

unread,
Feb 16, 2011, 3:30:57 AM2/16/11
to Puppet Users
On Feb 15, 1:27 pm, David Bishop <tean...@gmail.com> wrote:
> In a perfect world, we could have three possible "verbosity" levels:
>
> 1) Only show errors (failures to compile the catalog, "fails", etc)
>
> 2) #1 + all changes (Anything "notice", in a normal --test run), but
> without the diffs that you would normally get or anything "info" level.
>
> 3) The full output (What you get with --verbose now) including info
> (loading custom facts, diffs to changed files, etc).
>

David,

I got a bit sidetracked there. Puppet logs with the standard syslog
levels internally[2]. The 'agent' application only accepts switches
for the 'debug' and 'info' levels currently[3]. I suspect that most of
the internal actions are debug/info/warn/err, so there's probably not
enough variance. Currently you're looking at all this through
the :console log destination[4]. A new destination that outputs
structured data may do what you want too. Then you could call --
logdest json and parse that back on the mc agent.

Sending a copy of the 'report' metrics back to the mc client is
probably the best way to get what you want. Then your clients can
filter what they care about. For that you;d need a new terminus
besides 'rest'. If there's not an open RFE for this I'd open one.
Looks like #4712 [5] may be related.

[2] lib/puppet/util/log.rb
[3] lib/puppet/application/agent.rb#setup_logs
[4] lib/puppet/util/log/destinations.rb
[5] http://projects.puppetlabs.com/issues/4712
Reply all
Reply to author
Forward
0 new messages