Page tree
Skip to end of metadata
Go to start of metadata

A listener that will ingest from a Webhook (POST).

Configure a webhook in your external system that will forward to your Moogsoft AIOps instance.

Configuring the Webhook

  1. Create the webhook by selecting webhooks integrations.
  2. Add the URL for this Moogsoft AIOps instance as shown above.

  3. Generate the basic auth string, take the username and password provided above and use a base64 encode, 'username:password'.

  4. Use this JSON as the body of the Webhook event, adding local event data as appropriate by replacing the <xxx> example field placeholders.

    "events": [{
    	"signature": "<String - that allows basic de-duplication of the event, usually source:class:type>"
    	"source": "<String - Hostname>",
    	"source_id": "<String - Source ID>",
    	"external_id": "<String - ID>",
    	"agent_location": "<String - Location>", 
    	"severity": <Int 0-5 severity (5 critical, 0 clear)>,
    	"type": "<String - Type>",
    	"manager": "<String - Manager>",
    	"class": "<String - Class>",
    	"description": "<String - the detail of the event message>",
    	"agent_time": "<String - the number of seconds since 1 Jan 1970 (Unix/Epoch time)>"
    }]
  5. Add the headers field where xxx is the value created in step 3:

    {
    "Content-Type": "application/json",
    "Authorization": "Basic xxx"
    }
  6. Connect the webhook as required in the source system and turn on.

Signature

The signature you choose uniquely identifies the alert,  it should contain at least identifiers for the source host and an indication of the type of event, it can be a concatenated string. Eg. 'HOST0010:MEMFREE' or 'HOST0020:DB123:Connection'

Test the endpoint

To test that this endpoint is working you can use a curl command as shown.

curl -u Webhook:XXXXX https://<Your Instance Name>.moogsoft.com/events/webhook_webhook1 -H "Content-Type: application/json" -X POST -v --data '
{
   "events":[
      {
         "signature":"my_test_box:application:Network",
         "source_id":"1.2.3.4",
         "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"
      }
   ]
}'


This command should return:


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


 upon success.

See REST LAM response codes  for testing and troubleshooting.

Moogsoft AIOps Sample

The default Webhook cookbook will show all alerts that impact the same or similar hosts (source).




  • No labels