Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-1629

Webhook API as alert contact/destination

Details

    • New Feature
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Alerting
    • Not applicable.

    Description

      Add generic Webhook API as alert transport/contact/destination, e.g. a simple HTTP based API that authenticates the message using either a token in the URI or using the HTTP Authorization header; and accepts JSON payload as message.

      We use our own Webhook API as both an alert aggregation and logging destination. Webhook integration to and from cloud/SaaS applications is now extremely common.

      Example webhook logs after Observium was patched with this integration, and configured with two alert contacts, one with no originator value, and one with an originator value.

      Dec 29 22:08:05 web01 webhooker: Log:

      {"originator":null,"body":"RECOVER: [server.localdomain] [storage] [/opt] Storage exceeds 90% of disk capacity\nstorage_perc = 6.79"}

      Dec 29 22:08:05 web01 webhooker: Log:

      {"originator":"Observium Test 1234","body":"RECOVER: [server.localdomain] [storage] [/opt] Storage exceeds 90% of disk capacity\nstorage_perc = 6.79"}

      includes/alerting/webhook.inc.php is included as attachment.

      Definition for includes/definitions/transports.inc.php,

      $config['alerts']['transports']['webhook'] = array(
      'name' => 'Webhook',
      'parameters' => array(
      'required' => array(
      'url' => "URL, e.g. https://webhook/api",
      ),
      'global' => array(
      'token' => 'Authentication token',
      'originator' => 'Sender of message'
      ),
      )
      );

      Attachments

        Activity

          People

            adama Adam Armstrong
            colin.stubbs Colin Stubbs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: