Skip to content

Instantly share code, notes, and snippets.

@smford22
Created November 5, 2015 16:20
Show Gist options
  • Save smford22/443aa659d34e7b2b198c to your computer and use it in GitHub Desktop.
Save smford22/443aa659d34e7b2b198c to your computer and use it in GitHub Desktop.
failed audit Chef Analytics rule
rules 'failed-audit'
 rule on run_control_group
 when
   status != 'success'
 then
   alert:warn('{{message.cookbook_name}} {{message.recipe_name}} audit failed')
   notify('slack', '
{
"username": "Audit Alarm",
"icon_emoji": ":rotating_light:",
"attachments": [ {
"text": "{{message.name}} (cookbook {{message.cookbook_name}}) had `{{message.number_failed}}` failed audit test(s) on node `{{message.run.node_name}}` in organization `{{message.organization_name}}`",
"color": "danger"
}]
}
')
 end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment