Page 1 of 1

Nagios and HipChat

Posted: Fri Feb 22, 2013 9:04 am
by scratch
Hi everyone,

We've started using a product called HipChat as a collaboration tool www.hipchat.com

This has the ability to send Nagios alerts to a chat room using this https://github.com/hannseman/hipsaint

I've got this installed on our monitoring machine. I've added the following to command.cfg

Code: Select all

define command {
    command_name    notify-host-by-hipchat
    command_line    hipsaint --token=<TOKEN> --room=<ROOM_ID> --type=host --inputs="$HOSTNAME$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$HOSTSTATE$|$HOSTOUTPUT$" -n
}
define command {
    command_name    notify-service-by-hipchat
    command_line    hipsaint --token=<TOKEN> --room=<ROOM_ID> --type=service --inputs="$SERVICEDESC$|$HOSTALIAS$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$SERVICESTATE$|$SERVICEOUTPUT$" -n
}
If I run the information in command_line on the server itself (as root and nagios users), it generates an alert in the chat room. However when Nagios triggers a genuine alert, nothing appears.

I've tried various things like adding the full path of the hipsaint application to the command_line in commands.cfg and making sure the $PATH variable is set correctly, but nothing seems to work.

Is there anything obvious I'm overlooking here?

Thanks!

Re: Nagios and HipChat

Posted: Fri Feb 22, 2013 2:58 pm
by abrist
Any hints in the nagios.log file?

Re: Nagios and HipChat

Posted: Mon Feb 25, 2013 5:00 am
by scratch
Nothing at all in there relating to hipchat, even if I generate an alert via the command_line syntax. That in itself seems odd to me.

Re: Nagios and HipChat

Posted: Mon Feb 25, 2013 10:31 am
by abrist
It could be a permissions issue. Can you test the command from the command line, but do so as the nagios user?

Re: Nagios and HipChat

Posted: Wed Feb 27, 2013 7:10 am
by scratch
Hi,

I had tried that before I posted as I thought it may have been a PATH issue, and it does work from both root and the nagios user on the command line without a problem. The problem seems to be relating to actually making the alerts use the info in commands.cfg to send a chat message.

Re: Nagios and HipChat

Posted: Wed Feb 27, 2013 11:47 am
by abrist
Can you post the contact config you created for the hipchat notifications?