Nagios and HipChat

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
scratch
Posts: 3
Joined: Fri Feb 22, 2013 5:19 am

Nagios and HipChat

Post 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!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios and HipChat

Post by abrist »

Any hints in the nagios.log file?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
scratch
Posts: 3
Joined: Fri Feb 22, 2013 5:19 am

Re: Nagios and HipChat

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios and HipChat

Post by abrist »

It could be a permissions issue. Can you test the command from the command line, but do so as the nagios user?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
scratch
Posts: 3
Joined: Fri Feb 22, 2013 5:19 am

Re: Nagios and HipChat

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios and HipChat

Post by abrist »

Can you post the contact config you created for the hipchat notifications?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked