Moogsoft Docs

Webhook

You can install a webhook integration to send events from a webhook client to Moogsoft AIOps.

The integration allows you to POST JSON payloads to your instance via HTTP/HTTPS.

Before You Begin

Before you start to set up your webhook integration, ensure you have met the following requirements:

  • If you are using an on-prem version of Moogsoft AIOps, you have configured it with a valid SSL certificate.
  • Your webhook client can make requests to external endpoints over port 443.
  • The integration client is able to submit a JSON payload and supports basic auth.

Configure the Integration

Configure the Webhook integration in Moogsoft AIOps as follows:

  1. Navigate to the Integrations tab.
  2. Click Webhook in the Monitoring section.
  3. Follow the instructions to create an integration name.

Configure the Webhook

These instructions offer the basic information you need to configure a webhook integration. Different webhook clients may have different implementation options. Refer to the documentation of your webhook client for more information.

  1. Enter the URL for this instance of Moogsoft AIOps:

    Field
    Value
    URL

    <your webhook integration URL>

    For example: https://example.moogsoftaiops.com/events/webhook_webhook1

  2. Your basic authentication User ID and Password are:

    Field Value
    User ID

    Username generated in the Moogsoft AIOps UI

    Password

    Password generated in the Moogsoft AIOps UI

    Depending on the webhook client, you can either use these user credentials directly or use a base64 encoder to encode them in 'username:password' format.

  3. Enter JSON as the body of the webhook event in the following format and edit the field values as appropriate:

    {
    	"signature": "<signature>",
    	"source": "<source>",
    	"source_id": "<source_id>",
    	"external_id": "<external_id>",
    	"agent_location": "<agent_location>", 
    	"severity": "<severity>",
    	"type": "<type>",
    	"manager": "<manager>",
    	"class": "<class>",
    	"description": "<description>",
    	"agent_time": "<agent_time>"
    }
    Field Input Description
    signature String Used to identify the event. Usually source:class:type.
    source String Hostname or FQDN of the source machine that generated the event.
    source_id String Unique identifier for the source machine.
    external_id String Unique identifier for the event source.
    agent_location String Geographical location of the agent that created the event.
    severity Integer Severity level of the event from 0-5 (clear - critical).
    type String Level of classification for the event. Follows hierarchy class then type.
    manager String General identifier of the event generator or intermediary.
    class String Level of classification for the event. Follows hierarchy class then type.
    description String Text description of the event.
    agent_time String Timestamp of when the event occurred in Unix epoch time.
  4. Add a header field with the content type. For the authorization type, enter 'Basic' followed by you basic auth User ID and Password in 'userid:password' format.

    {
    	"Content-Type": "application/json",
    	"Authorization": "Basic <base64 encoded credentials>"
    }

    Use a base64 encoder to encode 'userid:password' if required by your webhook client. For example, for 'myuser:mypassword' the encoded result would be: 'dXNlcmlkOnBhc3N3b3JkDQo='.

  5. Connect the webhook as required in the client and turn it on.

Test the Webhook

You can run the following cURL command to send sample data to Moogsoft AIOps.

Make sure to replace <userid>:<password> and <url> with the values entered previously.


curl -u <userid>:<password> <url> -H "Content-Type: application/json" -X POST -v --data '
      {
         "signature":"my_test_box:application:Network",
         "source_id":"198.51.100",
         "external_id":"id-1234",
         "manager":"my_manager",
         "source":"my_test_box",
         "class":"application",
         "agent_location":"my_agent_location",
         "type":"Network",
         "severity":3,
         "description":"high network utilization in application A",
         "agent_time":"1411134582"
      }'

If successful, you should receive the following response:

{
  "response": {
    "processed": 1,
    "cached": 0,
    "received": 1
  },
  "success": true,
  "message": "Processed 1 event(s)"
}

See REST LAM for more information on webhook and its response codes.