Nagios monitoring integration

The Nagios integration collects the responses of your existing service checks and reports them to New Relic Infrastructure. This document explains how to install and configure the Nagios integration and describes the data collected.

Access to this feature depends on your subscription level. Requires Infrastructure Pro.

This on-host integration has been contributed to the New Relic GitHub under an MIT license.


The Nagios on-host integration allows you to utilize your existing service checks directly, without the need for a running Nagios instance.

Compatibility and requirements

To use the Nagios integration, ensure your system meets these requirements:


On-host integrations do not automatically update. For best results, you should occasionally update the integration and update the Infrastructure agent.

To install the Nagios integration:

  1. Follow the instructions for installing an integration, using the file name nri-nagios.
  2. Via the command line, change directory to the integrations folder:
    cd /etc/newrelic-infra/integrations.d
  3. Create a copy of the sample configuration file by running:
    sudo cp nagios-config.yml.sample nagios-config.yml
  4. Create a copy of the sample service checks file by running:
    sudo cp nagios-service-checks.yml.sample nagios-service-checks.yml
  5. Edit the nagios-config.yml configuration file using the configuration settings.
  6. Restart the infrastructure agent.

It is also possible to manually install integrations from a tarball file. For more information, see Install manually from a tarball archive.


Use the Nagios integration's nagios-config.yml configuration file to put required login credentials and configure how data is collected. For an example configuration, see the example config file.


The nagios-config.yml contains only one configurable argument:

service_checks_config: This points to a yaml file containing definitions of the service checks that will be run by the integration.


The service_checks_config yaml file contains the top-level array service_checks. Each service check must contain both a name and a command.

Key Description


The naming convention is not specific, and allows for easy recognition in the Infrastructure UI.


The command is an array of strings, with the first position containing the path to the executable and the remaining positions containing the arguments to the executable.


A collection of key: value pairs which help to identify and group service checks in Insights.


Attempts to parse the output of service checks that conform to the Nagios Plugin API spec. Default: false.


Non-configurable commands are run by the Infrastructure agent, which itself is run by the root user. For the integration to run properly, ensure that the permissions on the yaml file are appropriately restrictive as indicated below:

Linux permissions

Set the user permissions flag to 0600, restricting read and write privileges to the file owner. If permissions do not meet this requirement, an error will be logged and the integration will fail to run.

Windows permissions

By default, the agent and any commands in the yaml file run as an Administrator. As the integration is unable to check permissions, it is up to the user to appropriately restrict permissions for the file.

Example file configurations:

Example nagios-config.yml configuration
integration_name: com.newrelic.nagios

  - name: nagios
    # Command can only be metrics
    command: metrics
      # The absolute path to the service checks config file
      service_checks_config: /etc/newrelic-infra/integrations.d/nagios-service-checks.yml
Example nagios-service-checks.yml configuration
  - name: check_users
    command: ["/usr/local/nagios/libexec/check_users", "-w", "5", "-c", "10"]
    parse_output: true
      env: staging
      key1: val1
  - name: check_yum
    command: ["/usr/local/nagios/libexec/check_yum"]

Find and use data

To find your integration data in Infrastructure, go to > Third-party services and select one of the Nagios integration links.

In New Relic Insights, Nagios data is attached to the NagiosServiceCheckSample Insights event type.

For more on how to find and use your data, see Understand integration data.

Metric data

The Nagios integration collects the following metric data attributes.

These attributes can be found by querying the NagiosServiceCheckSample event types in Insights.

Metric Description


The command used to run the service check.


The standard error (stderr) output of the service check.


The portion of the message that is parsed by Nagios as $LONGSERVICEOUTPUT$. Only enabled if parse_output is set.


The standard output (stdout) of the service check.

The descriptive name of the service check being performed.


The portion of the message that is parsed by Nagios as $SERVICEOUTPUT$. Only enabled if parse_output is set.


The return code of the service check. Options:

  • 0 = Ok
  • 1 = Warning
  • 2 = Critical
  • 3 = Unknown


Any additional metrics defined and reported by the service check. Only enabled if parse_output is set.


Troubleshooting tips:

Config parsing failed error

The following error appears in the log file:

Config parsing failed: service checks file permissions are not restrictive enough. Required file permissions are 0600. See documentation for details


Set the user permissions flag to 0600, restricting read and write privileges to the file owner.


If the file is not owned by the root user or the file can be written to by a user other than the root user, the integration will allow users to run arbitrary commands as though they are a root user. If permissions do not meet the requirement, an error will be logged and the integration will fail to run.

For more help

Recommendations for learning more: