Print Shortlink

Send Zabbix Alerts To HipChat

In my current environment we use HipChat extensively for communication, and our CI server sends a lot of events to HipChat so I figured I would send Zabbix alerts there as well. This is a pretty simple how-to and should only take you about 10 minutes to implement.

Setup HipChat and Script

The first thing you are going to want to do is figure out the following information:

  • HipChat API Token
  • Room ID

It was pretty easy to get this information. To get the HipChat API Token from the HipChat API Documentation once I created my API token I simply needed to figure out what the Room ID was. I wasn’t able to find the Room ID from the HipChat client so I had to log into the web interface and noticed what the room ID was from the URL in my browser

Next, I needed to clone the following repo:

https://github.com/hipchat/hipchat-cli

Once I cloned the repo I coped the hipchat_room_message scrip to /usr/local/bin on my Zabbix server.

Setup Zabbix

Finally I simply needed to setup my Zabbix server to send the actual HipChat messages. Simply log into the Zabbix UI, go to configuration >> actions and press the “Create action” button:

Next configure your conditions tab, for this example I only wanted “Warning” and higher messages, you can configure this how ever you see fit for your environment:

Finally, you simply need to setup your condition. This is where you need to plugin your API Token and Room ID. Also make sure to set the “Host Target” to your Zabbix server or the script will try and run from the system that triggered the alert.

Hopefully this helps you out!

2 Responses

  1. msims

    This is great and works perfectly…for alerts. But we don’t seem to get Recovery in to Hipchat.
    Anything I could be missing?

  2. Chad

    Two years later and this is still a useful tutorial. For anyone else that hits the same roadblock on getting notifications to work correctly, especially push notifications to mobile devices, I created a private room and use @all to make sure I get messages even when away or offline. However, you need to send messages using “-m text” otherwise it will not translate the @ to a mention.

Leave a Reply