---
title: "  Configure Nagios XI Integration"
slug: "configure-nagios-xi-integration"
description: "The first two of the three scripts you generated allow Nagios to automatically create SRs for events and alerts relating to hosts and services you are monitoring."
tags: ["SysAid Classic", "SysAid Spaces"]
updated: 2022-06-07T16:33:16Z
published: 2022-06-07T16:33:16Z
canonical: "documentation.sysaid.com/configure-nagios-xi-integration"
excludeFromExternalSearch: true
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.sysaid.com/llms.txt
> Use this file to discover all available pages before exploring further.

#   Configure Nagios XI Integration

After you [generate your scripts in SysAid](/v1/docs/Nagios), you must configure Nagios XI to run those scripts to automatically generate the SRs you want and to import the hosts you are monitoring with Nagios to SysAid Asset Management.

## Automatically create SRs for Nagios events and alerts

The first two of the three scripts you generated allow Nagios to automatically create SRs in SysAid for events and alerts relating to hosts and services you are monitoring. The following procedure allows enables Nagios to run those scripts and communicate the information to SysAid. You can repeat this process to configure different host groups or service groups to run different scripts.

### Preparatory Steps

1. Transfer the "sysaid_host_notification.bash" and the "sysaid_service_notification.bash" script files that you generated in SysAid to the nagios/etc/objects folder.
2. Change the access permissions on the scripts to allow their execution, using chmod:  
`chmod +x sysaid_host_notification.bash sysaid_service_notification.bash`
3. Locate the nagios.cfg file and update the enable_environment_macros parameter to '1':  
`enable_environment_macros=1`  
![IntegrationNagiosXIConfigurationfilesEnableMacros1.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesEnableMacros1.png)

### Update the Nagios contacts and commands

1. In the Nagios XI navigate to, **Configure** > **Core Config Manager**.
2. Define a new command for each of the notification scripts you generated in SysAid:
  1. From the right-pane, click **Commands**.
  2. Click **Add New**.  
![IntegrationNagiosXIConfigurationfilesCommands.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesCommands.png)
  3. Enter a Command Name.
  4. Specify the full path to the script (for example, "/usr/local/nagios/libexec/eventhandlers/sysaid_host_notification.bash").
  5. From the Command Type drop-down list, select **misc command**.
  6. Click **Save**.  
![IntegrationNagiosXIConfigurationfilesCommandManagement.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesCommandManagement.png)
  7. Repeat for these steps for the second script.
3. Define a contact to receive the notifications:
  1. From the right-pane, select **Alerting** > **Contacts**.
  2. Click **Add New**.  
![IntegrationNagiosXIConfigurationfilesContacts.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesContacts.png)
  3. In the Common Settings tab, enter a Contact Name and Description.
  4. Click **Manage Contact Groups**.  
![IntegrationNagiosXIConfigurationfilesContactCommonSettings.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesContactCommonSettings.png)
  5. Add the contact to a group that will receive the relevant notifications (we recommend adding the contact to the "Admin" group).
  6. In the Alert Settings tab, select the settings you want for host and service notifications (see the [Notification Options table](/docs/configure-nagios-xi-integration#notification-options) below for more information).  
![IntegrationNagiosXIConfigurationfilesContactAlertSettings.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesContactAlertSettings.png)
  7. Click **Manage Host Notification Commands**, add the host command you created in the previous script, and click **Close**.
  8. Click **Manage Service Notification Commands**, add the service command you created in the previous script, and click **Close**.  
![IntegrationNagiosXIConfigurationfilesSelectCommand.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesSelectCommand.png)
  9. Click **Save**.
4. Click **Apply Configuration**.  
![IntegrationNagiosXIConfigurationfilesApplySettingsApplySettings.png](https://cdn.document360.io/52d3cb6c-cc81-43c2-b6f7-cbabcb449271/Images/Documentation/IntegrationNagiosXIConfigurationfilesApplySettingsApplySettings.png)

#### Notification options

You can trigger a notification to run on the following host/service states.

| Syntax | Definition |
| --- | --- |
| **Host Notifications** |
| D | Down |
| U | Up |
| R | Recovery |
| F | Flapping |
| S | Scheduled Downtime |
| **Service Notifications** |
| W | Warning |
| U | Unknown |
| C | Critical |
| F | Flapping |
| S | Scheduled Downtime |
| R | Recovery |
| N | Null |

#### Import Nagios hosts as assets in SysAid

The third script you generate in SysAid allows you to import all of the hosts defined in Nagios into SysAid Asset Management.

1. Transfer the "send_host_list_to_sysaid.bash" script file to a folder in Nagios.
2. Change the access permissions on the scripts to allow their execution, using chmod: `chmod +x send_host_list_to_sysaid.bash`
3. Configure Nagios XI to import assets to SysAid when it runs the script:
  1. Locate the httpd.conf file in the following directory: "/etc/httpd/conf/httpd.conf".
  2. Backup the httpd.conf file.
  3. Add the following lines to the file. Be sure to add the lines near the ScriptAlias tag and not within the VirtualHost tag.Text

```
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
```
  4. Restart the httpd service with the following command:  
`service httpd restart`
4. Run the script as follows: `./send_host_list_to_sysaid.bash`

Note

It is recommended to to set up a scheduled cron job to import assets on a regular basis.
