I’m looking at publishing some check results directly via AMQP. Since I already have a ton of metrics flowing directly to Graphite, I want a “zero-cost” way to do alerting from them. I’m working on a proxy in Node.js that will live on the Graphite server and will have the ability to selectively perform actions as the metrics flow in, rather than polling the Graphite render URL. I think this has the potential to be extremely flexible and efficient: rather than checking the load via a script invoked from sensu-client, I’d be able to just publish a check result with the value of the collectd.my-hostname.load.load.midterm metric.
Anyway, I haven’t found any documentation or an example of an integration like this. I fiddled around with the amqp module in Node.js and was able to get sensu-server to recognize a JSON string published to the ‘results’ exchange as a check result. What I’m looking for is what the proper structure of the JSON payload should be. My example – which appears to be doing what I want – uses the following payload
subscribers: [ “default” ],
command: “/bin/echo -n OK”,
handlers: [ “default” ],
I can figure out the minimum properties via trial and error, but I’d like a little more formal direction if someone could help me out. This seems like potentially a very powerful way to implement standalone checks.