Felix Müller
2012-Dec-04 15:40 UTC
[Puppet Users] Puppet agent exit code for monitoring script
Hello, I would like to build a script, which notifies me, when a production host notices, that there change on a host, based on the Puppet exit codes without executing it. This doesn''t returns a code. According to several posts on the web it should work. (I know that --test should also inherit --detailed-exitcode). But it didn''t work for me: puppet agent --test --noop --detailed-exitcode I''d like to avoid to build a bash wrapper around it if Puppet provides already the function to dry-run and return an exit code, so I can build it entirely in Ruby. Would really appreciate it if somebody could help. Best regards, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/N01BOTmDwV4J. 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.
Andreas Ntaflos
2012-Dec-04 16:35 UTC
Re: [Puppet Users] Puppet agent exit code for monitoring script
On 04/12/12 16:40, Felix Müller wrote:> Hello, > > I would like to build a script, which notifies me, when a production > host notices, that there change on a host, based on the Puppet exit > codes without executing it.Probably easier and more effective to examine /var/lib/puppet/state/last_run_summary.yaml. As obvious from the filename it contains information about the latest Puppet run in a simple YAML format. Andreas
R.I.Pienaar
2012-Dec-04 19:41 UTC
Re: [Puppet Users] Puppet agent exit code for monitoring script
----- Original Message -----> From: "Andreas Ntaflos" <daff@pseudoterminal.org> > To: puppet-users@googlegroups.com > Sent: Tuesday, December 4, 2012 6:35:12 PM > Subject: Re: [Puppet Users] Puppet agent exit code for monitoring script > > On 04/12/12 16:40, Felix Müller wrote: > > Hello, > > > > I would like to build a script, which notifies me, when a > > production > > host notices, that there change on a host, based on the Puppet exit > > codes without executing it. > > Probably easier and more effective to examine > /var/lib/puppet/state/last_run_summary.yaml. As obvious from the > filename it contains information about the latest Puppet run in a > simple > YAML format.there''s a check script that uses this file @ https://github.com/ripienaar/monitoring-scripts/blob/master/puppet/check_puppet.rb the file has a lot of strange behaviors, sometimes empty, sometimes full of values etcetc. the script above attempt to handle those well -- 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.