Thanks for the pointers Dominic, I'll check them out later this week and report back with my findings!
On Mon, Jan 23, 2012 at 11:34, Dominic Cleal <dcl...@redhat.com> wrote: > Hi Walter, > > [ CCing the augeas-devel list, as that's the best place for Augeas lens > problems and help ] > > On 22/01/12 20:48, Walter Heck wrote: >> Hi all, >> >> I'm trying to come up with a lens for the zabbix agent config files. I >> find the lens language untransparent at best, so I'm struggeling to >> figure out what's up. The debugging possibilities are extremely >> limited. Here's what I have now: > > For debugging, I'd strongly recommend creating a test file, which you > can do this simply with your existing Zabbix config. I've created a > sample here that uses the head -n25 output you pasted - I suggest you > fill in the rest: > https://gist.github.com/1662040 > > Store it in lenses/tests/test_zabbix_agent.aug and then you can run: > augparse -I lenses/ lenses/tests/test_zabbix_agent.aug > > (with your new lens under the lenses directory) > > No output means the lens has checked out fine and the output tree (in > the bottom half of the test) matches the input file at the top. > >> And the augeas output (all empty): >> == >> [/etc/puppet] # augparse /usr/share/augeas/lenses/contrib/zabbix_agent.aug >> [/etc/puppet] # augtool -e ls /files/etc/zabbix/zabbix_agentd.conf >> == > > Since the output of head -n25 works perfectly for me, I suspect the > problem might be parsing something in the remainder of the file. > > Try running "print /augeas//error" from within augtool and see if you > get /files/etc/zabbix/zabbix_agentd.conf listed. This wiki page > explains how to parse the parse errors: > http://augeas.net/page/Tracking_down_errors > > There are some other useful tutorials about creating lenses, the > ambiguity problems you might hit and other subjects on the wiki: > http://augeas.net/page/Main_Page > > If you manage to solve it, please do consider sending your new lens (and > accompanying test) upstream to the augeas-devel list, we'd love to > include it. > > Hope that helps. > > -- > Dominic Cleal > Red Hat Consulting > m: +44 (0)7817 878113 -- Walter Heck -- follow @walterheck on twitter to see what I'm up to! -- Check out my new startup: Server Monitoring as a Service @ http://tribily.com Follow @tribily on Twitter and/or 'Like' our Facebook page at http://www.facebook.com/tribily -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.