Moogsoft Docs

New Relic Webhook

To integrate with New Relic, set up a webhook notification channel in New Relic. After you configure the integration, New Relic sends alert data to Moogsoft AIOps.

See the New Relic documentation for details on New Relic components.

Before You Begin

The New Relic integration has been validated with New Relic 2016. Before you start to set up your integration, ensure you have met the following requirements:

  • You have an active New Relic account.

  • You have the permissions to configure notification channels in New Relic.

  • New Relic can make requests to external endpoints over port 443. This is the default.

Configure the New Relic Integration

Configure the New Relic integration in Moogsoft AIOps as follows:

  1. Navigate to the Integrations tab.

  2. Click New Relic in the Monitoring section.

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

    Additionally, set a Basic Authentication username and password.

See Configure the New Relic Webhook LAM for advanced configuration information.

Configure New Relic

Configure a notification channel in New Relic to send event data to Moogsoft AIOps as follows. For more help, see the New Relic documentation.

You can create a channel using the REST API or by using the New Relic UI.

Create a channel using the REST API

You can create notification channels and update New Relic alert policies using REST API calls. See the New Relic documentation for more information about REST API calls for alerts.

Use the following REST call to create a notification channel to send event data to your system:

curl -X POST 'https://api.newrelic.com/v2/alerts_channels.json' \
     -H 'X-Api-Key:{admin_api_key}' -i \
     -H 'Content-Type: application/json' \
     -d \
'{
  "base_url": "http://my.moogsoft.com",
  "auth_username": "moogsoft_username",
  "auth_password": "moogsoft_password",
  "payload_type": "application/json",
  "payload": {"account_id": 1, "account_name": "my_moogsoft_com" },
  "headers": {"header1": "test", "header2": "test"}
}'

Use the following REST call to update a New Relic alert policy with one or more notification channels:

curl -X PUT 'https://api.newrelic.com/v2/alerts_policy_channels.json' \
     -H 'X-Api-Key:{admin_api_key}' -i \
     -H 'Content-Type: application/json' \
     -G -d 'policy_id=policy_id&channel_ids=channel_id' 
Create a channel using the New Relic UI

Log in to New Relic to configure a notification channel to send event data to Moogsoft AIOps. For more help, see the New Relic Documentation.

  1. Create a new notification channel in New Relic with the following properties:

    Field

    Value

    Channel Type

    Webhook

    Channel Name

    Send to Moogsoft AIOps

    Base URL

    <your New Relic integration URL>

    For example: https://example.Moogsoft.com/events/newrelic_newrelic1

  2. Enable Basic Authentication and enter the following credentials:

    Field

    Value

    User Name

    Username set in the Moogsoft AIOps UI.

    Password

    Password set in the Moogsoft AIOps UI.

  3. Add the following custom JSON payload:

    {
       "account_id": "$ACCOUNT_ID",
       "account_name": "$ACCOUNT_NAME",
       "condition_id": "$CONDITION_ID",
       "condition_name": "$CONDITION_NAME",
       "current_state": "$EVENT_STATE",
       "details": "$EVENT_DETAILS",
       "event_type": "$EVENT TYPE",
       "incident_acknowledge_url": "$INCIDENT_ACKNOWLEDGE_URL",
       "incident_id": "$INCIDENT_ID",
       "incident_url": "$INCIDENT_URL",
       "owner": "$EVENT_OWNER",
       "policy_name": "$POLICY_NAME",
       "policy_url": "$POLICY_URL",
       "runbook_url": "$RUNBOOK_URL",
       "severity": "$SEVERITY",
       "targets": "$TARGETS",
       "timestamp": "$TIMESTAMP"
    }
  4. Optionally send a test notification to verify that Moogsoft AIOps can receive a test event from New Relic.

  5. Assign the notification channel to one or more alert policies in New Relic. You can create a new alert policy or add the notification to an existing alert policy.

When New Relic detects events matching the alert policy, it automatically notifies Moogsoft AIOps over the webhook notification channel.