Page tree
Skip to end of metadata
Go to start of metadata

Were you sent here by the NSClient++ installation, if that's the case - welcome to op5!

We offer an open source network and server monitoring solutions that helps IT staff gain control over their IT operations and deliver more effective IT services for better business.

NSClient++ is an agent designed originally to work with Nagios but has since evolved into a fully fledged monitoring agent that can be used by op5 Monitor. The agent is used in many scenarios where you want to receive/distribute check metrics. NSClient++ is designed to be open-ended and allow you to customize it in any way you design, thus is extensibility a core feature.

Icon

This article describes the latest stable version of NSClient++ 0.5.x

Icon

Automatic upgrade from NSClient++ version 0.3.9 to 0.4.x or 0.5.x is not supported. Version 0.4.x is meant for new installations or manual conversion of configuration. See the bottom of this page for more information. Upgrading from version 0.4.x to 0.5.x is supported.

 

 

About NSClient++

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

 

Download

The installation files for the agent can be found at the op5 Agents Downloads area or the third-party (official) NSClient++ page.

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.

Installation

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.

Normal Installation

  1. Double click on the installation file to start the installation.
     
  2. On the Select Monitoring Tool page, select op5 and then click Next.


  3. On the Choose Setup Type page, choose Typical.
     
     
  4. 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.


  5. Click Install to start the installation.


  6. Click Yes to accept UAC.

Quiet Installation

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.

  1. Start a command prompt with administrative rights.
     
  2. 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: msiexec /?

Configuration

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.

INI files

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.

Registry

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:

[/settings/external scripts]
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

Allowed hosts

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.

More information

You can find more information about working with the registry settings in this how-to.

Advanced Configuration

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".
 

VBS Example

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.

Powershell Example

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

 

PS C:\Windows\system32> Set-ExecutionPolicy unrestricted

 

Answer Y on the question.

Web UI

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.

  1. Go to the NSclient++ folder
  2. Install the web services
  3. Set password for web interface
  4. 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. 

  

Upgrade

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.

Other documentation

 



  • No labels