Renan Rangel crunching technology for breakfast

24Jul/153

Sending AWS CloudWatch alarms to a Hipchat room

I was trying the other day to receive CloudWatch alarms on a Hipchat room, when I had the idea to use AWS Lambda to do the hard work for me, instead of having to run it on some server to receive an HTTP request from SNS.

After you create your Hipchat integration, note down the token and room number so you can use it with the Lambda function.

You need to start by creating a SNS topic to receive the alarm notifications and subscribe it to a Lambda function. Everytime you get an alarm from CloudWatch, it gets sent to SNS, which will call the Lambda function that will connect to the Hipchat API and send it to your room.

You can fing the script in rvrangel/cloudwatch-hipchat at GitHub or just copy it below. Don't forget to adjust your Hipchat variables!

Posted by Renan Rangel

Comments (3) Trackbacks (0)
  1. This script seems to keep erroring out on me, and doesn’t actually deliver any messages to HipChat.

    START RequestId: 1c003ffd-116b-xxxx-xxxx-3f77faa4e7c1 Version: $LATEST
    2016-05-03T20:10:41.322Z 1c003ffd-116b-xxxx-xxxx-3f77faa4e7c1 TypeError: Cannot read property ‘0’ of undefined
    at exports.handler (/var/task/index.js:9:42)
    END RequestId: 1c003ffd-116b-xxxx-xxxx-3f77faa4e7c1
    REPORT RequestId: 1c003ffd-116b-xxxx-xxxx-3f77faa4e7c1 Duration: 243.98 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 14 MB
    Process exited before completing request

  2. This works great, and its so simple. Thanks!

    Just one question – how do you get green messages when the state turns back to OK?

  3. I have just started using GarageBand on my iPhone, it’s a complete package of amazing instruments and recorded tunes. I am not a learned musician or an artist, i just love creating music in my free time. GarageBand lets me enjoy my own music on my phone, I can save it and share it with others easily.


Leave a comment

No trackbacks yet.