当chef-client运行不成功时,如何编写chef_handler来发送邮件?

时间:2018-08-19 13:49:29

标签: ruby chef chef-recipe chef-solo cookbook

我已经阅读过Chef-Client Handler上的文档:

https://docs.chef.io/resource_chef_handler.html

我想要实现的是在Chef-client在Node上运行期间发生故障时发送邮件。

1> Is there a sample recipe or notes that I could refer to? 
2> Should the SMTP Server be enabled on the Node, or on the CHEF 
Server?
3> Almost all the Knowledge base pages were written for CHEF 13, and those notes doesn't seems to work on CHEF 14, so is there any additional settings that has been done or needs to be done?
4> Is there a sample code with instructions to which I could refer that I could use to set up my recipe??

谢谢

1 个答案:

答案 0 :(得分:0)

这实际上是https://docs.chef.io/handlers.html#send-email上显示的示例:)