New Relic Webhook Integration Reference
The New Relic LAM is a standard feature that enables Moogsoft AIOps to ingest incident data from New Relic.
The following information explains the configuration required to send New Relic data to Moogsoft AIOps.
See New Relic Webhook for UI configuration instructions.
Requirements
The ingestion of incident data from New Relic requires Moogsoft AIOps installed and running with a New Relic LAM, which is configured to allow inbound communication from New Relic.
A New Relic account is required, with required policies and notification channel configured as described below.
Capabilities
The integration between New Relic and Moogsoft AIOps accepts all New Relic incident types.
New Relic can monitor a range of products and services, for which incident information can be sent. The list below summarises the different types:
Incident type
|
Description
|
---|---|
New Relic APM | Used to monitor the performance and availability of web applications |
New Relic Browser | Monitor browser specific data and software performance from an end-user’s perspective |
New Relic Mobile | Monitor performance problems in mobile apps operating in complex production environments |
New Relic Infrastructure | Find health issues such as high CPU/memory/disk utilization and failed connections |
New Relic Insights | Query application business metrics, performance data, and customer behaviour |
New Relic Synthetics | Test and find issues with your software's business critical functionality |
The performance of Moogsoft AIOps will be dependent on the number of events received per second and the specifications of the Moogsoft AIOps system on which the LAM is running.
Moogsoft AIOps Configuration
A New Relic LAM is required to be running on Moogsoft AIOps in order to receive incident data from New Relic. The following configuration files (which are installed by default) are required for the New Relic LAM to run:
-
The New Relic LAM configuration file:
$MOOGSOFT_HOME/config/newrelic_lam.conf
The LAMbot file which performs the main processing on the Events received:$MOOGSOFT_HOME/bots/lambots/NewRelicLam.js
New Relic LAM configuration
-
Check the New Relic LAM configuration file to ensure that the below fields are set correctly:
Field Description Example zone The Moogsoft AIOps zone name where the LAM will run. Demo. This must be the same across all components. port The port number where the LAM will be receiving data from New Relic. Port number 8888. This must be accessible by New Relic. address localhost or the hostname of the system running Moogsoft AIOps. If Moogsoft AIOps is running on premise the default address is : 0.0.0.0
If Moogsoft AIOps is running on e.g. Amazon Web Services, it may be similar to ew2.234.234.computer.amazonaws.comaccept _all_json In order for Moogsoft AIOps to accept the JSON data sent by New Relic, set to True.
Note: The New Relic LAM can be configured to use SSL, however New Relic does not recognise the self-signed certificates supplied with Moogsoft AIOps. In order to use SSL communication between Moogsoft AIOps and New Relic, use an official verified and signed certificate on the Moogsoft AIOps system, and in the LAM, set use_ssl to True.
-
Define the following location and names of the certificates to use in the New Relic LAM configuration file (newrelic_lam.conf):
Certificate Description path_to_ssl_files The directory in which the certificates are placed. ssl_key_filename Name of the certificate .key file. ssl_cert_filename Name of the certificate .pem file. -
Enter the following command to start the service:
service newreliclamd start
Moogsoft AIOps is now listening on the specified port (for example port number 8888) and is ready to receive data sent from New Relic.
Moogsoft AIOps configuration for the New Relic LAM is now complete.
New Relic Configuration
To send incident data from New Relic ensure you have the following:
- A New Relic account
- Configuration of required policies
- A notification channel
If you already have an account set up and are already monitoring one or more environments, you may skip the account set up section below and proceed directly to the second section below.
New Relic Account Setup
-
Create a free New Relic account by visiting the New Relic website
https://newrelic.com/signup
Monitoring Agent Setup
When you have created a New Relic account, and before configuring New Relic to send incident information to Moogsoft AIOps, a system must be set up that is monitored by New Relic. For this installation, New Relic is installed and set up to monitor a virtual machine running CentOS. The following steps explain the installation of New Relic on a CentOS machine:
-
Click
Servers
. You see a
Get started with New Relic Servers
page appears:
-
Select the
Red Hat or CentOS
option, and scroll down to see the next steps, which are carried out in a terminal window.
-
Select the
Red Hat or CentOS
option, and scroll down to see the next steps, which are carried out in a terminal window.
-
Open a terminal window and enter the following command to Add the New Relic yum repository to the machine which will be monitored:
rpm -Uvh http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm
-
Enter the following command to Install the Server Monitor package :
yum install newrelic-sysmond
When installation successfully completes, a screen similar to the one below appears:
-
Enter the commands below to add a license key to the New Relic config file, and start the Server Monitor daemon:
nrsysmond-config --set license_key=LICENCE_KEY /etc/init.d/newrelic-sysmond start
Where the
LICENCE_KEY
is the value shown in the fourth step on the setup page.
New Relic should now detect the machine and a screen similar to the one below appears when you click Servers (at the top):
Alert Policy Setup
To monitor the detected machine, set up a New Relic Alert policy to define the conditions for which incidents will be created.
-
Click
Alerts
and then click
Alert policies
, (at the top right of the New Relic account page):
-
Click
New Alert policy
, enter a name for the new policy and then click
Save
.
You see the following screen:
-
Click
Create a condition
, and on the next page select
Servers
as the
product
, and
Metric
as
type of condition
:
-
Click
Next, select targets
and in the next section select the server from the list on the left, either by searching for the machine name or by clicking on
All Servers
. Click the check box to select the server:
-
Click Next, define thresholds (CPU % and Memory % thresholds will be defined for this set up).
From the list at the top left, select CPU % and enter the settings:CPU % has an average below 100 % at least once in 5 minutes
as shown below:
-
Click Save condition and then Add a condition .
Select Memory % (from the list at the top left) and enter the settingsMemory % has a percentage below 100 % at least once in 5 minutes
as shown below:
-
Click
Save condition
, and ensure your alert conditions screen looks similar to the one below, with the two conditions listed:
Specify how incidents should be created when conditions in this alert policy are violated.
-
Click
Incident preference
(at the top right). You see the following screen:
- Select the By condition and target option, and click Save .
Notification Channel Setup
To define how and where notifications are sent, setup a channel through which the notifications will be sent:
-
Click
Alerts
, (in your New Relic account, at the top right) and then click
Notification channels
:
-
Click
New notification channel
and select channel type as
Webhook
. Enter a
Name
for the channel and the
Base URL
(this is the URL to which the notifications are sent).
In this set up, the public facing IP address provides access to the Moogsoft AIOps system.
Note : Append the port number specified in the Moogsoft AIOps Configuration to the URL (for example, port number8888
, as shown below:
-
Click
Use Custom Payload
, and ensure that the
Payload
fields information shown below is displayed, and that
JSON format
is selected for
Payload Type
:
Add the channel to the Alert policy that was created earlier, or any existing policies that you may have set up for monitoring -
Click
Create channel
, and then click
Alert policies
.
Click the policy you want from the list, and then select the Notification channels tab:
-
Click
Add notification channels
and from the list on the left, select
Webhook
. Select the webhook channel, and click
Update policy
, to enable notifications to be sent to Moogsoft AIOps. The Alert Policy screen should now look similar to the one below:
New Relic configuration for Moogsoft AIOps is now complete.
The tables below list the default mappings between the JSON fields being sent from New Relic and the fields in the New Relic LAM:
New Relic > AIOps
New Relic
|
Moogsoft AIOps
|
---|---|
account_name + account_id |
source_id |
condition_id |
custom_info.conditionId |
condition_name |
class |
details |
description |
event_type |
type |
event_type + incident_id |
external_id |
incident_acknowledge_url |
custom_info.AcknowledgeIncident |
incident_url |
agent_location |
policy_name |
custom_info.policyName |
policy_url |
custom_info.policyUrl |
severity |
severity |
targets |
custom_info.name
|
source |
|
timestamp |
custom_info.timestamp |
AIOps > New Relic
Moogsoft AIOps
|
New Relic
|
---|---|
agent_location |
incident_url |
class |
condition_name |
custom_info.AcknowledgeIncident |
incident_acknowledge_url |
custom_info.conditionId |
condition_id |
custom_info.name
|
targets |
custom_info.policyName |
policy_name |
custom_info.policyUrl |
policy_url |
custom_info.timestamp |
timestamp |
description |
details |
external_id |
event_type + incident_id |
severity |
severity |
source |
|
source_id |
account_name + account_id |
type |
event_type |
Testing and Sample Alerts
Shortly after setting up New Relic, violations should appear on the Events page, in the violations section, such as shown below:
The above violations are sent to Moogsoft AIOps, where they were received by the New Relic LAM and processed to create alerts as shown below:
Details of the alerts highlighted are shown below:
Configuration for sending New Relic data to Moogsoft AIOps is now complete.
Moogsoft AIOps New Relic Cookbook Recipe
Moogsoft AIOps includes a Cookbook recipe for you to use which uses New Relic LAM data.
This default recipe can create Situations based on 100% similarity of the hostname received from New Relic, with a cook for time of 15 minutes. Administrators can find the recipe in Cookbook Recipes (via System Administration):
For more information on using and editing Cookbook Recipes, see Cookbook Recipe Builder .