Monitoring chef-client failures

Hi

I was wondering if there’s a way to monitor whether the last chef-client run
failed? I can always parse the last few lines of /var/log/chef/client.log,
but I was wondering if there’s an easier way?

Thanks in advance

Haim

Chef has built-in json reporting[1]. Just grab this cookbook from opscode[2]
and apply the json_file recipe to each node. You will then get a massive
report of each run at /var/chef/reports/.

If you also look at Chef's exception handling[1] they give you examples on
how to use[2] and also how to expand your error handling.

Bryan

[1] - http://wiki.opscode.com/display/chef/Exception+and+Report+Handlers
[2] - https://github.com/opscode/cookbooks/tree/master/chef_handler

On Mon, Oct 10, 2011 at 12:52 PM, Haim Ashkenazi
haim.ashkenazi@gmail.comwrote:

Hi

I was wondering if there's a way to monitor whether the last chef-client
run failed? I can always parse the last few lines of
/var/log/chef/client.log, but I was wondering if there's an easier way?

Thanks in advance

Haim

Hi Bryan,

On Mon, Oct 10, 2011 at 7:56 PM, Bryan Baugher bjbq4d@gmail.com wrote:

Chef has built-in json reporting[1]. Just grab this cookbook from
opscode[2] and apply the json_file recipe to each node. You will then get a
massive report of each run at /var/chef/reports/.

If you also look at Chef's exception handling[1] they give you examples on
how to use[2] and also how to expand your error handling.

Thanks, I'll look at both solutions.

Bye

Haim

On Mon, Oct 10, 2011 at 2:04 PM, Haim Ashkenazi haim.ashkenazi@gmail.comwrote:

Hi Bryan,

On Mon, Oct 10, 2011 at 7:56 PM, Bryan Baugher bjbq4d@gmail.com wrote:

Chef has built-in json reporting[1]. Just grab this cookbook from
opscode[2] and apply the json_file recipe to each node. You will then get a
massive report of each run at /var/chef/reports/.

If you also look at Chef's exception handling[1] they give you examples on
how to use[2] and also how to expand your error handling.

Thanks, I'll look at both solutions.

We are using the chef report and exception handlers to submit
success/failure to our monitoring system (Nagios) using NSCA. Works like a
charm.

--
Ian Marlier | Senior Systems Engineer
Brightcove, Inc.
One Cambridge Center, 12th Floor, Cambridge, MA 02142
imarlier@brightcove.com