- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: What is a simple method to arrange e-mail notification of failed convergence?
- Date: Mon, 24 Nov 2014 11:58:33 -0800
On Monday, November 24, 2014 at 11:47 AM, Phil Mocek wrote:
>
What is a simple method of arranging to receive e-mail notification
>
whenever chef-client attempts and fails to converge a node?
>
>
I know Chef provides a [flexible framework for various handlers][1],
>
including exception handlers. At this time, I don't need flexibility; I
>
need simplicity. I just want to say, "For any of these nodes, when
>
convergence fails, send a message to
>
>
>
(mailto:
)."
>
I
>
hoped I could override in a Chef environment definition a node attribute
>
used by the [chef-client cookbook][2] so that it would configure nodes
>
as described, but after various searches of the Chef docs, the whole
>
Web, and this list, I've yet to find indication that such is a possibility.
>
>
>
References:
>
>
[1]: <https://docs.getchef.com/essentials_handlers.html>
>
[2]: <https://supermarket.getchef.com/cookbooks/chef-client>
>
>
--
>
Phil Mocek
>
https://mocek.org
Chef delegates all of this kind of thing to handlers (this means the core
team doesn’t need to maintain handlers for e.g., chat systems we don’t use),
but there are already ones written that do what you’re asking, like this one:
https://github.com/kisoku/chef-handler-mail
A super simple example is provided in the docs you linked:
https://docs.getchef.com/essentials_handlers.html#syntax if you just want to
copy pasta that code.
If you’re interested in other community-contributed handlers, there’s a list
at the bottom of the documentation page:
https://docs.getchef.com/essentials_handlers.html#community-handlers
Also, there is a chef_handler cookbook that will manage handlers for you,
some documentation on that is here:
https://docs.getchef.com/resource_chef_handler.html (GH:
https://github.com/opscode-cookbooks/chef_handler)
HTH,
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.