Monitoring Nagios (private preview)

After you install the Instana host agent, the Nagios sensor is automatically installed. You can view metrics for the hosts that are monitored by Nagios in the Instana UI after you configure as outlined in the Configuring section.

Supported information

Nagios provides monitoring of all mission-critical infrastructure components that include applications, services, operating systems, network protocols, systems metrics, and network infrastructure.

For more information about Nagios, see Nagios Product Site.

Supported operating systems

The Nagios sensor supports the operating systems that are consistent with the requirements of the host agent. To find the supported operating systems for every host agent, see the "Supported operating systems" section of each host agent, such as Supported operating systems for Unix.

Supported versions

Instana supports metrics and events for Nagios XI 5 and later.

Prerequisites

To connect to the Nagios XI client-instance endpoint, you must configure the Nagios sensor with the endpoint and API key authentication. The Nagios XI endpoint is the URL that you use to communicate with the Nagios REST API. This endpoint value must be an HTTPS value and include '/nagiosxi' at the end of the URL. For example, https://<nagios_server_address>/nagiosxi.

For more information about accessing the Nagios API, see Nagios API keys or view the documentation within your instance of Nagios XI (in the Help menu).

Gathering data

The Nagios sensor can collect metrics and events for the hosts that are monitored by Nagios.

The following information is collected:

  • Entities (hosts)
  • Events
  • Metrics

Instana collects network metrics as part of host metrics. For more information, see Viewing metrics.

Configuring

The Nagios sensor must be configured with the endpoint and API key for the Nagios instance that you want to connect to. You need to configure the following fields in the <agent_install_dir>/etc/instana/configuration.yaml agent configuration file. The minimum configuration information that is required to install a Nagios connector is as follows:

# Nagios
com.instana.plugin.nagios:
  enabled: true                                          # Required
  endpoint: 'https://<nagios_server_address>/nagiosxi'    # Required
  key: `<nagios-instance-key>`                           # Required
  poll_rate: 30                                          # Optional
  target_zone: 'my-zone-name'                             # Optional

The following table contains the supported configuration options:

Name Type Required Default Description
enabled boolean Yes true This parameter enables or disables the sensor.
endpoint string Yes N/A The endpoint of the Nagios XI instance.
key string Yes N/A The API key to access the Nagios XI endpoint.
poll_rate integer No 30 The number of seconds between metric queries. You might need to adjust this time to account for any rate limit imposed by your endpoint.
target_zone string No N/A The name of the generic zone where your hosts that are monitored by Nagios XI are displayed on the Instana Infrastructure Map. If the zone is not specified, hosts are displayed in Undefined Zone.

Viewing metrics

To view the metrics, complete the following steps:

  1. From the navigation menu in the Instana UI, select Infrastructure.
  2. Click a specific monitored host.

Then, you can see a remote host dashboard with all the collected metrics.

Collected metrics

Host metrics

Instana collects the following metrics from Nagios for hosts:

  • Memory
    • memory.total
    • memory.free
    • memory.available
    • memory.swapTotal
    • memory.swapFree
  • CPU
    • cpu.load.1min
    • cpu.load.5min
    • cpu.load.15min
  • Disk
    • disk.usedBytes
    • disk.freeKB
    • disk.availableBytes
    • disk.capacityKB
  • Network
    • network.bytesRx
    • network.bytesTx

Process metrics

By default, Nagios XI does not collect process metrics. However, to gather this data, you can add a “service”.

For example, if Nagios is monitoring a host named "a.b.c", the a.b.c.cfg service configuration file is at /usr/local/nagios/etc/services/a.b.c.cfg. To collect process metrics, add the following section to the service configuration file:

define service {
    host_name                <hostname e.g. a.b.c>
    service_description      Processes
    use                      xiwizard_ncpa_service
    check_command            check_xi_ncpa!-t '<community_string>' -P 5693 -M processes
    max_check_attempts       5
    check_interval           5
    retry_interval           1
    check_period             xi_timeperiod_24x7
    notification_interval    60
    notification_period      xi_timeperiod_24x7
    notifications_enabled    1
    contacts                 <contact_account>
    _xiwizard                ncpa
    register                 1
}

Make sure that you replace <hostname>, <community_string>, and <contact_account> with the appropriate values. For reference, see the configurations for other services that are defined in the same file.

After manually updating the service configuration in Nagios XI, you must apply these changes as described in any one of the following steps:

  1. Through the Nagios XI web interface:

    1. Log in to your Nagios XI web interface.
    2. Go to the "Configure" section.
    3. Click Core Config Manager on the left sidebar. The Core Config Manager page is displayed.
    4. To verify the configuration, click Apply Configuration on the left sidebar. The Nagios core is restarted, if the verification is successful.
  2. Through the command line interface:

    • If you have command line access to the Nagios XI server, you can restart the Nagios service by using the following commands:

      service nagios restart # you might need sudo
      
    • If you are using systemd, run the following command:

      systemctl restart nagios # you might need sudo
      

If your configuration has any errors, the changes are not applied. To diagnose any issues, see the "Configuration Snapshots" section on the Core Config Manager page.

After the service is added to the host, the sensor collects the following data for each process:

  • Process's name
  • PID (Process ID)
  • Resident Set Size (RSS)
  • Virtual Memory Size (VMS)
  • CPU usage (as a percentage)

Events

Nagios imports events into Instana as changes or issues. Nagios produces the following types of events:

  • Service Alerts
  • Service Notifications
  • Host Alerts
  • Host Notifications

An alert is triggered when a new condition occurs. A notification is similar to a reminder. You continue to get notifications until the alert is acknowledged.

For host alerts or notifications, Nagios provides one of the states, which the sensor maps to the Instana changes or issues as shown in the following table:

Nagios state Instana Event Type
UNREACHABLE Issue (Error)
UP Change
DOWN Issue (Error)
OK Change

Similarly, for service alerts or notifications, Nagios provides one of the states, which the sensor maps to the Instana severity as shown in the following table:

Nagios State Instana Event Type
WARNING Issue (Warning)
CRITICAL Issue (Error)
UNKNOWN Issue (Warning)
OK Change

Troubleshooting

Static agent issues

If you encounter any issues with the static agent, check the error messages in the instana-agent/data/log/agent.log file.

Agent OutOfMemoryError error

If you are connected to a Nagios server that is monitoring many hosts, the JVM heap size of the Instana agent might need to be increased. If you find OutOfMemoryError error in the agent log, consider increasing the Instana agent's max heap size. For more information, see the JAVA_OPTS environment variable in the Environment variable reference.