Skip to main content

Configure the New Relic Polling LAM

The New Relic Polling LAM allows Moogsoft Onprem to collect event data from one or more New Relic systems.

You can install a basic New Relic Polling integration in the UI. See New Relic Polling for integration steps.

Configure the New Relic Polling LAM if you want to configure custom properties, set up high availability or configure advanced options that are not available in the UI integration.

Before You Begin

The New Relic Polling integration has been validated with New Relic v2.3. Before you set up the LAM, ensure you have met the following requirements for each New Relic server:

  • You have the URL and API Key of your New Relic system.

  • You know whether you want to retrieve events or violations from New Relic.

  • Your New Relic server is able to accept HTTP/HTTPS requests.

Configure the LAM

Edit the configuration file to control the behavior of the New Relic Polling LAM. You can find the file at $MOOGSOFT_HOME/config/newrelic_client_lam.conf

See the New Relic Polling Reference for a full description of all properties. Some properties in the file are commented out by default. Uncomment properties to enable them.

  1. Configure the connection properties for each New Relic target:

    • url: The URL of your New Relic instance.

    • retrieve_type: The type of New Relic data to retrieve: event or violation.

    • api_key: Your New Relic API key.

  2. Optionally configure a filter, if you want to restrict the data collected from New Relic:

    • product: The New Relic product for which to retrieve data. Options are APM, BROWSER, MOBILE, SERVERS, PLUGINS, SYNTHETICS, ALERTS.

    • entity_type: The New Relic entity type for which to retrieve data. Options are Application, Server, KeyTransaction, Plugin, MobileApplication, BrowserApplication, Monitor.

    • event_type: The New Relic event type for which to retrieve data. Options are NOTIFICATION, DEPLOYMENT, VIOLATION_OPEN, VIOLATION_CLOSE, VIOLATION, INSTRUMENTATION.

  3. Configure the LAM behavior for each target:

    • request_interval: Length of time to wait between requests, in seconds.

    • max_retries: Number of times the LAM attempts to reconnect after connection failure.

    • retry_interval: Length of time to wait between reconnection attempts, in seconds.

    • recovery_interval: Length of time to wait between requests, in seconds, when the LAM re-establishes a connection after a failure.

    • max_lookback: Period of time for which to recover missed events, in seconds, when the LAM re-establishes a connection after a failure.

    • timeout: Length of time to wait before halting a connection or read attempt, in seconds.

  4. Configure the SSL properties if you want to encrypt communications between the LAM and New Relic:

    • disable_certificate_validation: Whether to disable SSL certificate validation.

    • path_to_ssl_files: Path to the directory that contains the SSL certificates.

    • server_cert_filename: Name of the SSL root CA file.

    • client_key_filename: Name of the SSL client key file.

    • client_cert_filename: Name of the SSL client certificate.

  5. If you want to connect to New Relic through a proxy server, configure the host, port, user, and password or encrypted_password in the proxy section of the file.

  6. Optionally configure the LAM identification and capture logging details:

    • name: Maps to $Laminstancename, so that the agent field indicates events Moogsoft Onprem ingests from this LAM.

    • capture_log: Name and location of the LAM's capture log file, which it writes to for debugging purposes.

  7. Optionally configure severity conversion. See Severity Reference for further information and "Conversion Rules" in Tokenize Source Event Data for details on conversions in general.

  8. Optionally configure the process logging details:

    • configuration_file: Name and location of the LAM's process log configuration file. See Configure Logging for more information.Configure Logging

Example

You can configure the New Relic LAM to retrieve events from one or more targets. The following example demonstrates a configuration that targets two New Relic sources. For a single source, comment out the target2 section. If you have more than two sources, add a target section for each one and uncomment properties to enable them.

monitor:
    name                                      : "New Relic Client Lam Monitor",
    class                                     : "CNewRelicClientMonitor",
    request_interval                          : 60,
    max_retries                               : -1,
    retry_interval                            : 60,
    retry_recovery:
    {
        recovery_interval                     : 20,
        max_lookback                          : -1
    },
    targets:
    {
        target1:
            url                               : "https://api.examplenewrelic.com/",
            retrieve_type                     : "event",
            api_key                           : "SAMPLE_KEY_1",
            filter: 
            {
                product                       : "MOBILE",
                entity_type                   : "MobileApplication",
                event_type                    : "NOTIFICATION"
            },
            proxy:
            {
                host                          : "localhost",
                port                          : 8080,
                user                          : "proxy_user",
                encrypted_password            : "ieytOFRUdLpZx53nijEw0rOh07VEr8w9lBxdCc7229o="
            },
            disable_certificate_validation    : false,
            path_to_ssl_files                 : "config",
            server_cert_filename              : "server.crt",
            client_key_filename               : "client.key",
            client_cert_filename              : "client.crt",
            request_interval                  : 60,
            max_retries                       : 20,
            retry_interval                    : 120,
            retry_recovery:
            {
                recovery_interval             : 40,
                max_lookback                  : 360
            },
            timeout                           : 180            
        },
        target2:
        {
            url                               : "https://api.example2newrelic.com/",
            retrieve_type                     : "violation",
            api_key                           : "SAMPLE_KEY_2",
            filter: 
            {
                product                       : "BROWSER",
                entity_type                   : "BrowserApplication",
                event_type                    : "VIOLATION"
            }
            polling_interval                  : 10,
            max_retries                       : 30,
            retry_interval                    : 180,
            timeout                           : 360
            }
        }
    },
agent:
{
    name                  : "New Relic",
    capture_log           : "$MOOGSOFT_HOME/log/data-capture/newrelic_client_lam.log"
},
log_config:
{
    configuration_file    : "$MOOGSOFT_HOME/config/logging/newrelic_client_lam.log.json"
},

Configure for High Availability

Configure the New Relic Polling LAM for high availability if required. See High Availability Overview for details.

Configure LAMbot Processing

The New Relic Polling LAMbot processes and filters events before sending them to the Message Bus. You can customize or bypass this processing if required. You can also load JavaScript files into the LAMbot and execute them.

See LAMbot Configuration for more information. An example New Relic Polling LAM filter configuration is shown below.

filter: 
{
    presend: "NewRelicClientLam.js",
    modules: [ "CommonUtils.js" ]
}

Start and Stop the LAM

Restart the New Relic Polling LAM to activate any changes you make to the configuration file or LAMbot.

The LAM service name is newrelicclientlamd.

See Control Moogsoft Onprem Processes for further details.

If the LAM fails to connect to one or more New Relic sources, Moogsoft Onprem creates an alert and writes the details to the process log. Refer to the logging details for LAMs and integrations for more information.