NSClient++ is the agent we recommend for monitoring hosts that run Microsoft Windows. It integrates very well with recent Windows Servers versions, copying its commands into the Registry and simplifying authentication. It also has versions for Linux, but OP5 has not tested against such implementations.
OP5 used to provide a modified version of NSClient++. Starting with version 0.4.x and moving into the 0.5.x series, the official NSClient++ release has a cleaner integration with OP5 Monitor as well as the operating system. We strongly recommend downloading the latest stable release directly from our friends there.
OP5 plugins that handle NSClient++ communication
NSCP out of the box has very few commands. Instead it comes with a plethora of modules that you can choose to load. This prevents wasting resources. It also calls back to the tool that it replaced many years ago, "NSClient for Windows" (which explains the double-plus increment in the name). These instructions will help you get it working with OP5's plugin scripts from the following families:
In the past OP5 used it for all basic tests, such as CPU, memory, and disks. It could even check Windows services and performances counters, especially in Windows 2000 Server and Windows Server 2003.
Nevertheless this plugin has stopped receiving any new development. It does not work as well with more recent versions of Windows Server, in particular 2012 R2 and onward. OP5 strongly recommends using at least 'check_nrpe' or the newer script-based protocols for any custom scripts or other new work.
This is the same plugin used with the NRPE agent. This makes it very easy to use the same check command for any host server, be it on Windows, Unix, or Linux. We already described how to configure such commands.
Please keep in mind that the 'check_nrpe' plugin and the NRPE agent are not the same thing. The plugin sits on the OP5 Monitor to make remote calls, while the Unix and Linux agent sits on hosts to listen for those calls. Thus you can use the same check command syntax against a Windows host as a Linux host, because the configuration file on the host will determine how the host will listen and respond.
On the Windows target host (hereout: 'wintarget'), Make sure the latest release of NSClient++ is installed and running in OP5 mode. If you are not certain, start from scratch:
- Download the latest installer of NSCP -- https://nsclient.org/download/
- Backup your NSCP scripts and INI files to some directory away from the NSCP installation directory;
- Stop the NSClient++ service;
- Uninstall all existing versions of NSCP;
- Delete "C:\Program Files\NSClient++\", "C:\Program Files\op5\nsclient++\", or any other residual NSCP directory (aside from your backups);
- Delete any Registry entries under "\\HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++\".
We have an example of a PowerShell script to run steps 3 through 6. Please review before making a similar implementation:
- Run the latest installer:
- Select 'OP5' for Monitoring Tool:
- You can select 'Complete' mode at the next screen to skip a lot of other questions;
- The one remaining question box will then ask for Allowed Hosts. Provide "127.0.0.1," then your OP5 Monitor server IP addresses. CIDR blocks such as '172.16.55.0/24' are acceptable:
- Select 'OP5' for Monitoring Tool:
- After the install wizard finishes, open "C:\Program Files\NSClient++\" (hereout: '%NSCP%') in the File Explorer (or the Administrator command prompt). Make certain the following subfolders exist inside that location or otherwise create them:
NSClient++ operation used to be configured only in a set of plaintext files. These are still located in the installation directory, typically "C:\Program Files\NSClient++\". You can still edit these files and restart the NSCP service to make the changes take effect. However many changes are now easier from the Windows Registry, such as adding new INI files at load time.
Michael Medin, the head of the NSClient++ project, has provided very good documentation for writing configuration files. OP5 provides an in-depth presentation in our Knowledge Base. If you need configuration details for one of the deprecated releases (version 0.3.x and older), we have moved them to a separate page to avoid confusion. As we also mention on that page, we would strongly advise following the above steps to download the latest version, uninstall the old ones, install the newest one in OP5 mode, and get working within a few minutes.
Enabling External Scripts
- Create a new file in %NSCP%, 'custom.ini';
- Add the following to it to execute scripts not originally from NRPE or NSCP and to instantiate one in particular:
- Use the Windows Registry to add the custom initialization file. The most common way is via Windows GUI:
- Open '
- Go to "
- Create a new string value key;
- Give it the name 'custom' and the value 'custom.ini'
- Open '
- From an Administrator command prompt, change to the "
C:\Program Files\NSClient++" directory and run the command "
nscp settings --show". Make sure that 'custom.ini' now appears in the list;
- If you run "
nscp settings --list" from the same prompt, you will already see your new external command in the output. However you still need to restart the NSCP service to get the external script processing to work. You can either restart the service as you would with any Windows service, or simply run the following from our existing prompt:
nscp service --restart
- Run "
nscp test" to start a test environment. There will be a lot of output before you get a prompt again:
- Provide the key for the external script as an argument and make sure it leads to your desired results. Back to our example above:
- Type "exit" once it completes.