Supported Operating Systems
The following Windows versions are currently supported:
- Windows 2008
- Windows 2008 R2
- Windows 2012
- Windows 2012 R2
- Windows 2016
For Windows versions older than 2008, please use NSClient++ 0.3.9.
Table of Content
- About NSClient++
- Advanced Configuration
- Web UI
The most recent version of the agent is most likely to be found at the third-party page. Please make sure that you only use stable versions, nightly builds are not supported.
The installation package contains a generic NSClient++ configuration, as well as an op5 compatible configuration. For NSClient++ to work with op5 Monitor, please select the op5 option during installation.
- Double click on the installation file to start the installation.
- On the Select Monitoring Tool page, select op5 and then click Next.
- On the Choose Setup Type page, choose Typical.
- Enter the IP address of your op5 Monitor server and then click Next.
If you have several op5 Monitor servers, enter multiple IP addreses separated by comma. You can also specify one or more networks using CIDR notation, also separated by comma.
- Click Install to start the installation.
- Click Yes to accept UAC.
For quiet or unattended installations, the installation file should be launched using msiexec and a few arguments. The instructions below is a demonstration of this installation method.
- Start a command prompt with administrative rights.
- To start the installation, use the following syntax:
msiexec /l* log.txt /quiet /i NSCP-0.5.0.65-x64.msi MONITORING_TOOL=OP5 CONF_CAN_CHANGE=1 NSCLIENT_PWD="" ALLOWED_HOSTS="OP5-MONITOR-SERVER-IP-ADDRESS-HERE"Please make sure to change the msi file name according to your downloaded file, and also change the ALLOWED_HOSTS argument to match the IP addresses of your op5 Monitor server(s).
This will install NSClient++ with the op5 Monitor compatible configuration, and also save an installation log file called log.txt.
For more information regarding msiexec and its command line switches, run the command this way:
As of NSClient++ 0.4.4.15, the agent's configuration is now customized using the Windows Registry rather than INI files. But some files can still be found, and their purpose is described below, along with how to use the Registry.
As you selected op5 as your Monitoring Tool during the installation of the agent, a file called op5.ini is installed. This file contains all the default op5 settings, which makes the agent compatible with op5 Monitor. This file should not be modified, and any changes you have made to op5.ini will be lost upon upgrading the agent. Use the registry to modify or add settings, which is described in the section below.
A file called nsclient.ini also exists, but is empty by default. The file is reserved for future configuration and features. Do not add settings to this file.
In previous versions of NSClient++, a file could be found called custom.ini. This file has been deprecated.
To manage the Windows Registry, start regedit via the Run function in Windows.
The root registry key for NSClient++ is HKEY_LOCAL_MACHINE\Software\NSClient++.
Within the registry subkey called includes, an entry can be found that enables the op5.ini file. Do not remove this entry, as op5 Support expects this to be found and the file to be enabled.
To add additional/custom settings not found in op5.ini (described in the previous section), or modify any of the settings in the same file, add the settings into the registry instead. If the same setting is found both in op5.ini and the registry, the value found in the registry will be used, effectively overriding the file-based setting.
Registry configuration example
The structure of the settings in the registry is the same as in the INI files. For instance, in op5.ini, you will find this section:
allow arguments = true
In the registry, this would be stored as:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++\settings\external scripts
Type: String Value (REG_SZ)
Name: allow arguments
Data: True or False
The setting for the hosts allowed to talk to the NSClient++ agent, which you defined during the agent installation, is stored in the registry as a string value (REG_SZ), named allowed hosts at the key HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++\settings\default.
Adding external scripts
To run an external script from NSClient the script needs a handler that refers to the script in the configuration.
The handler is added to the registry here: [HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++/settings/external scripts/scripts] using a "string" with the desired command name and the data contains how to execute the script. If the path does not exist please create the path using keys in regedit.
Note that all custom scripts should be placed in the folder C:\Program Files\NSClient++\scripts\custom
For changes to apply the NSClient++ service needs to be restarted.
Allowing external scripts
By default it is not allowed to execute external scripts from NSClient++, this need to be activated. To change the settings go to regedit and add a string called "AllowExternalScripts" to the key HKEY_LOCAL_MACHINE\SOFTWARE\NSClient++/modules and set it to "enable".
In the screenshot below we have a command called "my_script" that runs the command "cscript.exe //T:30 //NoLogo scripts\custom\my_script.vbs".
In this case we use cscript.exe to execute a vbs file and we also set timeout to 30 seconds and supress cscript from showing copyright information.
To run powershell scripts we need to use another command than what we use for vb-scripts.
We create the handler in the same way as vb-script but with the following command "cmd /c echo scripts\custom\hello.ps1; exit $LastExitCode | powershell.exe -executionpolicy bypass -noprofile -nologo -command - ".
Set ExecutionPolicy for powershell (optional)
Due to restrictions in powershell we are not allowed to any script this file without changing the execution policy for powershell scripts or signing the script.
You can use the -executionpolicy bypass option or set this system wide.
In this example we will change the policy to unrestricted but this is not recommended for normal use. For more information about Execution Policy see http://technet.microsoft.com/library/hh847748.aspx.
Open powershell prompt as administrator and run
Answer Y on the question.
As of version 0.5 of NSClient++ it is possible to enable a web UI. From the web UI it is possible to check and configure NSClient++. This interface is not enabled by default and when enabled it uses port 8443 as a default port, this can of course be changed. The Web UI uses the same allowed hosts as the service it self, to access the interface you must add your IP adress to the allowed host setting. To change the allowed hosts please see registry configuration.
One benefit of the web UI is also that it has a REST API that can be used go get data and configure the agent.
Enable web UI
To enable the web UI start a command prompt with administrator rights.
- Go to the NSclient++ folder
- Install the web services
- Set password for web interface
- Restart NSClient++ service
Using Web UI
To use the web UI please direct your browser to https://<server>:8443. Login using the password set when enabling the service.
From this interface you can get more information about your server and also configure the agent.
Upgrading NSClient++ 0.3.9 to 0.4.x or 0.5.x is not recommended or supported. This is due to the major change in configuration file format. To upgrade, manual conversion of the configuration is recommended. If you need any assistance on this matter, please contact your sales representative at op5.
Upgrading from version 0.4.x to 0.5.x is supported.