How to Install NSClient++ and Set Up Nagios to Monitor Windows Hosts
If you’re looking to monitor a Windows server with Nagios, the first step is installing the NSClient++ agent. This powerful tool enables Nagios to collect data from Windows hosts. In this guide, we’ll walk you through the entire installation process, including configuring the Nagios server to monitor your Windows machine.

Step 1: Download and Install NSClient++ on Windows
To begin, download the latest stable version of NSClient++ from the official source: NSClient++ on SourceForge. Once downloaded, follow these steps:
- Launch the installer: Double-click the installation file to start the installation wizard.
- Accept the License: In the first screen, check the box to accept the license agreement, then click Next.
- Choose Installation Type: Select the ‘Typical’ installation option, then click Next.
- Configure the Installation: Leave the default settings and proceed by clicking Next.
- Enter Nagios Server IP: Specify the IP address of your Nagios server, select the modules you want, and then click Next.
- Finish Installation: Click Install to begin the installation, and Finish when the process is complete.
Step 2: Verify NSClient++ Service on Windows
To confirm that the NSClient++ service is running:
- Press
Windows Key + R, typeservices.msc, and hit Enter. - Scroll through the list and look for the NSClient++ service. Ensure it is running.
Step 3: Configure Nagios to Monitor Windows Host
Once NSClient++ is installed on your Windows server, the next step is configuring Nagios to monitor it. This involves editing configuration files on your Nagios server. Here’s how:
- Edit the Windows Configuration File:
Open the configuration file for your Windows host:# vi /usr/local/nagios/etc/objects/windows.cfgEnsure thehost_namematches the hostname of your Windows machine. For example:define host { use windows-server ; Inherit from a template host_name winserver ; Your Windows host name alias My Windows Server; A longer name for identification address 192.168.1.13 ; IP address of the Windows server } - Update Nagios Core Configuration:
Open the Nagios core configuration file:# cd /usr/local/nagios/etc/nagios.cfg # cfg_file=/usr/local/nagios/etc/objects/windows.cfgUncomment the line and save the changes. - Verify Nagios Configuration:
Run the following command to verify the configuration:# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg - Check in Nagios Web UI:
Log in to your Nagios web interface and navigate to Hosts. You should see your newly addedwinserverin the dashboard.
Step 4: Create Host Groups and Service Groups for Nagios Monitoring
To organize your monitoring setup, it’s essential to define host and service groups. These help to efficiently manage multiple hosts and services.
- Define Host Groups:
Navigate to your host groups directory:# cd objects/hostgroups/Open or create a host group configuration, like this:define hostgroup { hostgroup_name zippyops-servers members localhost,minion1.zippyops.com } - Define Service Groups:
Similarly, create or update service groups:# cd objects/servicegroups/ # cat local-clock-offset-service.cfg define servicegroup { servicegroup_name local-clock-offset-service alias Local clock offset service group } - Add Services:
To monitor specific services like HTTP or port 80, copy the existing configuration and modify it as needed:# cp local-clock-offset-service.cfg http-service.cfg # mv http-service.cfg http-80-service.cfg # cat http-80-service.cfg define servicegroup { servicegroup_name http-80-services alias HTTP port 80 Service Group }
Step 5: Add a Remote Host for Monitoring
Now, let’s add a remote host, like minion1.zippyops.com, to Nagios:
- Create Host Configuration:
Copy the host configuration file:# cp nagios-core-host-1.cfg minion1-zippyops-com.cfg # cat minion1-zippyops-com.cfg define host { name minion1-zippyops-com host_name minion1.zippyops.com use linux-server alias minion1.zippyops.com check_period 24x7 display_name minion1.zippyops.com max_check_attempts 10 check_command check_ping!2000.00,80%!5000.00,100% contact_groups admins } - Set Permissions:
Ensure the Nagios user has permissions to edit the files:# chown -R nagios:nagios * # chmod -R 755 * - Verify Configuration:
Run another verification to ensure everything is correct:# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg - Check in Nagios Web UI:
Refresh the Nagios web interface and confirm that the new host is visible.
Step 6: Final Steps and Best Practices
Once everything is set up, ensure your Nagios services are restarted to apply changes. Regularly monitor your hosts and services to ensure optimal performance. Using a robust solution like ZippyOPS can further streamline your DevOps, DataOps, and security management across systems. ZippyOPS provides expert consulting, implementation, and managed services for DevOps, AIOps, and MLOps, helping businesses optimize their IT infrastructure and security. Visit ZippyOPS Solutions for more information.
Conclusion
Configuring NSClient++ on Windows and integrating it with Nagios for monitoring is an essential skill for system administrators. By following these steps, you can effectively monitor the performance and health of Windows machines using Nagios.
For more complex setups, such as integrating automated operations or cloud monitoring, consider leveraging ZippyOPS consulting services. If you need help optimizing your DevOps or security infrastructure, feel free to reach out to our experts at sales@zippyops.com.



