# Getting handlers to execute irrespective of check output

**URL:** <https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61>\
**Category:** Sensu Classic (EOL)\
**Created:** [July 11, 2013, 7:40pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61 "2013-07-11T19:40:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawan\_Ranganatha\_Rao](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pawan\_Ranganatha\_Rao](https://discourse.sensu.io/u/Pawan_Ranganatha_Rao)\
**Post date:** [July 11, 2013, 7:40pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/1 "2013-07-11T19:40:47Z")

</div>

Hi

Is there any way I can get a sensu handler to run irrespective of the check output status and not only when there is a state change?

However, I DO NOT want to declare the check to be a metric.

Can this be done using a mutator by changing the status code of the check output in the event data?

Please advise.

Thanks

Pawan

---

<div class="post-metadata">

**Author:** ![Sean\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sean\_Porter](https://discourse.sensu.io/u/Sean_Porter)\
**Post date:** [July 11, 2013, 7:49pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/2 "2013-07-11T19:49:45Z")

</div>

Hello,

You could have the check plugin produce a non-zero exit status, perhaps \>= 3, which would cause every result to translate to an event to be handled. Why not declare the check to be a metric?

Sean.

> **···**
>
> On Thu, Jul 11, 2013 at 12:40 PM, Pawan Ranganatha Rao [pavan03@gmail.com](mailto:pavan03@gmail.com) wrote:
> 
> > Hi
> 
> > Is there any way I can get a sensu handler to run irrespective of the check output status and not only when there is a state change?
> 
> > 
> 
> > However, I DO NOT want to declare the check to be a metric.
> 
> > 
> 
> > Can this be done using a mutator by changing the status code of the check output in the event data?
> 
> > 
> 
> > Please advise.
> 
> > 
> 
> > Thanks
> 
> > Pawan
> 
> –  
> Cheers,
> 
> Sean Porter
> 
> { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }

---

<div class="post-metadata">

**Author:** ![Pawan\_Ranganatha\_Rao](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pawan\_Ranganatha\_Rao](https://discourse.sensu.io/u/Pawan_Ranganatha_Rao)\
**Post date:** [July 11, 2013, 7:55pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/3 "2013-07-11T19:55:48Z")

</div>

Hi

I’m looking to integrate Sensu and Flapjack and would want all check output data irrespective of the status to be sent to the handler. Thats why I dont want to declare it as a metric.

I’m using the handler to process the event and write into Redis of Flapjack which picks it up for notification.(I have already succeeded in doing this).

Cheers

Pawan

> **···**
>
> On Thursday, 11 July 2013 15:49:45 UTC-4, portertech wrote:
> 
> > Hello,
> 
> > You could have the check plugin produce a non-zero exit status, perhaps \>= 3, which would cause every result to translate to an event to be handled. Why not declare the check to be a metric?
> 
> > 
> 
> > Sean.
> 
> > On Thu, Jul 11, 2013 at 12:40 PM, Pawan Ranganatha Rao [pav...@gmail.com](mailto:pav...@gmail.com) wrote:
> > 
> > > Hi
> 
> > > Is there any way I can get a sensu handler to run irrespective of the check output status and not only when there is a state change?
> 
> > >
> 
> > > However, I DO NOT want to declare the check to be a metric.
> 
> > >
> 
> > > Can this be done using a mutator by changing the status code of the check output in the event data?
> 
> > >
> 
> > > Please advise.
> 
> > >
> 
> > > Thanks
> 
> > > Pawan
> 
> > 
> 
> > –  
> > Cheers,
> 
> > Sean Porter
> 
> > { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }
> 
> >

---

<div class="post-metadata">

**Author:** ![Sean\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sean\_Porter](https://discourse.sensu.io/u/Sean_Porter)\
**Post date:** [July 11, 2013, 7:58pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/4 "2013-07-11T19:58:31Z")

</div>

Declaring a check to be a metric just causes every result to translate to an event, irregardless of the exit status.

> **···**
>
> On Thu, Jul 11, 2013 at 12:55 PM, Pawan Ranganatha Rao [pavan03@gmail.com](mailto:pavan03@gmail.com) wrote:
> 
> > Hi
> 
> > I’m looking to integrate Sensu and Flapjack and would want all check output data irrespective of the status to be sent to the handler. Thats why I dont want to declare it as a metric.
> 
> > 
> 
> > I’m using the handler to process the event and write into Redis of Flapjack which picks it up for notification.(I have already succeeded in doing this).
> 
> > 
> 
> > Cheers
> 
> > Pawan
> 
> > 
> 
> > On Thursday, 11 July 2013 15:49:45 UTC-4, portertech wrote:
> 
> > > Hello,
> 
> > > You could have the check plugin produce a non-zero exit status, perhaps \>= 3, which would cause every result to translate to an event to be handled. Why not declare the check to be a metric?
> 
> > >
> 
> > > Sean.
> 
> > > On Thu, Jul 11, 2013 at 12:40 PM, Pawan Ranganatha Rao [pav...@gmail.com](mailto:pav...@gmail.com) wrote:
> > > 
> > > > Hi
> 
> > > > Is there any way I can get a sensu handler to run irrespective of the check output status and not only when there is a state change?
> 
> > > >
> 
> > > > However, I DO NOT want to declare the check to be a metric.
> 
> > > >
> 
> > > > Can this be done using a mutator by changing the status code of the check output in the event data?
> 
> > > >
> 
> > > > Please advise.
> 
> > > >
> 
> > > > Thanks
> 
> > > > Pawan
> 
> > >
> 
> > > –  
> > > Cheers,
> 
> > > Sean Porter
> 
> > > { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }
> 
> > >
> 
> –  
> Cheers,
> 
> Sean Porter
> 
> { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }

---

<div class="post-metadata">

**Author:** ![Pawan\_Ranganatha\_Rao](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pawan\_Ranganatha\_Rao](https://discourse.sensu.io/u/Pawan_Ranganatha_Rao)\
**Post date:** [July 11, 2013, 8:36pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/5 "2013-07-11T20:36:19Z")

</div>

ok thanks… Will having a mutator which changes the exit status of the event output work here in this case?

> **···**
>
> On Thursday, 11 July 2013 15:58:31 UTC-4, portertech wrote:
> 
> > Declaring a check to be a metric just causes every result to translate to an event, irregardless of the exit status.
> 
> > On Thu, Jul 11, 2013 at 12:55 PM, Pawan Ranganatha Rao [pav...@gmail.com](mailto:pav...@gmail.com) wrote:
> > 
> > > Hi
> 
> > > I’m looking to integrate Sensu and Flapjack and would want all check output data irrespective of the status to be sent to the handler. Thats why I dont want to declare it as a metric.
> 
> > >
> 
> > > I’m using the handler to process the event and write into Redis of Flapjack which picks it up for notification.(I have already succeeded in doing this).
> 
> > >
> 
> > > Cheers
> 
> > > Pawan
> 
> > >
> 
> > > On Thursday, 11 July 2013 15:49:45 UTC-4, portertech wrote:
> 
> > > > Hello,
> 
> > > > You could have the check plugin produce a non-zero exit status, perhaps \>= 3, which would cause every result to translate to an event to be handled. Why not declare the check to be a metric?
> 
> > > >
> 
> > > > Sean.
> 
> > > > On Thu, Jul 11, 2013 at 12:40 PM, Pawan Ranganatha Rao [pav...@gmail.com](mailto:pav...@gmail.com) wrote:
> > > > 
> > > > > Hi
> 
> > > > > Is there any way I can get a sensu handler to run irrespective of the check output status and not only when there is a state change?
> 
> > > > >
> 
> > > > > However, I DO NOT want to declare the check to be a metric.
> 
> > > > >
> 
> > > > > Can this be done using a mutator by changing the status code of the check output in the event data?
> 
> > > > >
> 
> > > > > Please advise.
> 
> > > > >
> 
> > > > > Thanks
> 
> > > > > Pawan
> 
> > > >
> 
> > > > –  
> > > > Cheers,
> 
> > > > Sean Porter
> 
> > > > { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }
> 
> > > >
> 
> > 
> 
> > –  
> > Cheers,
> 
> > Sean Porter
> 
> > { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }
> 
> >

---

<div class="post-metadata">

**Author:** ![Sean\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sean\_Porter](https://discourse.sensu.io/u/Sean_Porter)\
**Post date:** [July 11, 2013, 9:29pm UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/6 "2013-07-11T21:29:47Z")

</div>

A mutator will only be called if an event has been created that is being passed to a handler that requires it. Using a mutator will not work in this case, need to mark the check type as “metric”, or we implement an alias that doesn’t imply that it produces structure data.

> **···**
>
> On Thu, Jul 11, 2013 at 1:36 PM, Pawan Ranganatha Rao [pavan03@gmail.com](mailto:pavan03@gmail.com) wrote:
> 
> > ok thanks… Will having a mutator which changes the exit status of the event output work here in this case?
> 
> > On Thursday, 11 July 2013 15:58:31 UTC-4, portertech wrote:
> 
> > > Declaring a check to be a metric just causes every result to translate to an event, irregardless of the exit status.
> 
> > > On Thu, Jul 11, 2013 at 12:55 PM, Pawan Ranganatha Rao [pav...@gmail.com](mailto:pav...@gmail.com) wrote:
> > > 
> > > > Hi
> 
> > > > I’m looking to integrate Sensu and Flapjack and would want all check output data irrespective of the status to be sent to the handler. Thats why I dont want to declare it as a metric.
> 
> > > >
> 
> > > > I’m using the handler to process the event and write into Redis of Flapjack which picks it up for notification.(I have already succeeded in doing this).
> 
> > > >
> 
> > > > Cheers
> 
> > > > Pawan
> 
> > > >
> 
> > > > On Thursday, 11 July 2013 15:49:45 UTC-4, portertech wrote:
> 
> > > > > Hello,
> 
> > > > > You could have the check plugin produce a non-zero exit status, perhaps \>= 3, which would cause every result to translate to an event to be handled. Why not declare the check to be a metric?
> 
> > > > >
> 
> > > > > Sean.
> 
> > > > > On Thu, Jul 11, 2013 at 12:40 PM, Pawan Ranganatha Rao [pav...@gmail.com](mailto:pav...@gmail.com) wrote:
> > > > > 
> > > > > > Hi
> 
> > > > > > Is there any way I can get a sensu handler to run irrespective of the check output status and not only when there is a state change?
> 
> > > > > >
> 
> > > > > > However, I DO NOT want to declare the check to be a metric.
> 
> > > > > >
> 
> > > > > > Can this be done using a mutator by changing the status code of the check output in the event data?
> 
> > > > > >
> 
> > > > > > Please advise.
> 
> > > > > >
> 
> > > > > > Thanks
> 
> > > > > > Pawan
> 
> > > > >
> 
> > > > > –  
> > > > > Cheers,
> 
> > > > > Sean Porter
> 
> > > > > { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }
> 
> > > > >
> 
> > >
> 
> > > –  
> > > Cheers,
> 
> > > Sean Porter
> 
> > > { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }
> 
> > >
> 
> –  
> Cheers,
> 
> Sean Porter
> 
> { blog: “[http://portertech.ca](http://portertech.ca/)”, projects: “[https://github.com/portertech](https://github.com/portertech)” }

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [November 22, 2018, 2:04am UTC](https://discourse.sensu.io/t/getting-handlers-to-execute-irrespective-of-check-output/61/7 "2018-11-22T02:04:57Z")

</div>


