Re: [Puppet Users] Re: New Puppet report processors...

2011-06-24 Thread Don
Ok, here's the report processor to send events to Zenoss, based off
James' Zendesk module.

https://github.com/donjohnson/puppet-zenoss

-Don
Release Engineer / Toolsmith, VerticalResponse

On Wed, Jun 8, 2011 at 6:09 PM, Don auder...@gmail.com wrote:
 Thanks for the help off-list, James.

 here's the stub I'm using to check if the log is error-ful, inside of
 process():

   def process

     failure = false

     #iterate through each log object and look for failures
     self.logs.each do |log|
   if log.level.to_s == 'err' || 'alert' || 'emerg' || 'crit'
     failure = true
   end
     end

     if failure
   Puppet.debug Creating Zenoss event for failed run on #{self.host}.
 ###

 This definitely costs a few more cycles than with 2.6.5+.

 I'll publish the rest of the Zenoss processor on github tomorrow or Friday.

 -Don

 On Wed, Jun 8, 2011 at 5:23 PM, James Turnbull ja...@puppetlabs.com wrote:

 Don wrote:
 
  I'm running 2.6.4 on the master  client. pluginsync is true on both,
  and reports = zenoss only on the master for this test.
 
  Why is self.status not working in this case?
 

 The issue is that status is only available in the V2 report format in
 Puppet 2.6.5 and onwards. Before this you need to check for err tags
 to find failed runs.

 Regards

 James Turnbull

 --
 James Turnbull
 Puppet Labs
 1-503-734-8571

 --
 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.




-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-24 Thread Craig White
I'm psyched... I think I have my boss almost ready to implement Zenoss and 
still only see small benefits to using Dashboard.

Craig

On Jun 24, 2011, at 10:53 AM, Don wrote:

 Ok, here's the report processor to send events to Zenoss, based off
 James' Zendesk module.
 
 https://github.com/donjohnson/puppet-zenoss
 
 -Don
 Release Engineer / Toolsmith, VerticalResponse
 
 On Wed, Jun 8, 2011 at 6:09 PM, Don auder...@gmail.com wrote:
 Thanks for the help off-list, James.
 
 here's the stub I'm using to check if the log is error-ful, inside of
 process():
 
   def process
 
 failure = false
 
 #iterate through each log object and look for failures
 self.logs.each do |log|
   if log.level.to_s == 'err' || 'alert' || 'emerg' || 'crit'
 failure = true
   end
 end
 
 if failure
   Puppet.debug Creating Zenoss event for failed run on #{self.host}.
 ###
 
 This definitely costs a few more cycles than with 2.6.5+.
 
 I'll publish the rest of the Zenoss processor on github tomorrow or Friday.
 
 -Don
 
 On Wed, Jun 8, 2011 at 5:23 PM, James Turnbull ja...@puppetlabs.com wrote:
 
 Don wrote:
 
 I'm running 2.6.4 on the master  client. pluginsync is true on both,
 and reports = zenoss only on the master for this test.
 
 Why is self.status not working in this case?
 
 
 The issue is that status is only available in the V2 report format in
 Puppet 2.6.5 and onwards. Before this you need to check for err tags
 to find failed runs.
 
 Regards
 
 James Turnbull
 
 --
 James Turnbull
 Puppet Labs
 1-503-734-8571
 
 --
 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.
 
 
 
 
 -- 
 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.
 

-- 
Craig White ~~  craig.wh...@ttiltd.com
1.800.869.6908 ~~~ www.ttiassessments.com 

Need help communicating between generations at work to achieve your desired 
success? Let us help!

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread James Turnbull
treydock wrote:
 My [master] has :
 
 report = true
 reports = http, store, xmpp
 pluginsync = true
 
 The [agent] includes:
report = true
listen = true
pluginsync = true
 
 
 The second agent I tested with also has the same configuration as the
 above [agent]
 
 Correct, the xmpp.yaml has all that information.  What I was asking
 about the remote client not having mail.yaml is I enabled pluginsync
 on the remove client to see if the results would differ and it failed
 stating the mail.yaml was missing (locally on the client).  But if the
 repots = xmpp is only defined for [master] then should I not include
 pluginsync = true on the clients?
 
 

So you don't have anything like the line:

Sending status for name.of.host to XMMP user jabber.user

in your Puppet master syslog.

Regards

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread James Turnbull
Craig wrote:
 Hi,
 
 These sample reports have been very useful, thanks!
 
 Is there is a way to only send a report once every 24 hours (say)?
 For example, I want to know about failed runs, but not every time
 someone is hacking around, changing something, re-running etc.
 
 I can think of all sorts of workarounds, just wondering if there's
 something built in to help here.
 

There isn't currently - all of the report processors that trigger on
failed runs trigger on all failed runs.

I would suggest as an aside/workaround that you turn off
notification-style reporting in your test environment (where I presume
people are doing this hacking around :) ).  My assumption is
production Puppet runs that fail are important but you might not care
about dev/test so much.

Regards

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread Ohad Levy
On 2011 6 8 20:16, Craig craigmsm...@blueyonder.co.uk wrote:

 Hi,

 These sample reports have been very useful, thanks!

 Is there is a way to only send a report once every 24 hours (say)?
 For example, I want to know about failed runs, but not every time
 someone is hacking around, changing something, re-running etc.

 I can think of all sorts of workarounds, just wondering if there's
 something built in to help here.

Foreman got a summary report support, where you can see / email an overview
over time (eg last 24 hours), and can even filter out results (dont shoe dev
hosts).

Ohad
 Thanks

 Craig.

 --
 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.


-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread James Turnbull
treydock wrote:
 I don't have any lines like that no.
 
 Could the daemon line for puppetmaster be effecting this?  Is the --
 reports option necessary since my puppet.conf has that specified?
 
 PUPPETMASTER_EXTRA_OPTS=--reports puppet_dashboard --debug
 
 Other than that and my puppet.conf I haven't found any further
 configurations I've implemented effecting use of reports

Specifying --reports on the command line in PUPPETMASTER_EXTRA_OPTS I am
pretty sure will override the puppet.conf configuration rather than add
to it.  I'd take it out of there and put it into puppet.conf on the master.

Regards

James Turnbull


-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread Don
(possible double-post)

James,

This is all wonderfully helpful and I just spent a little while
writing up a Zenoss processor to send an event on failure using
XMLRPC::Client, modeled directly after your puppet-zendesk module,
replacing the HTTParty guts with XMLRPC guts. I've encountered a
problem though (and we can refer to puppet-zendesk code):

When I stuff a fail() into a manifest and run, it fails, sends a
report to the PM, and the PM logs this:

Report zenoss failed: undefined method `status' for
#Puppet::Transaction::Report:0x2b626b5ad7c0

The line in question is from zendesk.rb:25

if self.status == 'failed'
  ...
end

So, it's breaking there, but when I replace self.status with var and
var = 'failed', bypassing the if, the rest of the code works and the
event appears in zenoss.

I'm running 2.6.4 on the master  client. pluginsync is true on both,
and reports = zenoss only on the master for this test.

Why is self.status not working in this case?

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread James Turnbull
Don wrote:
 (possible double-post)
 
 James,
 
 This is all wonderfully helpful and I just spent a little while
 writing up a Zenoss processor to send an event on failure using
 XMLRPC::Client, modeled directly after your puppet-zendesk module,
 replacing the HTTParty guts with XMLRPC guts. I've encountered a
 problem though (and we can refer to puppet-zendesk code):
 
 When I stuff a fail() into a manifest and run, it fails, sends a
 report to the PM, and the PM logs this:
 
 Report zenoss failed: undefined method `status' for
 #Puppet::Transaction::Report:0x2b626b5ad7c0
 
 The line in question is from zendesk.rb:25
 
 if self.status == 'failed'
   ...
 end
 
 So, it's breaking there, but when I replace self.status with var and
 var = 'failed', bypassing the if, the rest of the code works and the
 event appears in zenoss.
 
 I'm running 2.6.4 on the master  client. pluginsync is true on both,
 and reports = zenoss only on the master for this test.
 
 Why is self.status not working in this case?
 

Odd.  Can I see the rest of your code?

If private you can email me offlist.

Regards

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread James Turnbull
Don wrote:
 
 I'm running 2.6.4 on the master  client. pluginsync is true on both,
 and reports = zenoss only on the master for this test.
 
 Why is self.status not working in this case?
 

The issue is that status is only available in the V2 report format in
Puppet 2.6.5 and onwards. Before this you need to check for err tags
to find failed runs.

Regards

James Turnbull

-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-08 Thread Don
Thanks for the help off-list, James.

here's the stub I'm using to check if the log is error-ful, inside of
process():

  def process

failure = false

#iterate through each log object and look for failures
self.logs.each do |log|
  if log.level.to_s == 'err' || 'alert' || 'emerg' || 'crit'
failure = true
  end
end

if failure
  Puppet.debug Creating Zenoss event for failed run on #{self.host}.
###

This definitely costs a few more cycles than with 2.6.5+.

I'll publish the rest of the Zenoss processor on github tomorrow or Friday.

-Don

On Wed, Jun 8, 2011 at 5:23 PM, James Turnbull ja...@puppetlabs.com wrote:

 Don wrote:
 
  I'm running 2.6.4 on the master  client. pluginsync is true on both,
  and reports = zenoss only on the master for this test.
 
  Why is self.status not working in this case?
 

 The issue is that status is only available in the V2 report format in
 Puppet 2.6.5 and onwards. Before this you need to check for err tags
 to find failed runs.

 Regards

 James Turnbull

 --
 James Turnbull
 Puppet Labs
 1-503-734-8571

 --
 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.



-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-07 Thread James Turnbull
treydock wrote:
 This is the output from master.log during the failed puppet run.

Sorry I meant the output from the master daemon puppetmasterd or puppet
master.

Thanks

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-07 Thread James Turnbull
treydock wrote:
 Excuse the dumb question, but what file is the default location or
 what configuration variable defines that location?
 
 I've noticed the bulk of puppetmaster logs go either in /var/log/
 puppet/masterhttp.log (previous message) or /var/log/message (syslog
 I'm assuming).  Or is there a different place I should be looking?

On the Puppet master it defaults to syslog - so it'll end up in
/var/log/messages.

Regards

James


-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-07 Thread James Turnbull
treydock wrote:
 Ok I restarted puppetmaster daemon and then broke a module to create a
 failed puppet run on the same host as the master...and here's /var/log/
 messages from that

Can I confirm you have:

[master]
report = true
reports = xmpp

[agent]
report = true

In your puppet.conf on the master and the [agent] block on the client?

You mentioned an issue with the xmpp.yaml file?  That should have you
Jabber jid, password, target etc and be located in /etc/puppet on the
master - not sync'ed with the module.

Regards

James Turnbull

-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-06 Thread James Turnbull

treydock wrote:

The report processor was synced to /var/lib/puppet/lib/reports/ .  I
enabled puppetmaster to run in debug mode but haven't seen anything
mentioning reports when I run test runs.  I purposly misspelled a
module for the puppetmaster and run puppetd --test, but no reports
except those in puppet-dashboard.  I could be looking in the wrong
place.  Here's the debug output of the failed puppet run...(hostname
replaced)



Can I get the master log please. That's where the report is triggered.

Regards

James

--
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.



Re: [Puppet Users] Re: New Puppet report processors...

2011-06-05 Thread James Turnbull
treydock wrote:
 These will be most useful!!  Thank you.
 
 How can I test that these are functioning?  I have setup the XMPP as
 well as modified that to send emails.  However when I purposely cause
 a puppet run to fail I do not receive either email or jabber message.

Is the report processor xmpp.rb pluginsync'ed on your Puppet master?

Is there any log out on the Puppet master when you run in --debug mode?

Regards

James Turnbull


-- 
James Turnbull
Puppet Labs
1-503-734-8571

-- 
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.