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.
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:
- New Relic Infrastructure installed on host.
- Linux or Windows distribution compatible with New Relic Infrastructure.
- Existing service checks that conform to the Nagios Plugin API.
To install the Nagios integration:
- Follow the instructions for installing an integration, using the file name
- Via the command line, change directory to the integrations folder:
- Create a copy of the sample configuration file by running:
sudo cp nagios-config.yml.sample nagios-config.yml
- Create a copy of the sample service checks file by running:
sudo cp nagios-service-checks.yml.sample nagios-service-checks.yml
- Edit the
nagios-config.ymlconfiguration file using the configuration settings.
- Restart the infrastructure agent.
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.
service_checks_config yaml file contains the top-level array
service_checks. Each service check must contain both a
name and a
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.
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:
integration_name: com.newrelic.nagios instances: - name: nagios # Command can only be metrics command: metrics arguments: # The absolute path to the service checks config file service_checks_config: /etc/newrelic-infra/integrations.d/nagios-service-checks.yml
service_checks: - name: check_users command: ["/usr/local/nagios/libexec/check_users", "-w", "5", "-c", "10"] labels: 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 infrastructure.newrelic.com > Integrations > On-host integrations and select one of the Nagios integration links.
For more on how to find and use your data, see Understand integration data.
The Nagios integration collects the following metric data attributes.
Nagios service check sample metrics
These attributes can be found by querying the
NagiosServiceCheckSample event types in Insights.
The command used to run the service check.
The stderr output of the service check.
The stdout output of the service check.
A descriptive name of the service check.
The return code of the service check. Options:
- 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.