Monitor Windows Server with Nagios XI and NCPA

Monitoring your Windows Server environment is essential for ensuring system performance, uptime, and security. By using Nagios XI alongside the Nagios Cross-Platform Agent (NCPA), you can efficiently monitor your server with a seamless integration between the two tools. NCPA collects critical system metrics, while Nagios XI provides a powerful interface for visualization, alerting, and management. In this guide, we’ll walk you through the process of setting up Windows Server monitoring using both NCPA and Nagios XI.
What is NCPA?
NCPA (Nagios Cross-Platform Agent) is a powerful and flexible monitoring agent that allows Nagios to gather performance metrics from Windows, Linux, and MacOS systems. It helps administrators monitor CPU usage, memory, disk space, processes, and much more with minimal configuration.
Active vs Passive
NCPA can be used for both Active and Passive monitoring:
• Active = Nagios is responsible for performing the check on a schedule
• Passive = NCPA is responsible for submitting check results in Nagios
The NCPA installer may prompt you for settings for active and passive. Active is the most common
method used. If you are not using passive monitoring, then you do not need to configure those
settings.
Graphical vs Silent
The key differences between a Graphical (GUI) Install and a Silent Install of NCPA lie in user interaction, customization, deployment efficiency, and installation speed. A GUI install involves a step-by-step wizard requiring manual input, making it ideal for users who prefer an interactive approach. It allows customization during installation but is not suitable for large-scale deployments. In contrast, a silent install runs automatically via command-line execution with predefined parameters, making it the best option for mass deployment across multiple servers. While the GUI install is slower due to manual input, the silent install is faster and more efficient, though it requires careful pre-configuration to avoid misconfigurations.
Step 1: Download NCPA
- Open a web browser and go to the official Nagios NCPA download page.
- Click on “Download”, then select the Windows version of NCPA.
- Save the ncpa-latest.exe installer to your preferred location on the Windows Server.

Step 2: Install NCPA
Option A: Graphical Install (Recommended)
To see how this is done in Nagios XI, check out this tutorial:
Follow these steps for a straightforward installation using the graphical interface:
1. Locate the downloaded ncpa-latest.exe file on your machine.

2. Double-click the installer to begin the installation process.
3. The Welcome screen will appear. Click Next to proceed.

4. License Agreement:
- Review the license agreement.
- Click I Agree to accept the terms and continue.

5. Listener Configuration:

- Token: Enter a strong token (e.g., Str0ngTok3n) for API calls, which Nagios will use to connect.
- Bind IP: Leave as 0.0.0.0 to bind to all available IPv4 addresses on the Windows machine.
- Bind Port: By default, it binds to port 5693.
- SSL Version: Choose the version (TLSv1.0–1.2). Default is TLSv1.2.
- Log Level: Set this to warning unless you need additional details for debugging.
Click Next to proceed.
6. Setup the Passive Configuration (Optional):

- URL: The URL on your Nagios Host that accepts passive check results.
- NRDP Token: This token will be used for passing passive checks to Nagios. It’s different from the active check token.
- Hostname: Specify the hostname for the passive checks on the Nagios Server.
- Check Interval: How often the passive checks will be sent.
Click Next to proceed.
7. Select Passive Service Checks (Optional):

Default passive service checks will be displayed. You can modify them as required.
Click Next to proceed.
8. Choose User Installation:
Decide whether to install NCPA for just the user account performing the installation or for all users.

Click Next to continue.
9. Choose Installation Directory:
The default installation directory is C:\Program Files (x86)\Nagios\NCPA. You can modify the installation path if needed.

Click Install to proceed.
10. Finish the Installation:
- Once installation is complete, click Finish.


Option B – Silent Install
To perform a silent installation, you’ll use the installer with specific arguments. These arguments are added to the command line to configure the installation.
Arguments Explained
Variable | Description |
/S | Tells the installer to perform a silent installation (no prompts). |
/D | Specifies the directory where NCPA will be installed (optional). |
/TOKEN | Defines the token for accessing the agent’s API and web interface. |
/IP | Specifies the IP address to bind to (optional, default is 0.0.0.0 for all IPv4 addresses). |
/PORT | Specifies the port to bind to (optional, default is 5693). |
/NRDPURL | The URL on the Nagios server where passive check results are sent. |
/NRDPTOKEN | The hostname that the passive checks will be associated with on the Nagios server. |
/NRDPHOSTNAME | The hostname that the passive checks will be associated with on the Nagios server. |
Silent Installation Example Command
In order to use the silent install, you must pass the /S value to the install as shown below.
The /D
value is optional, but if included, it must be the last argument, cannot contain quotes, and must be an absolute path.
The below command will set the token in your ncpa.cfg to mytoken. The silent install will start the
NCPA listener and passive services. That’s all you need to do. Below is a reference for all available
configuration options for the silent install.
ncpa-latest.exe /S /TOKEN='mytoken' /<variable>='<value>' /D=<base directory>
Here’s an example command using the arguments above:
ncpa-latest.exe /S /TOKEN='Str0ngT0k3n' /NRDPURL='http://10.25.5.12/nrdp/' /NRDPTOKEN='NRDP_T0k3n' /NRDPHOSTNAME='S1601'
Step 3: Verify Installation
1. Check the Nagios Cross-Platform Agent:
Press Windows Key + R, type services.msc, and press Enter.

Scroll through the list and locate Nagios Cross-Platform Agent to confirm it’s running.

Alternatively, use Command Prompt:
Open a command prompt and run sc query ncpa
Confirm the STATE of ncpa is RUNNING:
> sc query ncpa
If the service is running, you should see output like this:
SERVICE_NAME: ncpa
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
Step 4: Test NCPA Installation
1. Open a web browser and navigate to: https://<NCPA_IP_Address>:5693/
2. Bypass the security warning due to self-signed certificates by clicking More Information and selecting Go onto the webpage.

3. On the NCPA login page, enter the API token you configured in Step 2-6 and click Log In.

4. Upon successful login, you will be directed to the NCPA Dashboard.

Step 5: Adding your NCPA to Nagios XI
1. Log into Nagios XI.
2. Go to Configure → Configuration Wizards.

3. Select Windows Server from the list.

4. Enter the Windows Server’s IP Address and the NCPA API Token (from Step 2-6).

5. Select the services to monitor (e.g., CPU, Memory, Disk, Services).
NOTE: The default thresholds for the disk and memory space are a bit low, we recommended changing them to reflect your usage



Click Next
6. Configure the Monitoring Settings:
The default is set to monitor every 5 minutes. When there is potential problem, it will recheck every one minute up to 5 times before sending a notification.

Click Next
7. Configure Notification Settings:

Click Next
8. Add your Windows Server to any Host Groups, Service Groups, or Parent Host

Click Next
9. Click Finish and Apply to finalize the configuration, or select Save as Template to use the same settings for future Windows servers.


Step 6: Confirm Monitoring of Windows Server on Nagios XI
1. on Nagios XI. Navigate to View > Host Detail

2. Select the Host in question:

3. Confirm services are being monitored:

Troubleshooting
Confirm firewall ports are open
NCPA by default uses port 5693. You can confirm this port is open by running netstat -an | findstr :5693
If port 5693 is open and listening, you will see output like:

NCPA expected to open this port during installation. If needed, the below command can be used to open it manually:
netsh advfirewall firewall add rule name="Allow Port 5693 Inbound" dir=in action=allow protocol=TCP localport=5693
Error opening file (servicemanager.pyd)
Example of Error:

This issue can occur if NCPA was previously uninstalled, but a reboot was never performed. Reboot your Windows server and retry the install.
NCPA Installs, but fails to start after reboot
Check if Windows Event view for:
A timeout was reached (30000 milliseconds) while waiting for the Nagios Cross-Platform Agent service to connect.
The Nagios Cross-Platform Agent service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.
If so, then set the Nagios Cross-Platform Agent to Startup Type of Automatic (Delayed Start)
Press Windows Key + R, type services.msc, and press Enter.

Right-click on Nagios Cross-Platform Agent and select Properties

Select the Startup type drop down box and select Automatic (Delayed Start)

Click OK
If you have additional questions or other support-related questions, please visit Nagios Support. The Nagios Support Knowledgebase is also a great support resource.
Share:
On this page
Related Articles
- Centralized Log Monitoring for AlmaLinux 9 with Nagios Log Server 2024R2: A Complete Guide
- Monitoring Pop!_OS 24.04 LTS with NCPA in Nagios XI: A Comprehensive Guide
- Monitoring Clear Linux with SNMP in Nagios XI: A Step-by-Step Guide
- Monitoring NixOS with SNMP in Nagios XI: A Step-by-Step Guide
- How to Send Logs from Kali Linux to Nagios Log Server