so I''ve found myself with a few reasons to need to debug puppetd/puppetmasterd lately since we upgraded to 0.24.5 I''ve been doing this by basically throwing Puppet.notice/warning statements into the code, which feels rather primitive... How are people doing debugging? I''ve poked around a bit and looked at some options for Ruby debugging, but was wondering what other people are using .... -- Nigel Kersten Systems Administrator Tech Lead - MacOps --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve been using a combination of GDB, DTrace, puts caller and puts ''WTF'' GDB can be like staring into the abyss. DTrace seems the most powerful and promising, but a bit of a learning curve. puts is primitive, but it works. Would love to swap tips and tricks with anyone debugging Ruby in general and Puppet in specific. On Mon, Sep 8, 2008 at 8:51 AM, Nigel Kersten <nigelk@google.com> wrote:> so I''ve found myself with a few reasons to need to debug > puppetd/puppetmasterd lately since we upgraded to 0.24.5 > > I''ve been doing this by basically throwing Puppet.notice/warning statements > into the code, which feels rather primitive... > > How are people doing debugging? I''ve poked around a bit and looked at some > options for Ruby debugging, but was wondering what other people are using > .... > > > -- > Nigel Kersten > Systems Administrator > Tech Lead - MacOps > > > >--~--~---------~--~----~------------~-------~--~----~ 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 wrote:> so I''ve found myself with a few reasons to need to debug > puppetd/puppetmasterd lately since we upgraded to 0.24.5 > > I''ve been doing this by basically throwing Puppet.notice/warning > statements into the code, which feels rather primitive... > > How are people doing debugging? I''ve poked around a bit and looked at > some options for Ruby debugging, but was wondering what other people > are using ....Puppet has some weaknesses there in that it is too fragile (breaking on class syntax errors) and quiet. Here are some things I do to help mitigate those issues and visualize what is going on. Start puppetmasterd / puppetd with --verbose as default, and add --debug or use strace if things get really nasty. Put a line at the beginning of every class: notice("Reached class: name-of-class") Tie into subversion with commit hooks... 1. pre-commit hook runs puppet --parseonly to vet any syntax errors on classes 2. post-commit hook extracts the manifests/files/plugins al to where puppetmaster can see them 3. post-commit hook sends a commit notification with log message and diff output to commits@ Using puppetized nrpe agent watched by nagios to verify puppetd is running on the hosts it *should be* -- Mark Foster - Sr. Systems Engineer - BitPusher, LLC We push your bits so you don''t have to! http://www.bitpusher.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mon, 2008-09-08 at 10:39 -0600, Andrew Shafer wrote:> > I''ve been using a combination of GDB, DTrace, puts caller and puts > ''WTF'' > > GDB can be like staring into the abyss. > > DTrace seems the most powerful and promising, but a bit of a learning > curve. > > puts is primitive, but it works. > > Would love to swap tips and tricks with anyone debugging Ruby in > general and Puppet in specific.I kinda like http://rubyforge.org/projects/ruby-debug/ for general debugging, since it gives you a GDB like interface. Though often old-school ''puts'' is the easiest way to debug. David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Somewhat related when trying to improve performance is doing debugging of how long operations take. Puppet already makes some use of this, but it''s worth noting that for a given section of code, you can use the existing Benchmark code to do this. ie you can surround a code block with something like: seconds = Benchmark.realtime { # existing puppet code } Puppet.notice("Operation foo took: %0.2f seconds" % seconds) On Mon, Sep 8, 2008 at 9:39 AM, Andrew Shafer <andrew@reductivelabs.com>wrote:> > I''ve been using a combination of GDB, DTrace, puts caller and puts ''WTF'' > > GDB can be like staring into the abyss. > > DTrace seems the most powerful and promising, but a bit of a learning > curve. > > puts is primitive, but it works. > > Would love to swap tips and tricks with anyone debugging Ruby in general > and Puppet in specific. > > > > > On Mon, Sep 8, 2008 at 8:51 AM, Nigel Kersten <nigelk@google.com> wrote: > >> so I''ve found myself with a few reasons to need to debug >> puppetd/puppetmasterd lately since we upgraded to 0.24.5 >> >> I''ve been doing this by basically throwing Puppet.notice/warning >> statements into the code, which feels rather primitive... >> >> How are people doing debugging? I''ve poked around a bit and looked at some >> options for Ruby debugging, but was wondering what other people are using >> .... >> >> >> -- >> Nigel Kersten >> Systems Administrator >> Tech Lead - MacOps >> >> >> > > > >-- Nigel Kersten Systems Administrator Tech Lead - MacOps --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---