# Hipchat handler sends alert in check but not from keep alive

**URL:** <https://discourse.sensu.io/t/hipchat-handler-sends-alert-in-check-but-not-from-keep-alive/323>\
**Category:** Sensu Classic (EOL)\
**Created:** [December 16, 2014, 1:19am UTC](https://discourse.sensu.io/t/hipchat-handler-sends-alert-in-check-but-not-from-keep-alive/323 "2014-12-16T01:19:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyler\_Field](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Tyler\_Field](https://discourse.sensu.io/u/Tyler_Field)\
**Post date:** [December 16, 2014, 1:19am UTC](https://discourse.sensu.io/t/hipchat-handler-sends-alert-in-check-but-not-from-keep-alive/323/1 "2014-12-16T01:19:55Z")

</div>

Hi all,

I’m having an issue where a handler will work if it used as part of a check but will not fire if it is part of a keep-alive. Not really sure where/how to debug this further.

The check that is working has the following configuration on the server:

{

“checks”: {

“ntp\_check”: {

“handlers”: [“hipchat”],

“command”: "/etc/sensu/plugins/check-procs.rb -p ntp -C 1 ",

“interval”: 60,

“subscribers”: [“all”]

}

}

}

This is client setting:

{

“client”: {

“address”: “127.0.0.1”,

“handlers”: [

“hipchat”

],

“keepalive”: {

“thresholds”: {

“critical”: 300,

“warning”: 90

}

},

“name”: “[debian.ospreytest.com](http://debian.ospreytest.com)”,

“refresh”: 1800,

“subscriptions”: [

“all”

]

}

}

And the handler is defined:

{

“handlers”: {

“hipchat” : {

“type”: “pipe”,

“command”: “/etc/sensu/plugins/hipchat\_handler.rb”

}

}

If I stop the ntp service on the client machine I get an alert in hipchat as expected which is resolved on when I restart ntp. However if I stop the sensu-client service on the client machine, uchiwa will show a warning at 90 sec and an alert at 300 sec in the events but nothing is posted to hipchat. I don’t say anything indicating an error connecting to hipchat in the server logs.

Any suggestions as to where to begin troubleshooting this further would be greatly appreciated.

Cheers,

Tyler

---

<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:** [December 16, 2014, 3:14am UTC](https://discourse.sensu.io/t/hipchat-handler-sends-alert-in-check-but-not-from-keep-alive/323/2 "2014-12-16T03:14:17Z")

</div>

This is a bit hard to troubleshoot because the flexibility of sensu's  
configuration makes your typo not explode.

The issue here is that your handlers stanza is in the wrong place:  
[http://sensuapp.org/docs/latest/clients#keepalives](http://sensuapp.org/docs/latest/clients#keepalives)

One way to determine this would be to \*very\* closely inspect the  
keepalive events coming out of the logs on the server and see that  
they do not have the hipchat handler on them, only "default". Pretty  
tricky.

> **···**
>
> On Mon, Dec 15, 2014 at 5:19 PM, \<tyler@ospreyinformatics.com\> wrote:
> 
> > Hi all,
> > 
> > I'm having an issue where a handler will work if it used as part of a check  
> > but will not fire if it is part of a keep-alive. Not really sure where/how  
> > to debug this further.
> > 
> > The check that is working has the following configuration on the server:
> > 
> > {  
> > &nbsp;&nbsp;"checks": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;"ntp\_check": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"handlers": ["hipchat"],  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"command": "/etc/sensu/plugins/check-procs.rb -p ntp -C 1 ",  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"interval": 60,  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"subscribers": ["all"]  
> > &nbsp;&nbsp;&nbsp;&nbsp;}  
> > &nbsp;&nbsp;}  
> > }
> > 
> > This is client setting:
> > 
> > {  
> > &nbsp;&nbsp;"client": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;"address": "127.0.0.1",  
> > &nbsp;&nbsp;&nbsp;&nbsp;"handlers": [  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"hipchat"  
> > &nbsp;&nbsp;&nbsp;&nbsp;],  
> > &nbsp;&nbsp;&nbsp;&nbsp;"keepalive": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"thresholds": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"critical": 300,  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"warning": 90  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > &nbsp;&nbsp;&nbsp;&nbsp;},  
> > &nbsp;&nbsp;&nbsp;&nbsp;"name": "debian.ospreytest.com",  
> > &nbsp;&nbsp;&nbsp;&nbsp;"refresh": 1800,  
> > &nbsp;&nbsp;&nbsp;&nbsp;"subscriptions": [  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"all"  
> > &nbsp;&nbsp;&nbsp;&nbsp;]  
> > &nbsp;&nbsp;}  
> > }
> > 
> > And the handler is defined:
> > 
> > {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"handlers": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"hipchat" : {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"type": "pipe",  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"command": "/etc/sensu/plugins/hipchat\_handler.rb"  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > }
> > 
> > If I stop the ntp service on the client machine I get an alert in hipchat as  
> > expected which is resolved on when I restart ntp. However if I stop the  
> > sensu-client service on the client machine, uchiwa will show a warning at 90  
> > sec and an alert at 300 sec in the events but nothing is posted to hipchat.  
> > I don't say anything indicating an error connecting to hipchat in the server  
> > logs.
> > 
> > Any suggestions as to where to begin troubleshooting this further would be  
> > greatly appreciated.
> > 
> > Cheers,  
> > Tyler

---

<div class="post-metadata">

**Author:** ![Tyler\_Field](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Tyler\_Field](https://discourse.sensu.io/u/Tyler_Field)\
**Post date:** [December 16, 2014, 5:08am UTC](https://discourse.sensu.io/t/hipchat-handler-sends-alert-in-check-but-not-from-keep-alive/323/3 "2014-12-16T05:08:53Z")

</div>

Hi Kyle,

Thanks for the link. Moving the handlers array inside the keepalive object has resolved the issue.

Cheers,

Tyler

> **···**
>
> On Monday, December 15, 2014 8:14:18 PM UTC-7, Kyle Anderson wrote:
> 
> > This is a bit hard to troubleshoot because the flexibility of sensu’s
> > 
> > configuration makes your typo not explode.
> > 
> > The issue here is that your handlers stanza is in the wrong place:
> > 
> > [http://sensuapp.org/docs/latest/clients#keepalives](http://sensuapp.org/docs/latest/clients#keepalives)
> > 
> > One way to determine this would be to _very_ closely inspect the
> > 
> > keepalive events coming out of the logs on the server and see that
> > 
> > they do not have the hipchat handler on them, only “default”. Pretty
> > 
> > tricky.
> > 
> > On Mon, Dec 15, 2014 at 5:19 PM, [ty...@ospreyinformatics.com](mailto:ty...@ospreyinformatics.com) wrote:
> > 
> > > Hi all,
> > 
> > > 
> > 
> > > I’m having an issue where a handler will work if it used as part of a check
> > 
> > > but will not fire if it is part of a keep-alive. Not really sure where/how
> > 
> > > to debug this further.
> > 
> > > 
> > 
> > > The check that is working has the following configuration on the server:
> > 
> > > 
> > 
> > > {
> > 
> > > “checks”: {
> > 
> > > ```
> > > "ntp_check": {
> > > 
> > > ```
> > 
> > > ```
> > > "handlers": ["hipchat"],
> > > 
> > > ```
> > 
> > > ```
> > > "command": "/etc/sensu/plugins/check-procs.rb -p ntp -C 1 ",
> > > 
> > > ```
> > 
> > > ```
> > > "interval": 60,
> > > 
> > > ```
> > 
> > > ```
> > > "subscribers": ["all"]
> > > 
> > > ```
> > 
> > > ```
> > > }
> > > 
> > > ```
> > 
> > > }
> > 
> > > }
> > 
> > > 
> > 
> > > This is client setting:
> > 
> > > 
> > 
> > > {
> > 
> > > “client”: {
> > 
> > > ```
> > > "address": "127.0.0.1",
> > > 
> > > ```
> > 
> > > ```
> > > "handlers": [
> > > 
> > > ```
> > 
> > > ```
> > > "hipchat"
> > > 
> > > ```
> > 
> > > ```
> > > ],
> > > 
> > > ```
> > 
> > > ```
> > > "keepalive": {
> > > 
> > > ```
> > 
> > > ```
> > > "thresholds": {
> > > 
> > > ```
> > 
> > > ```
> > > "critical": 300,
> > > 
> > > ```
> > 
> > > ```
> > > "warning": 90
> > > 
> > > ```
> > 
> > > ```
> > > }
> > > 
> > > ```
> > 
> > > ```
> > > },
> > > 
> > > ```
> > 
> > > ```
> > > "name": "[debian.ospreytest.com](http://debian.ospreytest.com)",
> > > 
> > > ```
> > 
> > > ```
> > > "refresh": 1800,
> > > 
> > > ```
> > 
> > > ```
> > > "subscriptions": [
> > > 
> > > ```
> > 
> > > ```
> > > "all"
> > > 
> > > ```
> > 
> > > ```
> > > ]
> > > 
> > > ```
> > 
> > > }
> > 
> > > }
> > 
> > > 
> > 
> > > And the handler is defined:
> > 
> > > 
> > 
> > > {
> > 
> > > ```
> > > "handlers": {
> > > 
> > > ```
> > 
> > > ```
> > > "hipchat" : {
> > > 
> > > ```
> > 
> > > ```
> > > "type": "pipe",
> > > 
> > > ```
> > 
> > > ```
> > > "command": "/etc/sensu/plugins/hipchat_handler.rb"
> > > 
> > > ```
> > 
> > > ```
> > > }
> > > 
> > > ```
> > 
> > > }
> > 
> > > 
> > 
> > > If I stop the ntp service on the client machine I get an alert in hipchat as
> > 
> > > expected which is resolved on when I restart ntp. However if I stop the
> > 
> > > sensu-client service on the client machine, uchiwa will show a warning at 90
> > 
> > > sec and an alert at 300 sec in the events but nothing is posted to hipchat.
> > 
> > > I don’t say anything indicating an error connecting to hipchat in the server
> > 
> > > logs.
> > 
> > > 
> > 
> > > Any suggestions as to where to begin troubleshooting this further would be
> > 
> > > greatly appreciated.
> > 
> > > 
> > 
> > > Cheers,
> > 
> > > Tyler
> > 
> > >
