Skip to main content

Webhook

You can install the Webhook integration to send events from a webhook client to Moogsoft Onprem.

The integration allows you to POST JSON payloads to your instance via HTTP/HTTPS. The Webhook returns standard HTTP status codes. For more information, see Status Code Definitions.

When you use the integrations UI, you can only configure the visible properties. If you want to implement a more complex Webhook integration with custom settings, see Configure the Webhook LAM.

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 Onprem, 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 Onprem as follows:

  1. Navigate to the Integrations tab.

  2. Click Webhook in the Monitoring section.

  3. Provide a unique integration name. You can use the default name or customize the name according to your needs.

  4. Set a Basic Authentication username and password.

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 Onprem:

    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 Onprem UI

    Password

    Password generated in the Moogsoft Onprem 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:

    {
        "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>"
    }

    Note

    Note that this format is only valid if your monitoring tool does not have a structured payload format. If it does, configure the payload on the Data Mapping tab.

    Field

    Input

    Description

    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 Onprem.

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 '
{
    "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)"
}