# Chef handler provoke script

**URL:** <https://discourse.chef.io/t/chef-handler-provoke-script/12070>\
**Category:** Chef Infra (archive)\
**Created:** [December 5, 2017, 11:59am UTC](https://discourse.chef.io/t/chef-handler-provoke-script/12070 "2017-12-05T11:59:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyanshu](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@priyanshu](https://discourse.chef.io/u/priyanshu)\
**Post date:** [December 5, 2017, 11:59am UTC](https://discourse.chef.io/t/chef-handler-provoke-script/12070/1 "2017-12-05T11:59:11Z")

</div>

Is there a way to call other script when chef handler gets activated?

---

<div class="post-metadata">

**Author:** ![r4hul](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@r4hul](https://discourse.chef.io/u/r4hul)\
**Post date:** [December 6, 2017, 11:11pm UTC](https://discourse.chef.io/t/chef-handler-provoke-script/12070/2 "2017-12-06T23:11:56Z")

</div>

I am not sure what you requirement is, but read this page: [https://docs.chef.io/handlers.html](https://docs.chef.io/handlers.html)

If want to run custom scripts as part of an event handler then yes you can do that like this:

```auto
Chef.event_handler do
  on :run_failed do |exception|
    <ruby code here>
  end
end
  

```

This will do something when chef run fails. You can put this inside a recipe and hook it on top of your run list.
