Use a custom integration framework to create webhook integrations to build data ingestion and capture events in OpsRamp. Use either OpsRamp APIs or user interface to build webhook integration.

Configure using OpsRamp API

Configure webhook integration using OpsRamp API.

API endpoint: https://{api-url}/api/v2/tenants/{tenantId}/integrations/install/CUSTOM

Example alert payload in JSON from third-party applications

{
    "severity" : "Warning",
    "eventDetails" : "Test Description",
    "eventResourceName" : "Test ResourceName 1",
    "eventAlertMetric" : "Test Metric",
    "shortDescription" : "Test API Alert for custom webhook integration"
}

Example API endpoint URL and payload

Given below is the example payload for the above-mentioned JSON sample webhook event to install a custom integration with Webhook authentication and sample webhook mappings. With this payload, the default Alert Source is saved as Custom.git:

{
    "displayName": "API Testing",
    "category": "Monitoring",
    "inboundConfig": {
        "authentication": {
            "authType": "WEBHOOK"
        },
        "mapAttributes": [{
            "name": "Alert state",
            "thirdPartyAttrName": "severity",
            "entityType": "ALERT",
            "thirdPartyEntityType": "Event",
            "attrValues": [{
                "attrValue": "Ok",
                "thirdPartyAttrValue": "Ok"
            }, {
                "attrValue": "Warning",
                "thirdPartyAttrValue": "Warning"
            }, {
                "attrValue": "Critical",
                "thirdPartyAttrValue": "Critical"
            }, {
                "attrValue": "Info",
                "thirdPartyAttrValue": "Info"
            }]
        }, {
            "name": "Alert description",
            "thirdPartyAttrName": "eventDetails",
            "entityType": "ALERT",
            "thirdPartyEntityType": "Event"
        }, {
            "name": "Alert resource name",
            "thirdPartyAttrName": "eventResourceName",
            "entityType": "ALERT",
            "thirdPartyEntityType": "Event"
        }, {
            "name": "Alert metric",
            "thirdPartyAttrName": "eventAlertMetric",
            "entityType": "ALERT",
            "thirdPartyEntityType": "Event"
        }, {
            "name": "Alert subject",
            "thirdPartyAttrName": "shortDescription",
            "entityType": "ALERT",
            "thirdPartyEntityType": "Event"
        }]
    }
}

Configure using web interface

From the OpsRamp console, install a monitoring configuration and configure for webhook authentication.

Install custom integration for Monitoring

  1. From All Clients, select a client.

  2. Go to Setup > Account.

  3. Select the Integrations and Apps tab.

  4. The Installed Integrations page, where all the installed applications are displayed. Note: If there are no installed applications, it will navigate to the Available Integrations and Apps page.

  5. Click + ADD on the Installed Integrations page. The Available Integrations and Apps page displays all the available applications along with the newly created application with the version.
    Note: You can even search for the application using the search option available. Also you can use the All Categories option to search.

  6. Click ADD in the Custom Integration application.

  7. Enter the following details and click Install:

    • Name

    • Description

    • Category: Select Monitoring.

    • Alert Source: Select Custom if you do not find the source already available on the list. Based on the selection, the alerts are filtered in the OpsRamp Alerts section. To add a source on the list to filter alerts, contact support.

      Add alert source for custom integration
    • Upload Logo

When a client needs an integration that is already installed for the partner, the option, Use Partner configuration and events is displayed. If you select the option, the custom integration automatically inherits details about Name, Description, and Logo as defined for the integration by the partner.

Add Partner integration

Configure the custom integration for webhook

The custom integration category allows inbound (Inbound Custom Monitoring to OpsRamp)) communication.

  1. Select Webhook as Authentication Type.

  2. Verify the default Role.
    You can execute only those APIs that are associated with the selected role.

  3. Click Save and make a note of Token and webhook URL.
    Both are required while configuring a third-party application.

  4. Expand Map Attributes, select OpsRamp Entity Alert from the drop-down available and click + to define mappings.

    • Field mapping: Maps the fields from your application entity attributes to OpsRamp entity attributes. For example, if you are trying to integrate events as OpsRamp alerts, alert subject, alert description, alert time, alert resource, and hostname are field mapping attributes.
    • Field value mappings: If an attribute has multiple values to map, that attribute falls under field value mappings. for example, when trying to integrate events as OpsRamp alerts, alert state (with values critical, warning, Info) and alert metric are field value mapping attributes.

  5. Select Additional settings.

    Admins can configure event ingestion integrations to post events only if the resources are managed by OpsRamp. For resources that are not managed, the events are dropped and not processed.

  6. Select templates from Monitoring of Integrations if you want to monitor integration failures. See monitoring integration failures for more information.

  7. View logs from the Audit Logs tab.
    Logs are visible only after successful API calls.

View Alerts

View Alerts

Validate

Validate the configurations using any API development tool, for example, POSTMAN.

Example request payload

{
"Alertstate" :"Ok",
"Description":"test description",
"serviceName":"Metric",
"ResourceName":"Host",
"Subject" : "Alert Subject"
}

Post alert through Postman

  1. Enter webhook URL copied from OpsRamp.
  2. Change the method to POST.
  3. Add the mentioned headers ‘Content-Type: application/json’ and ‘Accept: application/json’.
  4. Enter the JSON request payload in the body section.
  5. View failure or success result.