Assembling Uptime, Umpire and Graphite

2012-10-16 11:05:08 by jdixon

Just this morning I discovered the Uptime project over on GitHub. The author bills it as "A simple HTTP remote monitoring utility using Node.js and MongoDB". I'm already in love with this tool thanks to its composability and ease of use.

The documentation over at the Uptime project is quite good, so I won't bore you with the details. The basic gist is that you'll want to have a MongoDB server available (OS X users can just brew install mongodb) and Node.js (at least version 0.8). Clone the repo locally and then run node app.js to start the monitor (web UI) and analyzer (check engine).

Uptime is all about checking websites. However, we can totally take advantage of this for analyzing Graphite metrics thanks to the Umpire project. All we need is an instance of Umpire running that can query our Graphite server. Another quick clone of Umpire and setting up its environment variables, and now I have an endpoint that I can query for threshold status.

$ curl -i "http://u:[email protected]:5000/check?metric=\
> averageSeries(graphite-foobar-com.*.cpu-system.value)&max=0.1&range=300"

HTTP/1.1 200 OK
Connection: close
Date: Tue, 16 Oct 2012 14:47:48 GMT
Content-Type: application/json
Content-Length: 30

{"value":0.05383333333333334}

Now we just create a new check in Uptime to monitor that URL and we're in business. Rather than having to setup Nagios or open the firewall to allow access to my Umpire or Graphite services, we have a fully standalone state engine capable of querying any metrics we're currently storing in Graphite.

I spent another hour writing an output plugin (pull request) that allows Uptime to send events as JSON webhooks to external services. I expect that I'll probably adapt Backstop to support this for storing alert annotations and, even more likely, a PagerDuty plugin, as Uptime currently has no external notification capabilities.

Add a comment:

  name

  email

  url

max length 4000 chars