Version 3 (modified by mickem, 5 years ago) (diff)

--

Configuration

Configuration is fairly simple and straight forward. Open the configuration file in notepad (or you favorite editor) "notepad <installation path>\NSC.ini" and edit it accordingly. A longer description of the Configuration file is included in the following page.

The file has sections (denoted with section name in brackets) and key/value pairs (denoted by key=value). Thus it has the same syntax as pretty much any other INI file in windows.

The sections are described in short below. The default configuration file has a lot of examples and comments so make sure you change this before you use NSClient++ as some of the examples might be potential security issues.

The configuration can also be stored in the system registry (HKLM\Software\NSClient++) there is currently no UI to configure this so the simplest way is to maintain the configuration in the INI file and "Migrate that" to the registry. This is can be done via the [RemoteConfiguration] module but in short:

NSClient++ RemoteConfiguration ini2reg

Modules

This is a list of modules to load at startup. All the modules included in this list has to be NSClient++ modules and located in the modules subdirectory. This is in effect the list of plug-ins that will be available as the service is running.

A good idea here is to disable all modules you don’t actually use for two reasons. One less code equals less potential security holes and two less modules means less resource drain.

Settings

This section has generic options for how NSCP will work, some of these settings (such as allowed_hosts) is inherited in sections below so it is probably a better idea to set them here.

The options you have available here are

OptionDefault valueDescription
obfuscated_password...An obfuscated version of password. For more details refer to the password option below. To create the obfuscated Password use: "NSClient++.exe /encrypt"
password...The password used by various (presently only NSClient) daemons. If no password is set everyone will be able to use this service remotely.
allowed_hosts127.0.0.1A list (comma separated) with hosts that are allowed to connect and query data. If this is empty all hosts will be allowed to query data. BEWARE: NSClient++ will not resolve the IP address of DNS entries if the service is set to startup automatically. Use an IP address instead.

Log

This section has options for how logging is performed. First off notice that for logging to make sense you need to enable the “FileLogger.dll” module that logs all log data to a text file in the same directory as the NSClient++ binary if you don’t enable any logging module nothing will be logged.

The options you have available here are

OptionDefault valueDescription
debug0A Boolean value that toggles if debug information should be logged or not. This can be either 1 or 0.
filensclient.logThe file to write log data to. If no directory is used this is relative to the NSClient++ binary.
date_mask%Y-%m-%d %H:%M:%SThe date format used when logging to a file

NSClient

This is the NSClient module configuration options.

This is subject to change in the near future

OptionDefault valueDescription
port12489The port to listen to
obfuscated_password An obfuscated version of password. For more details refer to the password option below.
password The password that incoming client needs to authorize themselves by. This option will replace the one found under Settings for NSClient. If this is blank the option found under Settings will be used. If both are blank everyone will be granted access.
allowed_hosts A list (coma separated) with hosts that are allowed to poll information from NSClient++. This will replace the one found under Setting for NSClient if present. If not present the same option found under Settings will be used. If both are blank all hosts will be allowed to access the system. BEWARE: NSClient++ will not resolve the IP address of DNS entries if the service is set to startup automatically. Use an IP address instead.
socket_back_log Number of sockets to queue before starting to refuse new incomming connections. This can be used to tweak the ammount of simultanious sockets that the server accepts. This is an advanced option and should not be used.
bind_to_address The address to bind to when listening to sockets.

NRPE

This is configuration for the NRPE module that controls how the NRPE listener operates.

OptionDefault valueDescription
port5666The port to listen to
allowed_hosts A list (coma separated) with hosts that are allowed to poll information from NRPE. This will replace the one found under Setting for NRPE if present. If not present the same option found under Settings will be used. If both are blank all hosts will be allowed to access the system
use_ssl1Boolean value to toggle SSL encryption on the socket connection
socket_back_log Number of sockets to queue before starting to refuse new incomming connections. This can be used to tweak the ammount of simultanious sockets that the server accepts. This is an advanced option and should not be used.
bind_to_address The address to bind to when listening to sockets.
command_timeout60The maximum time in seconds that a command can execute. (if more then this execution will be aborted). NOTICE this only affects external commands not internal ones.
allow_arguments0A Boolean flag to determine if arguments are accepted on the incoming socket. If arguments are not accepted you can still use external commands that need arguments but you have to define them in the NRPE handlers below. This is similar to the NRPE "dont_blame_nrpe" option.
allow_nasty_meta_chars0Allow NRPE execution to have “nasty” meta characters that might affect execution of external commands (things like > “ etc).
performance_data1Send performance data back to nagios

Check System

Here you can set various options to configure the System Check module.

OptionDefault valueDescription
CPUBufferSize1hThe time to store CPU load.
CheckResolution?10Time between checks in 1/10 of seconds.
auto_detect_pdh1Set this to 0 to disable auto detect (counters.defs) PDH language and OS version.
MemoryCommitLimit?\Memory\Commit LimitCounter to use to check upper memory limit.
MemoryCommitByte?\Memory\Committed BytesCounter to use to check current memory usage.
SystemSystemUpTime?\System\System Up TimeCounter to use to check the uptime of the system.
SystemTotalProcessorTime?\Processor(_total)\% Processor TimeCounter to use for CPU load.
ProcessEnumerationMethod?autoSet the PROCESS enumeration method (auto or TOOLHELP or PSAPI)

External Scripts

TODO

External Scripts

TODO

External Alias

TODO

includes

NSCA Agent

NSCA Commands

NRPE Handlers

This is a list of handlers for NRPE execution this can of course be used by any module (such as NSClient) but for historical reasons they are located in this section especially as NRPE plug-in is the one that does the actual execution.

The handlers can have two different syntaxes:

  • command[my_command]=/some/executable
  • my_command=/some/executable<br>The latter is the preferred way as it is shorter.