TL;DR InfluxDB Tech Tips – How to Set Up Kapacitor and Chronograf to Send Alert Messages to HipChat

4 minutes

In this post we describe how to set up Chronograf and Kapacitor to send alert messages to HipChat. Check in next week for the most interesting InfluxDB and TICK-stack related issues, workarounds, how-tos and Q&A from GitHub, IRC and the InfluxDB Google Group that you might have missed.

HipChat Setup with Kapacitor

HipChat is Atlassian’s web service for group chat, video chat, and screen sharing. Kapacitor is InfluxData’s open source data processing framework that allows you to configure and send alert messages to event handlers (like HipChat!).

Requirements

To send Kapacitor alert messages to HipChat, you need your:

HipChat subdomain name

Identify your subdomain name in the HipChat URL: https://<your-subdomain>.hipchat.com/home.

HipChat room name

In the web application, create a new room or identify the target room under the ROOM section in the left-hand sidebar.

HipChat API access token for sending notifications

The following steps describe how to create the API access token.

1. From the HipChat home page (https://<your-subdomain>.hipchat.com/home), access Account settings by clicking on the person icon in the top right corner.

2. Select API access from the items in the left menu sidebar.

3. Under Create new token, enter a label for your token (it can be anything).

4. Under Create new token, select Send Notification as the scope.

5. Click Create. Your token appears in the table just above the Create new token section.

Kapacitor Configuration

In the [hipchat] section of Kapacitor’s configuration file (/etc/kapacitor/kapacitor.conf), set the enabled setting to true and set subdomain in the url setting to your HipChat subdomain. There are other configuration settings, but they are optional.

Sample configuration file:

[hipchat]
  enabled = true
  url = "https://<your-subdomain>.hipchat.com/v2/room"

Kapacitor TICKscript

In the |alert() section of your Kapacitor TICKscript, include the .hipChat() attribute, set the .room('<your-hipchat-room>') attribute to your HipChat room, and set the .token('<your-hipchat-room>') to your API access token.

Sample TICKscript:

stream
    |from()
        .measurement('cpu')
    |alert()
        .crit(lambda: "usage_idle" <  10)
        .message('')
        .hipChat() ✨
        .room('<your-hipchat-room>') ✨
 .token('<your-api-access-token>') ✨

Next, define and enable your Kapacitor task, and keep an eye on your HipChat room. That’s it!

HipChat Setup with Chronograf

Chronograf offers a user interface for working with Kapacitor to easily create alert rules and send alert messages to event handlers.

Requirements

Kapacitor instance

Check out Chronograf’s installation guide to how to install and connect Kapacitor to Chronograf.

HipChat information
  • subdomain name
  • room name
  • API access token

See the list of requirements in the HipChat Setup with Kapacitor section for how to get that information from HipChat.

Chronograf/Kapacitor Configuration

1. Visit the Kapacitor Configuration page in your Chronograf application.

2. In the Configure Alert Endpoints section, select HipChat from the dropdown menu.

3. Change subdomain in the HipChat URL input to your HipChat subdomain.

4. Enter your HipChat room in the Room input.

5. Enter your HipChat API access token in the Token input.

6. Click the Save button.

Rule Configuration

When creating or editing a rule on Chronograf’s Kapacitor Rules page, select hipchat in the dropdown menu at the bottom of your screen. Kapacitor sends all alert messages associated with that rule to your configured HipChat room.

What’s next:

  • Downloads for the TICK-stack are live on our “downloads” page.
  • Deploy on the Cloud: Get started with a FREE trial of InfluxDB Cloud featuring fully-managed clusters, Kapacitor and Grafana.
  • Deploy on Your Servers: Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of InfluxDB Enterprise featuring an intuitive UI for deploying, monitoring and rebalancing clusters, plus managing backups and restores. 
  • Tell Your Story: Over 300 companies have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.

Related Blog Posts

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top