Fortinet Document Library

Version:


Table of Contents

User Guide

21.4.0
Copy Link

Nagios

Nagios is an open source monitoring solution that many companies leverage before moving to a SaaS solution. The FortiMonitor Agent for Linux can read the execution exit codes of Nagios check plugins which will then allow you to configure thresholds for Nagios plugins. The Agent also discovers all of the Nagios plugins on the server and reports them as individual metrics that can be added to FortiMonitor (One for the overall status returned by the plugin, and several metrics for any of the performance metrics that are exported). See Plugin status and performance data for more information on how FortiMonitor handles Nagios plugin output data.

Command line arguments for Nagios are currently not supported.

Agent configuration

This requires the latest version of the Linux Agent.

By default, the Panota agent will look for your Nagios plugins in /usr/share/panopta-agent/nagios. If you are dropping your plugins in this directory, no other Agent configuration is necessary. If you would like the FortiMonitor Agent to look for your plugins in a different directory, you can provide a directory path in the FortiMonitor agent config file. To do so, edit the FortiMonitor agent config file, which is located at /etc/panopta-agent/panopta_agent.cfg, and add a block like the one below. 

[nagios]
plugins_location = /path/to/your/plugins

You need to ensure that the panopta-agent user has permission to execute the plugin, including any potential admin privileges needed to access the plugin data.

Once the configuration block has been added, rebuild the agent metadata (via the control panel or with the python /usr/bin/panopta-agent/panopta_agent.py --rebuild-metadata command)

Control panel configuration 

To start monitoring Nagios plugins: 

  1. Select Add Monitoring from the Monitoring Config tab of your server’s Instance Details page. 
    A catalog with all available services and applications will be displayed.

  2. Select Nagios then click Configure Metrics.


    A configuration drawer with a list of discovered plugins will slide out.

  3. Select a Nagios plugin from the list then click Add.
    The metric configuration drawer will slide out.

  4. Configure the metric's settings, thresholds, and CounterMeasures.

  5. Select Save.

In the Thresholds & CounterMeasures tab of the metric configuration drawer, you can configure incidents to be created based on these returned values. For example, create an incident if the metric value is > 1.

Nagios exit codes 

Nagios uses a check plugin to monitor to identify the status of monitored services. When the plugin is run, Nagios can distinguish the status of the service by reading the exit code. These exit codes are then used by FortiMonitor to determine the status of the service. See the following table for more information.

Nagios exit code

Nagios value

FortiMonitor severity

Host state

0

OK

Up

1

WARNING

Warning

Up or down/unreachable

2

CRITICAL

Critical

Down/unreachable

3

UNKNOWN

Critical

Down/unreachable

Plugin status and performance data 

When a plugin is executed, the plugin returns a text that includes the status of the service and if available, the metric performance data. The first part of the text is a human-readable text string that describes the status of the service. The pipe (|), is followed by a text containing one or more performance metrics.  

PING ok - Packet loss = 0%, RTA = 0.80 ms | percent_packet_loss=0, rta=0.80

To learn more about the format of a Nagios plugin output, see this article.

Performance monitoring 

The Performance section provides a visual representation of the status of the Nagios plugins. Each metric is represented by a line graph that can be filtered based on metric type and scoped using a specific time range. You can also expand each line graph by clicking on its expand arrow.

Troubleshooting 

All activities related to Nagios plugins are available in the Activity tab of the server's Instance Details page. Check this tab if you are having issues with your Nagios integration.

You can also check the FortiMonitor Agent log by entering the following command into a command window:

less /var/log/panopta-agent/panopta-agent.log

Nagios

Nagios is an open source monitoring solution that many companies leverage before moving to a SaaS solution. The FortiMonitor Agent for Linux can read the execution exit codes of Nagios check plugins which will then allow you to configure thresholds for Nagios plugins. The Agent also discovers all of the Nagios plugins on the server and reports them as individual metrics that can be added to FortiMonitor (One for the overall status returned by the plugin, and several metrics for any of the performance metrics that are exported). See Plugin status and performance data for more information on how FortiMonitor handles Nagios plugin output data.

Command line arguments for Nagios are currently not supported.

Agent configuration

This requires the latest version of the Linux Agent.

By default, the Panota agent will look for your Nagios plugins in /usr/share/panopta-agent/nagios. If you are dropping your plugins in this directory, no other Agent configuration is necessary. If you would like the FortiMonitor Agent to look for your plugins in a different directory, you can provide a directory path in the FortiMonitor agent config file. To do so, edit the FortiMonitor agent config file, which is located at /etc/panopta-agent/panopta_agent.cfg, and add a block like the one below. 

[nagios]
plugins_location = /path/to/your/plugins

You need to ensure that the panopta-agent user has permission to execute the plugin, including any potential admin privileges needed to access the plugin data.

Once the configuration block has been added, rebuild the agent metadata (via the control panel or with the python /usr/bin/panopta-agent/panopta_agent.py --rebuild-metadata command)

Control panel configuration 

To start monitoring Nagios plugins: 

  1. Select Add Monitoring from the Monitoring Config tab of your server’s Instance Details page. 
    A catalog with all available services and applications will be displayed.

  2. Select Nagios then click Configure Metrics.


    A configuration drawer with a list of discovered plugins will slide out.

  3. Select a Nagios plugin from the list then click Add.
    The metric configuration drawer will slide out.

  4. Configure the metric's settings, thresholds, and CounterMeasures.

  5. Select Save.

In the Thresholds & CounterMeasures tab of the metric configuration drawer, you can configure incidents to be created based on these returned values. For example, create an incident if the metric value is > 1.

Nagios exit codes 

Nagios uses a check plugin to monitor to identify the status of monitored services. When the plugin is run, Nagios can distinguish the status of the service by reading the exit code. These exit codes are then used by FortiMonitor to determine the status of the service. See the following table for more information.

Nagios exit code

Nagios value

FortiMonitor severity

Host state

0

OK

Up

1

WARNING

Warning

Up or down/unreachable

2

CRITICAL

Critical

Down/unreachable

3

UNKNOWN

Critical

Down/unreachable

Plugin status and performance data 

When a plugin is executed, the plugin returns a text that includes the status of the service and if available, the metric performance data. The first part of the text is a human-readable text string that describes the status of the service. The pipe (|), is followed by a text containing one or more performance metrics.  

PING ok - Packet loss = 0%, RTA = 0.80 ms | percent_packet_loss=0, rta=0.80

To learn more about the format of a Nagios plugin output, see this article.

Performance monitoring 

The Performance section provides a visual representation of the status of the Nagios plugins. Each metric is represented by a line graph that can be filtered based on metric type and scoped using a specific time range. You can also expand each line graph by clicking on its expand arrow.

Troubleshooting 

All activities related to Nagios plugins are available in the Activity tab of the server's Instance Details page. Check this tab if you are having issues with your Nagios integration.

You can also check the FortiMonitor Agent log by entering the following command into a command window:

less /var/log/panopta-agent/panopta-agent.log