Tim Lank
2010-Sep-24 10:52 UTC
[Puppet Users] obtaining stdout information from client configuration executions
puppet-users: I''m trying to find a way to obtain the stdout (and stderr) output from individual puppet client configuration runs. I''d like a central storage of this information if possible. In short, I''d like to know what the client exactly did with the configuration that it was sent. Ideally I''d like for this to be in one location so that I can write scripts to report on the results. Thanks in advance for your assistance. -- 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.
Darren Chamberlain
2010-Sep-24 16:15 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
We''re not using a puppetmaster, so we''re collecting info on runs via syslog and puppet -v: puppet -v /path/to/manifest.pp | logger -t puppet And then we''re using a splunk-alike to run ad-hon reports on the logs. * Tim Lank <timlank at timlank.com> [2010/09/24 06:52]:> I''m trying to find a way to obtain the stdout (and stderr) output > from individual puppet client configuration runs. I''d like a > central storage of this information if possible.-- Patrick''s Law: The permanence of a temporary solution rises in proportion with the urgency of its initial implementation. -- 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.
Patrick
2010-Sep-24 16:55 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
On Sep 24, 2010, at 3:52 AM, Tim Lank wrote:> puppet-users: > > I''m trying to find a way to obtain the stdout (and stderr) output from individual puppet client configuration runs. I''d like a central storage of this information if possible. > > In short, I''d like to know what the client exactly did with the configuration that it was sent. Ideally I''d like for this to be in one location so that I can write scripts to report on the results. > > Thanks in advance for your assistance.Why not use puppet''s reports or a remote syslog? -- 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.
Tim Lank
2010-Sep-24 17:08 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
Thanks. Can you elaborate on the puppet''s reports? All I see are here: http://docs.puppetlabs.com/references/latest/report.html Is there one that reports on the stdout&stderr of the tasks the client performs? (and not in YAML) The remote syslog would take some coding to cull together in a coherent and readable manner for each individual client. On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote:> > On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: > > puppet-users: > > I''m trying to find a way to obtain the stdout (and stderr) output from > individual puppet client configuration runs. I''d like a central storage of > this information if possible. > > In short, I''d like to know what the client exactly did with the > configuration that it was sent. Ideally I''d like for this to be in one > location so that I can write scripts to report on the results. > > Thanks in advance for your assistance. > > > Why not use puppet''s reports or a remote syslog? > > -- > 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.
Tim Lank
2010-Sep-24 17:59 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
A sample report that is sent back in yaml format to the puppetmaster in $vardir/puppet/reports/<puppetdclient.example.org> looks like this: --- !ruby/object:Puppet::Transaction::Report host: puppetdclient.example.org logs: - !ruby/object:Puppet::Util::Log file: /etc/puppet/manifests/templates.pp level: !ruby/sym notice line: 37 message: executed successfully source: "//Node[default]/Exec[/bin/ps aux | /bin/grep puppet | /bin/grep -v grep]/returns" tags: - exec - node - default - class - main - returns - notice time: 2010-09-24 13:53:17.465847 -04:00 version: 1285350797 I see that the source command string is there, but the stdout (and err) of the ps command does not appear in the yaml. Is there a way to turn this on so it ends up in here? On Fri, Sep 24, 2010 at 1:08 PM, Tim Lank <timlank@timlank.com> wrote:> Thanks. Can you elaborate on the puppet''s reports? All I see are here: > http://docs.puppetlabs.com/references/latest/report.html > > Is there one that reports on the stdout&stderr of the tasks the client > performs? (and not in YAML) > > The remote syslog would take some coding to cull together in a coherent and > readable manner for each individual client. > > > > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: > >> >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: >> >> puppet-users: >> >> I''m trying to find a way to obtain the stdout (and stderr) output from >> individual puppet client configuration runs. I''d like a central storage of >> this information if possible. >> >> In short, I''d like to know what the client exactly did with the >> configuration that it was sent. Ideally I''d like for this to be in one >> location so that I can write scripts to report on the results. >> >> Thanks in advance for your assistance. >> >> >> Why not use puppet''s reports or a remote syslog? >> >> -- >> 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.
Patrick
2010-Sep-24 18:05 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
On Sep 24, 2010, at 10:08 AM, Tim Lank wrote:> Thanks. Can you elaborate on the puppet''s reports? All I see are here: http://docs.puppetlabs.com/references/latest/report.html > > Is there one that reports on the stdout&stderr of the tasks the client performs? (and not in YAML)I''m almost sure the answer it no.> The remote syslog would take some coding to cull together in a coherent and readable manner for each individual client.Your solution feels like reinventing the wheel to me, but I''ll admit that I''ve never used remote syslog before. It might be easiest to put something like this in a script called by cron (after redirecting the output): puppetd --verbose --onetime --no-deamonize> > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: > > On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: > >> puppet-users: >> >> I''m trying to find a way to obtain the stdout (and stderr) output from individual puppet client configuration runs. I''d like a central storage of this information if possible. >> >> In short, I''d like to know what the client exactly did with the configuration that it was sent. Ideally I''d like for this to be in one location so that I can write scripts to report on the results. >> >> Thanks in advance for your assistance. > > Why not use puppet''s reports or a remote syslog? > > -- > 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.-- 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.
Nigel Kersten
2010-Sep-24 18:10 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
On Fri, Sep 24, 2010 at 10:08 AM, Tim Lank <timlank@timlank.com> wrote:> Thanks. Can you elaborate on the puppet''s reports? All I see are here: > http://docs.puppetlabs.com/references/latest/report.html > > Is there one that reports on the stdout&stderr of the tasks the client > performs? (and not in YAML)I believe we have a patch that should show the stderr output when an exec task fails, but I''m curious as to why you want the stdout?> > The remote syslog would take some coding to cull together in a coherent and > readable manner for each individual client. > > > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: >> >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: >> >> puppet-users: >> >> I''m trying to find a way to obtain the stdout (and stderr) output from >> individual puppet client configuration runs. I''d like a central storage of >> this information if possible. >> >> In short, I''d like to know what the client exactly did with the >> configuration that it was sent. Ideally I''d like for this to be in one >> location so that I can write scripts to report on the results. >> >> Thanks in advance for your assistance. >> >> Why not use puppet''s reports or a remote syslog? >> >> -- >> 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. >-- nigel -- 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.
Tim Lank
2010-Sep-24 18:29 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
It would be great to have it configurable, so that it could be off by default for those that don''t want it. I may be in the minority here, but having a surety of exactly what was executed and a knowledge of the output would be a good thing to me. Seems that the ability to turn this on would be a very desirable thing. Please provide the patch# you are referring to for the on_failure stderr. On Fri, Sep 24, 2010 at 2:10 PM, Nigel Kersten <nigelk@google.com> wrote:> On Fri, Sep 24, 2010 at 10:08 AM, Tim Lank <timlank@timlank.com> wrote: > > Thanks. Can you elaborate on the puppet''s reports? All I see are here: > > http://docs.puppetlabs.com/references/latest/report.html > > > > Is there one that reports on the stdout&stderr of the tasks the client > > performs? (and not in YAML) > > I believe we have a patch that should show the stderr output when an > exec task fails, but I''m curious as to why you want the stdout? > > > > > The remote syslog would take some coding to cull together in a coherent > and > > readable manner for each individual client. > > > > > > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: > >> > >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: > >> > >> puppet-users: > >> > >> I''m trying to find a way to obtain the stdout (and stderr) output from > >> individual puppet client configuration runs. I''d like a central > storage of > >> this information if possible. > >> > >> In short, I''d like to know what the client exactly did with the > >> configuration that it was sent. Ideally I''d like for this to be in one > >> location so that I can write scripts to report on the results. > >> > >> Thanks in advance for your assistance. > >> > >> Why not use puppet''s reports or a remote syslog? > >> > >> -- > >> 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. > > > > > > -- > nigel > > -- > 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.
Nigel Kersten
2010-Sep-24 18:34 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
On Fri, Sep 24, 2010 at 11:29 AM, Tim Lank <timlank@timlank.com> wrote:> It would be great to have it configurable, so that it could be off by > default for those that don''t want it. > > I may be in the minority here, but having a surety of exactly what was > executed and a knowledge of the output would be a good thing to me. Seems > that the ability to turn this on would be a very desirable thing.I understand wanting to know why an exec failed, but what are some actual use cases where you care about the stdout of an exec resource in Puppet?> > Please provide the patch# you are referring to for the on_failure stderr.http://projects.puppetlabs.com/issues/2359 covers it.> > > > On Fri, Sep 24, 2010 at 2:10 PM, Nigel Kersten <nigelk@google.com> wrote: >> >> On Fri, Sep 24, 2010 at 10:08 AM, Tim Lank <timlank@timlank.com> wrote: >> > Thanks. Can you elaborate on the puppet''s reports? All I see are here: >> > http://docs.puppetlabs.com/references/latest/report.html >> > >> > Is there one that reports on the stdout&stderr of the tasks the client >> > performs? (and not in YAML) >> >> I believe we have a patch that should show the stderr output when an >> exec task fails, but I''m curious as to why you want the stdout? >> >> > >> > The remote syslog would take some coding to cull together in a coherent >> > and >> > readable manner for each individual client. >> > >> > >> > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: >> >> >> >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: >> >> >> >> puppet-users: >> >> >> >> I''m trying to find a way to obtain the stdout (and stderr) output from >> >> individual puppet client configuration runs. I''d like a central >> >> storage of >> >> this information if possible. >> >> >> >> In short, I''d like to know what the client exactly did with the >> >> configuration that it was sent. Ideally I''d like for this to be in one >> >> location so that I can write scripts to report on the results. >> >> >> >> Thanks in advance for your assistance. >> >> >> >> Why not use puppet''s reports or a remote syslog? >> >> >> >> -- >> >> 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. >> > >> >> >> >> -- >> nigel >> >> -- >> 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. >-- nigel -- 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.
Tim Lank
2010-Sep-24 18:44 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
debugging your exec''s for one. The exec may return something that is functionally correct, but not what was intended. Granted, I am brand new to puppet within the last month or so. Conceptually, I''m sure that I don''t have a very good handle on the "puppet way" of doing things yet so I may not be able to provide a good solid set of use cases for you. On Fri, Sep 24, 2010 at 2:34 PM, Nigel Kersten <nigelk@google.com> wrote:> On Fri, Sep 24, 2010 at 11:29 AM, Tim Lank <timlank@timlank.com> wrote: > > It would be great to have it configurable, so that it could be off by > > default for those that don''t want it. > > > > I may be in the minority here, but having a surety of exactly what was > > executed and a knowledge of the output would be a good thing to me. > Seems > > that the ability to turn this on would be a very desirable thing. > > I understand wanting to know why an exec failed, but what are some > actual use cases where you care about the stdout of an exec resource > in Puppet? > > > > > > Please provide the patch# you are referring to for the on_failure stderr. > > http://projects.puppetlabs.com/issues/2359 covers it. > > > > > > > > > On Fri, Sep 24, 2010 at 2:10 PM, Nigel Kersten <nigelk@google.com> > wrote: > >> > >> On Fri, Sep 24, 2010 at 10:08 AM, Tim Lank <timlank@timlank.com> wrote: > >> > Thanks. Can you elaborate on the puppet''s reports? All I see are > here: > >> > http://docs.puppetlabs.com/references/latest/report.html > >> > > >> > Is there one that reports on the stdout&stderr of the tasks the client > >> > performs? (and not in YAML) > >> > >> I believe we have a patch that should show the stderr output when an > >> exec task fails, but I''m curious as to why you want the stdout? > >> > >> > > >> > The remote syslog would take some coding to cull together in a > coherent > >> > and > >> > readable manner for each individual client. > >> > > >> > > >> > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: > >> >> > >> >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: > >> >> > >> >> puppet-users: > >> >> > >> >> I''m trying to find a way to obtain the stdout (and stderr) output > from > >> >> individual puppet client configuration runs. I''d like a central > >> >> storage of > >> >> this information if possible. > >> >> > >> >> In short, I''d like to know what the client exactly did with the > >> >> configuration that it was sent. Ideally I''d like for this to be in > one > >> >> location so that I can write scripts to report on the results. > >> >> > >> >> Thanks in advance for your assistance. > >> >> > >> >> Why not use puppet''s reports or a remote syslog? > >> >> > >> >> -- > >> >> 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. > >> > > >> > >> > >> > >> -- > >> nigel > >> > >> -- > >> 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. > > > > > > -- > nigel > > -- > 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.
Tim Lank
2010-Sep-24 19:29 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
It looks like adding the line "logoutput => true" in the exec definition ends up sending this stdout to the centralized yaml log in the "message:" field along a separate log with the standard "executed successfully" summary. --- !ruby/object:Puppet::Transaction::Report host: puppetdclient.example.org logs: - !ruby/object:Puppet::Util::Log file: &id001 /etc/puppet/manifests/templates.pp level: !ruby/sym notice line: 38 message: root 27164 0.0 2.0 130292 41976 ? Ssl 13:53 0:02 /usr/bin/ruby /usr/sbin/puppetd source: "//Node[default]/Exec[/bin/ps aux | /bin/grep puppet | /bin/grep -v grep]/returns" tags: - exec - node - default - class - main - returns - notice time: 2010-09-24 15:23:21.562537 -04:00 version: 1285356077 - !ruby/object:Puppet::Util::Log file: *id001 level: !ruby/sym notice line: 38 message: executed successfully source: "//Node[default]/Exec[/bin/ps aux | /bin/grep puppet | /bin/grep -v grep]/returns" tags: - exec - node - default - class - main - returns - notice time: 2010-09-24 15:23:21.563504 -04:00 version: 1285356077 On Fri, Sep 24, 2010 at 2:44 PM, Tim Lank <timlank@timlank.com> wrote:> debugging your exec''s for one. The exec may return something that is > functionally correct, but not what was intended. > > Granted, I am brand new to puppet within the last month or so. > Conceptually, I''m sure that I don''t have a very good handle on the "puppet > way" of doing things yet so I may not be able to provide a good solid set of > use cases for you. > > > > On Fri, Sep 24, 2010 at 2:34 PM, Nigel Kersten <nigelk@google.com> wrote: > >> On Fri, Sep 24, 2010 at 11:29 AM, Tim Lank <timlank@timlank.com> wrote: >> > It would be great to have it configurable, so that it could be off by >> > default for those that don''t want it. >> > >> > I may be in the minority here, but having a surety of exactly what was >> > executed and a knowledge of the output would be a good thing to me. >> Seems >> > that the ability to turn this on would be a very desirable thing. >> >> I understand wanting to know why an exec failed, but what are some >> actual use cases where you care about the stdout of an exec resource >> in Puppet? >> >> >> > >> > Please provide the patch# you are referring to for the on_failure >> stderr. >> >> http://projects.puppetlabs.com/issues/2359 covers it. >> >> > >> > >> > >> > On Fri, Sep 24, 2010 at 2:10 PM, Nigel Kersten <nigelk@google.com> >> wrote: >> >> >> >> On Fri, Sep 24, 2010 at 10:08 AM, Tim Lank <timlank@timlank.com> >> wrote: >> >> > Thanks. Can you elaborate on the puppet''s reports? All I see are >> here: >> >> > http://docs.puppetlabs.com/references/latest/report.html >> >> > >> >> > Is there one that reports on the stdout&stderr of the tasks the >> client >> >> > performs? (and not in YAML) >> >> >> >> I believe we have a patch that should show the stderr output when an >> >> exec task fails, but I''m curious as to why you want the stdout? >> >> >> >> > >> >> > The remote syslog would take some coding to cull together in a >> coherent >> >> > and >> >> > readable manner for each individual client. >> >> > >> >> > >> >> > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: >> >> >> >> >> >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: >> >> >> >> >> >> puppet-users: >> >> >> >> >> >> I''m trying to find a way to obtain the stdout (and stderr) output >> from >> >> >> individual puppet client configuration runs. I''d like a central >> >> >> storage of >> >> >> this information if possible. >> >> >> >> >> >> In short, I''d like to know what the client exactly did with the >> >> >> configuration that it was sent. Ideally I''d like for this to be in >> one >> >> >> location so that I can write scripts to report on the results. >> >> >> >> >> >> Thanks in advance for your assistance. >> >> >> >> >> >> Why not use puppet''s reports or a remote syslog? >> >> >> >> >> >> -- >> >> >> 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. >> >> > >> >> >> >> >> >> >> >> -- >> >> nigel >> >> >> >> -- >> >> 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. >> > >> >> >> >> -- >> nigel >> >> -- >> 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.
Tim Lank
2010-Oct-05 00:59 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
puppet-users: in case this will help someone else besides me.... I''ve developed a simple mini-script system that can be setup on a puppetmaster to send the stdout of the last reports for each client to a set of email addresses. I find it convenient to get these results in my inbox so that I can view them at a glance, review at leisure, forward on, cut & paste elsewhere, etc... recommendations, suggestions, comments welcome. Please improve this and let me know what you did. If I''ve unknowingly re-invented something that exists, please let me know that also. 1. /usr/local/bin/mailpuprpt (takes as a parameter a comma separated list of email addresses & calls /usr/local/bin/getpupoutput - performs mailing of the final summary report) 2. /usr/local/bin/getpupoutput (processes the last report file for each client, pulls the line-oriented "message:" fields out except the confirmation, replaces ecaped tabs with actual tabs, and calls /usr/local/bin/reconstructstdout.pl) 3. /usr/local/bin/reconstructstdout.pl (returns the cleaned stdout - not including puppet-added quotation marks, and replacing puppet-escaped quotations with actual quotation marks) 1. /usr/local/bin/mailpuprpt #!/bin/bash die () { echo -e "\nusage: mailpuprpt [comma separated email list]" echo "example: mailpuprpt somebody1@somewhere.com,somebody2@somewhere.com" exit 1 } [ "$#" -eq 1 ] || die /usr/local/bin/getpupoutput | mailx -s "puppet report `date`" $1 2. /usr/local/bin/getpupoutput #!/bin/bash REPORTDIR=/var/lib/puppet/reports RECONSTRUCTSCRIPT=/usr/local/bin/reconstructstdout.pl RAWPUPOUTPUT=/tmp/rawpupoutput.tmp RECONSTRUCTEDSTDOUT=/tmp/reconstructedstdout.tmp for i in `ls $REPORTDIR` do LASTREPORT=`ls -tr $REPORTDIR/$i | tail -1` RUNTIME=`grep "time: " $REPORTDIR/$i/$LASTREPORT | tail -1 | cut -c8-` echo -e "______________________________" echo -e "$i $LASTREPORT $RUNTIME\n" grep "message: " $REPORTDIR/$i/$LASTREPORT | grep -v "executed successfully" | cut -c16- > $RAWPUPOUTPUT $RECONSTRUCTSCRIPT /bin/sed ''s:\\t:\t:g'' $RECONSTRUCTEDSTDOUT done 3. /usr/local/bin/reconstructstdout.pl #!/usr/bin/perl open(RAW, "/tmp/rawpupoutput.tmp"); open(RECONSTRUCTED, ">/tmp/reconstructedstdout.tmp"); while (<RAW>) { $line = $_; @column = split //, $line; $lastcol = ($#column - 1); if (("$column[0]" eq "\"") && ("$column[$lastcol]" eq "\"")) { my $colcounter = 1; while ($colcounter < $lastcol) { if (("$column[$colcounter]" eq "\\") && ("$column[$colcounter+1]" eq "\"")) { $colcounter++; } else { print RECONSTRUCTED "$column[$colcounter]"; $colcounter++; } } print RECONSTRUCTED "\n"; } else { print RECONSTRUCTED "$line"; } } close RAW; close RECONSTRUCTED; On Fri, Sep 24, 2010 at 3:29 PM, Tim Lank <timlank@timlank.com> wrote:> It looks like adding the line "logoutput => true" in the exec definition > ends up sending this stdout to the centralized yaml log in the "message:" > field along a separate log with the standard "executed successfully" > summary. > > --- !ruby/object:Puppet::Transaction::Report > host: puppetdclient.example.org > logs: > - !ruby/object:Puppet::Util::Log > file: &id001 /etc/puppet/manifests/templates.pp > level: !ruby/sym notice > line: 38 > message: root 27164 0.0 2.0 130292 41976 ? Ssl 13:53 > 0:02 /usr/bin/ruby /usr/sbin/puppetd > source: "//Node[default]/Exec[/bin/ps aux | /bin/grep puppet | > /bin/grep -v grep]/returns" > tags: > - exec > - node > - default > - class > - main > - returns > - notice > time: 2010-09-24 15:23:21.562537 -04:00 > version: 1285356077 > - !ruby/object:Puppet::Util::Log > file: *id001 > level: !ruby/sym notice > line: 38 > message: executed successfully > source: "//Node[default]/Exec[/bin/ps aux | /bin/grep puppet | > /bin/grep -v grep]/returns" > tags: > - exec > - node > - default > - class > - main > - returns > - notice > time: 2010-09-24 15:23:21.563504 -04:00 > version: 1285356077 > > > On Fri, Sep 24, 2010 at 2:44 PM, Tim Lank <timlank@timlank.com> wrote: >> >> debugging your exec''s for one. The exec may return something that is >> functionally correct, but not what was intended. >> >> Granted, I am brand new to puppet within the last month or so. >> Conceptually, I''m sure that I don''t have a very good handle on the "puppet >> way" of doing things yet so I may not be able to provide a good solid set of >> use cases for you. >> >> >> On Fri, Sep 24, 2010 at 2:34 PM, Nigel Kersten <nigelk@google.com> wrote: >>> >>> On Fri, Sep 24, 2010 at 11:29 AM, Tim Lank <timlank@timlank.com> wrote: >>> > It would be great to have it configurable, so that it could be off by >>> > default for those that don''t want it. >>> > >>> > I may be in the minority here, but having a surety of exactly what was >>> > executed and a knowledge of the output would be a good thing to me. >>> > Seems >>> > that the ability to turn this on would be a very desirable thing. >>> >>> I understand wanting to know why an exec failed, but what are some >>> actual use cases where you care about the stdout of an exec resource >>> in Puppet? >>> >>> >>> > >>> > Please provide the patch# you are referring to for the on_failure >>> > stderr. >>> >>> http://projects.puppetlabs.com/issues/2359 covers it. >>> >>> > >>> > >>> > >>> > On Fri, Sep 24, 2010 at 2:10 PM, Nigel Kersten <nigelk@google.com> >>> > wrote: >>> >> >>> >> On Fri, Sep 24, 2010 at 10:08 AM, Tim Lank <timlank@timlank.com> >>> >> wrote: >>> >> > Thanks. Can you elaborate on the puppet''s reports? All I see are >>> >> > here: >>> >> > http://docs.puppetlabs.com/references/latest/report.html >>> >> > >>> >> > Is there one that reports on the stdout&stderr of the tasks the >>> >> > client >>> >> > performs? (and not in YAML) >>> >> >>> >> I believe we have a patch that should show the stderr output when an >>> >> exec task fails, but I''m curious as to why you want the stdout? >>> >> >>> >> > >>> >> > The remote syslog would take some coding to cull together in a >>> >> > coherent >>> >> > and >>> >> > readable manner for each individual client. >>> >> > >>> >> > >>> >> > On Fri, Sep 24, 2010 at 12:55 PM, Patrick <kc7zzv@gmail.com> wrote: >>> >> >> >>> >> >> On Sep 24, 2010, at 3:52 AM, Tim Lank wrote: >>> >> >> >>> >> >> puppet-users: >>> >> >> >>> >> >> I''m trying to find a way to obtain the stdout (and stderr) output >>> >> >> from >>> >> >> individual puppet client configuration runs. I''d like a central >>> >> >> storage of >>> >> >> this information if possible. >>> >> >> >>> >> >> In short, I''d like to know what the client exactly did with the >>> >> >> configuration that it was sent. Ideally I''d like for this to be in >>> >> >> one >>> >> >> location so that I can write scripts to report on the results. >>> >> >> >>> >> >> Thanks in advance for your assistance. >>> >> >> >>> >> >> Why not use puppet''s reports or a remote syslog? >>> >> >> >>> >> >> -- >>> >> >> 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. >>> >> > >>> >> >>> >> >>> >> >>> >> -- >>> >> nigel >>> >> >>> >> -- >>> >> 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. >>> > >>> >>> >>> >>> -- >>> nigel >>> >>> -- >>> 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.
Daniel Pittman
2010-Oct-05 01:32 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
Tim Lank <timlank@timlank.com> writes:> I''ve developed a simple mini-script system that can be setup on a > puppetmaster to send the stdout of the last reports for each client to a set > of email addresses. I find it convenient to get these results in my inbox > so that I can view them at a glance, review at leisure, forward on, cut & > paste elsewhere, etc...Isn''t this what the tagmail system does? http://docs.puppetlabs.com/references/stable/report.html> recommendations, suggestions, comments welcome.The main comment is a general sysadmin one: make sure you only generate noise when something goes wrong, not when it goes right. Otherwise puppet will rapidly overwhelm you with reports and you will never notice the problems. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Peter Meier
2010-Oct-05 06:43 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
>> recommendations, suggestions, comments welcome. > > The main comment is a general sysadmin one: make sure you only generate noise > when something goes wrong, not when it goes right. Otherwise puppet will > rapidly overwhelm you with reports and you will never notice the problems. :)a huge +1! ~pete -- 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.
Tim Lank
2010-Oct-05 10:23 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
Thanks Daniel. I appreciate your commentary. The main difference it would appear from this and tagmail is that tagmail constantly sends numerous emails. This script is run on-demand or out of cron and harvests the stdout of all the last run reports into one summary email/report. One email when you want it and how you want it vs. hundreds or thousands every hour. I agree, this would be way too much noise and why I didn''t like the idea of tagmail. I only want a summary once in a while, not a constant flow of them. On Mon, Oct 4, 2010 at 9:32 PM, Daniel Pittman <daniel@rimspace.net> wrote:> Tim Lank <timlank@timlank.com> writes: > >> I''ve developed a simple mini-script system that can be setup on a >> puppetmaster to send the stdout of the last reports for each client to a set >> of email addresses. I find it convenient to get these results in my inbox >> so that I can view them at a glance, review at leisure, forward on, cut & >> paste elsewhere, etc... > > Isn''t this what the tagmail system does? > > http://docs.puppetlabs.com/references/stable/report.html > >> recommendations, suggestions, comments welcome. > > The main comment is a general sysadmin one: make sure you only generate noise > when something goes wrong, not when it goes right. Otherwise puppet will > rapidly overwhelm you with reports and you will never notice the problems. :) > > Regards, > Daniel > -- > ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 > ♽ made with 100 percent post-consumer electrons > > -- > 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-Oct-05 11:10 UTC
Re: [Puppet Users] obtaining stdout information from client configuration executions
On Tue, Oct 5, 2010 at 12:23 PM, Tim Lank <timlank@timlank.com> wrote:> Thanks Daniel. I appreciate your commentary. > > The main difference it would appear from this and tagmail is that > tagmail constantly sends numerous emails. This script is run > on-demand or out of cron and harvests the stdout of all the last run > reports into one summary email/report. One email when you want it and > how you want it vs. hundreds or thousands every hour. I agree, this > would be way too much noise and why I didn''t like the idea of tagmail. > I only want a summary once in a while, not a constant flow of them. > >just my two cents - this is why Foreman daily (or what ever interval) emails exists - they provide a summary of all puppet activities (with links to see more of course). another benefit is to see which hosts are not reporting... Ohad -- 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.