This week we added support for webhook notifications in Circonus. For those that are unsure what a webhook is, its simply an HTTP POST with all the information about an alert you would normally get via email, XMPP or AIM.
Webhooks can be added to any contact group. Unlike other methods, you can’t add one to an individual user, and then add that user to a group, however this might be supported in the future based on feedback. Simply go to your account profile, click on the field “Type to Add New Contact” on the group you would like to add the hook to, and enter the URL you would like us to contact. The contact type will then display as your URL with the method of HTTP (for brevity).
Now that your hook is setup, what will it look like when the data is posted to you? Here is a perl Data::Dumper example, grouped by alert for readability, of the parameters posted for 2 alerts:
%post = ( 'alert_id' => [ '21190', '21191' ], 'account_name' => 'My Account', 'severity_21190' => '1', 'metric_name_21190' => 'A', 'check_name_21190' => 'My Check', 'agent_21190' => 'Ashburn, VA, US', 'alert_value_21190' => '91.0', 'clear_value_21190' => '0.0', 'alert_time_21190' => 'Thu, 21 Oct 2010 16:35:49', 'clear_time_21190' => 'Thu, 21 Oct 2010 16:36:49', 'alert_url_21190' => 'https://circonus.com/account/my_account/fault-detection?alert_id=21190', 'severity_21191' => '1', 'metric_name_21191' => 'B', 'check_name_21191' => 'My Other Check', 'agent_21191' => 'Ashburn, VA, US', 'alert_value_21191' => '91.0', 'alert_time_21191' => 'Thu, 21 Oct 2010 16:36:21', 'alert_url_21191' => 'https://circonus.com/account/my_account/fault-detection?alert_id=21191', );
So lets look at what we have here. First thing to notice is that we pass multiple alert_id parameters, giving you the ID of each alert in the payload. From there, every other parameter is suffixed with _<alert_id> so you know which alert that parameter is associated with. In this example 21190 is a recovery, and 21191 is an alert, recoveries get the additional parameters of clear_value and clear_time.
Webhooks open up all sorts of possibilities both inside and outside of Circonus. Maybe you have a crazy complicated paging schedule, or prefer a contact method that we don’t natively support yet, fair enough, let us post the data to you and you can integrate it however you like. Want to graph your alerts? We are in the process of working on a way to overlay alerts on any graphs, but in the meantime, setup your webhook and feed the data back to Circonus via Resmon XML, now you have data for your graphs.
If you are curious about other features and would like to see an in depth post on them, please contact us at firstname.lastname@example.org.