# Client specific handler invocation

**URL:** <https://discourse.sensu.io/t/client-specific-handler-invocation/600>\
**Category:** Sensu Classic (EOL)\
**Created:** [May 17, 2016, 1:53am UTC](https://discourse.sensu.io/t/client-specific-handler-invocation/600 "2016-05-17T01:53:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trupti\_mali](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@trupti\_mali](https://discourse.sensu.io/u/trupti_mali)\
**Post date:** [May 17, 2016, 1:53am UTC](https://discourse.sensu.io/t/client-specific-handler-invocation/600/1 "2016-05-17T01:53:25Z")

</div>

Hi,  
Is it possible to invoke a client specific handler? So far I am aware that we can add handlers with the checks run and those checks are associated with the client with subscriptions.

{

“checks”: {

```
"check-memory-percent": {

  "type": "metric",

  "command": "check-memory-percent.rb -w 80 -c 90",

  "subscribers": [

    "ALL"

  ],

  "interval": 100

}

```

}

}

e.g. above check is for ALL subscribers(both prod and qa). But what if my prod node wants to send and email and sms but qa wants to send only email.

Can I add handler choice from client.json? I tried but it doesnt work.

---

<div class="post-metadata">

**Author:** ![Kyle\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@Kyle\_Anderson](https://discourse.sensu.io/u/Kyle_Anderson)\
**Post date:** [May 17, 2016, 4:50am UTC](https://discourse.sensu.io/t/client-specific-handler-invocation/600/2 "2016-05-17T04:50:05Z")

</div>

There is no general client setting that overrides all other checks. If  
you want a client to behave differently then how a subscription check  
is configured, then I can think of a couple options:

1. Have a different subscription check for QA servers that has a  
different handler configuration. (check-memory-email: subscribers =\>  
qa)  
2. Use filters ([https://sensuapp.org/docs/latest/getting-started-with-filters\](https://sensuapp.org/docs/latest/getting-started-with-filters%5C))  
in conjunction with some client attributes and filter out the sms  
handler on qa servers  
3. Deploy check configuration overrides to the QA servers, and that  
configuration will get merged on top of the incoming check request.  
4. Convert to standalone checks, which gives the ability to deploy  
checks with more flexibility

Don't forget about the client keepalive check too. Keepalive alerts  
can be configured like any other standalone check, the config goes in  
a "keepalive" section:  
[https://sensuapp.org/docs/latest/clients#keepalive-attributes](https://sensuapp.org/docs/latest/clients#keepalive-attributes) Same  
options apply except for 3 I guess.

> **···**
>
> On Mon, May 16, 2016 at 6:53 PM, trupti mali \<truptikmali@gmail.com\> wrote:
> 
> > Hi,  
> > Is it possible to invoke a client specific handler? So far I am aware that  
> > we can add handlers with the checks run and those checks are associated  
> > with the client with subscriptions.
> > 
> > {
> > 
> > &nbsp;&nbsp;"checks": {
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;"check-memory-percent": {
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type": "metric",
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"command": "check-memory-percent.rb -w 80 -c 90",
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"subscribers": [
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ALL"
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"interval": 100
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;}
> > 
> > }
> > 
> > }
> > 
> > e.g. above check is for ALL subscribers(both prod and qa). But what if my  
> > prod node wants to send and email and sms but qa wants to send only email.
> > 
> > Can I add handler choice from client.json? I tried but it doesnt work.

---

<div class="post-metadata">

**Author:** ![trupti\_mali](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@trupti\_mali](https://discourse.sensu.io/u/trupti_mali)\
**Post date:** [May 17, 2016, 8:07am UTC](https://discourse.sensu.io/t/client-specific-handler-invocation/600/3 "2016-05-17T08:07:41Z")

</div>

Well filters work for me. Thanks for the prompt response Kyle. 🙂
