Nagios is a long favored monitoring solution for companies across the spectrum. XI adds much functionality and commercial support.
This integration is targeted for Nagios XI, if you are looking for Nagios Core, check here
An updated version of this integration is available, supporting the latest version of Nagios XI and based on xMatters Flow Designer so you can easily connect other tools to your toolchain. Install it right from the Workflow Template directory within your xMatters instance. Learn more.
- Nagios XI
- xMatters integration agent 5.1.8 - Download and documentation here
- xMatters account - If you don't have one, get one!
- NagiosXI-IAFiles.zip - Integration Agent integration service files.
- NagiosXIWorkflow.zip - The workflow for uploading to xMatters On Demand.
A contact with a notification command is notified when a host or service goes critical. The command fires to the Integration Agent and passes all the relevant information. The Integration Agent builds the payload and makes a REST call to the Integration Builder which creates the event. Responses are then sent back to the Integration Agent (through IA polling to xMoD) and Nagios is updated.
Pre-steps: Install and configure the Integration Agent on the same box as Nagios XI. See details here.
- Login to xMatters as a Developer and create a new user.
- Create a new REST user. See details here
- Import the NagiosXICommPlan.zip workflow.
- Next to the NagiosXI workflow, click Edit > Access Permissions and give access to the user created in step 2.
- Click Edit > Forms and next to the Host Notification form, click Edit > Sender Permissions and give access to the user created in step 2. Repeat for the Service Notification form.
- Navigate to the Integration Builder tab and expand the Inbound Integrations section. Click on
Inbound Host Events
and copy the URL at the bottom. Repeat forInbound Service Events
. - On the Workflow tab, on the left menu if there is an entry for "Event Domains", then click that then select
applications
and in the Integration Services section, click the Add New link. Populate the Name field withnagios-host
. Repeat to add a new one fornagios-service
. If Event Domains is not present, contact our helpful support people and they'll hook you up.
-
Open the
IAHOME/conf/IAConfig.xml
file and navigate to the<service-configs>
element near the bottom. Add the following two lines inside that tag:<path>applications/nagios/nagios_host.xml</path> <path>applications/nagios/nagios_service.xml</path>
-
Unzip the NagiosXI-IAFiles.zip to
IAHOME/
. This will create the following new filesIAHOME/conf/deduplication-filter-nagios.xml
IAHOME/integrationservices/applications/nagios/*
-
Open the
IAHOME/integrationservices/applications/nagios/configuration_host.js
file in a text editor. -
Update the
WEB_SERVICE_URL
value with the URL for theInbound Host Events
inbound integration copied from above. -
Update the
INITATOR
value to match the user created in xMatters above. -
Verify the
NAGIOS_COMMAND_FILE
path variable is correct and save the file. -
Repeat steps 4 through 6 for the
IAHOME/integrationservices/applications/nagios/configuration_service.js
file. -
Open the
IAHOME/integrationservices/applications/nagios/nagios_host.js
file in a text editor. -
Scroll down to the
execute
function. Update the path to theprintf_redirect.sh
script so it points toIAHOME/integrationservices/applications/nagios/printf_redirect.sh
-
Repeat step 9 for the
IAHOME/integrationservices/applications/nagios/nagios_service.js
file. -
To encrypt the password for the xMatters REST user, navigate to the
IAHOME/bin
directory and run the following command:./iapassword.bat --new "MYCOMPLEXPASSWORD" --old "xmatters" --file integrationservices/applications/nagios/.initiatorpasswd
Replacing
MYCOMPLEXPASSWORD
with the password for the xMatters REST user. -
If nagiosxi is the only integration this integration agent is serving, then run the following commands:
cd $IAHOME cp ./conf/deduplication-filter.xml ./conf/deduplication-filter-original.xml cp ./conf/deduplication-filter-nagios.xml ./conf/deduplication-filter.xml
Then update the
./conf/deduplication-filter.xml
to match your expected dedpulication needs. -
If there are other integrations on this agent, then copy the contents of the
deduplicator
tag in the./conf/deduplication-filter-nagios.xml
file into the existing./conf/deduplication-filter.xml
- Login to Nagios XI and into the Core Config Manager.
- Click Commands and create two new commands with the following info:
Command Name | Command | Command Type |
---|---|---|
xM-Agent-host | IAHOME/bin/APClient.bin --map-data "applications|nagios-host" "host" "$HOSTNAME$" "$HOSTGROUPNAME$" "$HOSTADDRESS$" "$HOSTSTATE$" "$HOSTSTATEID$" "$LASTHOSTSTATE$" "$LASTHOSTSTATEID$" "$HOSTSTATETYPE$" "" "" "$HOSTEVENTID$" "$HOSTPROBLEMID$" "$HOSTOUTPUT$" "$LONGHOSTOUTPUT$" "$HOSTDOWNTIME$" |
misc command |
xM-Agent-service | IAHOME/bin/APClient.bin --map-data "applications|nagios-service" "service" "$HOSTNAME$" "$SERVICEDESC$" "$HOSTGROUPNAME$" "$HOSTADDRESS$" "$HOSTSTATE$" "$HOSTSTATEID$" "$HOSTEVENTID$" "$HOSTPROBLEMID$" "$SERVICESTATE$" "$SERVICESTATEID$" "$LASTSERVICESTATE$" "$LASTSERVICESTATEID$" "$SERVICESTATETYPE$" "" "" "$SERVICEEVENTID$" "$SERVICEPROBLEMID$" "$SERVICEOUTPUT$" "$LONGSERVICEOUTPUT$" "$SERVICEDOWNTIME$" |
misc command |
Make sure to replace IAHOME
with the full path to the Integration Agent home directory.
- Click Contacts and create a new xMatters contact. Populate a Contact Name.
- On the Alert Settings tab, click on the Manage Host Notification Commands button and select the
xM-Agent-host
command from above. - Repeat for the Manage Service Notification Commands but select the
xM-Agent-service
command.
Finally, add the contact to a Service and/or a Host that needs to use the xMatters alerting capabilities as well as a Host and Service Group. These will be the targeted recipients when an event is triggered.
Make a service fail or a host bring a host offline that has the xMatters contact. This will trigger the command into the Integration Agent, which will create an event in xMatters. Responding with Acknowledge will acknowledge the Service or Host in Nagios.
If events are not making it to users:
- Check the Integration Agent log
IAHOME/log/AlarmPoint.txt
to make sure Nagios is actually attempting to send the event to the agent. - Check the activity stream for the
Inbound Service Events
(orInbound Host Events
) inbound integration service and check for errors. - Check the event log for any errors
If responses are not effecting changes in Nagios:
- Check the Integration Agent log
IAHOME/log/AlarmPoint.txt
for any errors.