Skip to main content

Nagios

The Nagios integration allows you to retrieve events from Nagios and send them to Moogsoft Enterprise.

When you use the integrations UI, you can only configure the visible properties. If you want to implement a more complex Nagios LAM with custom settings, see Configure the Nagios LAM.

See the Nagios documentation for details on Nagios components.

Before You Begin

The Nagios integration has been validated with Nagios v. XI. Before you start to set up your integration, ensure you have met the following requirements:

  • You have an active Nagios installation.

  • You have full permissions to the Nagios installation directory and files.

  • You can make requests from the Nagios server to external endpoints over port 443.

  • You have installed cURL on the Nagios server.

  • You have administrator access to the Nagios UI.

Configure the Nagios Integration

Configure the Nagios integration in Moogsoft Enterprise as follows:

  1. Navigate to the Integrations tab.

  2. Click Nagios in the Monitoring section.

  3. Follow the instructions to create an integration name.

See Configure the Nagios LAM for advanced configuration information.

Install the Nagios Integration Scripts

Install the Nagios scripts and configuration files onto your Nagios server as follows:

  1. Download Nagios-Files-1.2.zip to your Nagios server. The zip file contains shell scripts and configuration files for the integration.

  2. Extract the files from Nagios-Files-1.2.zip. For example:

    unzip Nagios-Files-1.2.zip -d /tmp
  3. Navigate to the location of the unzipped files and make the scripts executable. For example:

    chmod +x send-service-event.sh send-host-event.sh
  4. Copy the scripts to the Nagios plugin directory libexec. For example:

    cp send*event.sh /usr/local/nagios/libexec
  5. Edit the configuration variables in send-host-event.sh as follows:

    Field

    Value

    HOSTNAME

    <your Nagios integration URL>

    For example: https://example.Moogsoft.com/events/nagios_nagios1

    BASIC_AUTH_USER

    Username generated in the Moogsoft Enterprise UI.

    BASIC_AUTH_PASS

    Password generated in the Moogsoft Enterprise UI.

  6. Edit the same configuration variables in send-service-event.sh.

  7. Create a new directory in /nagios/etc and copy the configuration files into it. For example:

    mkdir -p /usr/local/nagios/etc/cfgprep
    cp commands.cfg contacts.cfg /usr/local/nagios/etc/cfgprep/

Configure Nagios

Note

Special characters used in Nagios fields must use an escape character (example: \” for quotation marks); otherwise, the installed Moogsoft plugin will not be able to process them. Refer to Nagios Support for more information.

Complete the Nagios configuration in the Nagios UI as follows:

  1. Log into the Nagios UI and go to the Core Config Manager. Import the configuration files:

    /usr/local/nagios/etc/cfgprep/commands.cfg

    /usr/local/nagios/etc/cfgprep/contacts.cfg Apply the configuration.

    See the Nagios documentation for more information.

  2. Go to Contacts and check that the 'moogsoftadmin' contact appears.

  3. Go to Contact Groups and check that the 'moogsoftadmins' contact group appears.

  4. Go to Commands and check that the commands 'send-host-event' and 'send-service-event' are listed.

  5. Go to Nagios Admin and then to Manage Components. Edit settings for the Global Event Handlers and add the commands as follows:

    Host State Change Handler Commands: send-host-event

    Service State Change Handler Commands: send-service-event

    Check 'Enabled' for both commands and apply the settings.

  6. In the Core Config Manager, add the 'moogsoftadmin' contact and the 'moogsoftadmins' contact group to the alert settings for each host and service you want to monitor with Moogsoft Enterprise.

When configuration is complete, Nagios sends host and service related events to Moogsoft Enterprise.