Skip to content

NSCPClient

NSCP client can be used both from command line and from queries to check remote systems via NSCP (REST)

Enable module

To enable this module and and allow using the commands you need to ass NSCPClient = enabled to the [/modules] section in nsclient.ini:

[/modules]
NSCPClient = enabled

Queries

A quick reference for all available queries (check commands) in the NSCPClient module.

List of commands:

A list of all available queries (check commands)

Command Description
check_remote_nscp Request remote information via NSCP.
exec_remote_nscp Execute remote script via NSCP.
remote_nscp_query Request remote information via NSCP.
remote_nscpforward Forward the request as-is to remote host via NSCP.
submit_remote_nscp Submit information to remote host via NSCP.

check_remote_nscp

Request remote information via NSCP.

Command-line Arguments

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
host The host of the host running the server
port The port of the host running the server
address The address (host:port) of the host running the server
timeout Number of seconds before connection times out (default=10)
target Target to use (lookup connection info from config)
retry Number of times ti retry a failed connection attempt (default=2)
retries legacy version of retry
source-host Source/sender host name (default is auto which means use the name of the actual host)
sender-host Source/sender host name (default is auto which means use the name of the actual host)
command The name of the command that the remote daemon should run
argument Set command line arguments
separator Separator to use for the batch command (default is
batch Add multiple records using the separator format is: command
certificate The client certificate to use
dh The DH key to use
certificate-key Client certificate to use
certificate-format Client certificate format
ca Certificate authority
verify Client certificate format
allowed-ciphers Client certificate format
ssl 1 Initial an ssl handshake with the server.
password Password
ssl:

Initial an ssl handshake with the server.

Default Value: 1

exec_remote_nscp

Execute remote script via NSCP.

Command-line Arguments

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
host The host of the host running the server
port The port of the host running the server
address The address (host:port) of the host running the server
timeout Number of seconds before connection times out (default=10)
target Target to use (lookup connection info from config)
retry Number of times ti retry a failed connection attempt (default=2)
retries legacy version of retry
source-host Source/sender host name (default is auto which means use the name of the actual host)
sender-host Source/sender host name (default is auto which means use the name of the actual host)
command The name of the command that the remote daemon should run
argument Set command line arguments
separator Separator to use for the batch command (default is
batch Add multiple records using the separator format is: command
certificate The client certificate to use
dh The DH key to use
certificate-key Client certificate to use
certificate-format Client certificate format
ca Certificate authority
verify Client certificate format
allowed-ciphers Client certificate format
ssl 1 Initial an ssl handshake with the server.
password Password
ssl:

Initial an ssl handshake with the server.

Default Value: 1

remote_nscp_query

Request remote information via NSCP.

Command-line Arguments

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
host The host of the host running the server
port The port of the host running the server
address The address (host:port) of the host running the server
timeout Number of seconds before connection times out (default=10)
target Target to use (lookup connection info from config)
retry Number of times ti retry a failed connection attempt (default=2)
retries legacy version of retry
source-host Source/sender host name (default is auto which means use the name of the actual host)
sender-host Source/sender host name (default is auto which means use the name of the actual host)
command The name of the command that the remote daemon should run
argument Set command line arguments
separator Separator to use for the batch command (default is
batch Add multiple records using the separator format is: command
certificate The client certificate to use
dh The DH key to use
certificate-key Client certificate to use
certificate-format Client certificate format
ca Certificate authority
verify Client certificate format
allowed-ciphers Client certificate format
ssl 1 Initial an ssl handshake with the server.
password Password
ssl:

Initial an ssl handshake with the server.

Default Value: 1

remote_nscpforward

Forward the request as-is to remote host via NSCP.

Command-line Arguments

submit_remote_nscp

Submit information to remote host via NSCP.

Command-line Arguments

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
host The host of the host running the server
port The port of the host running the server
address The address (host:port) of the host running the server
timeout Number of seconds before connection times out (default=10)
target Target to use (lookup connection info from config)
retry Number of times ti retry a failed connection attempt (default=2)
retries legacy version of retry
source-host Source/sender host name (default is auto which means use the name of the actual host)
sender-host Source/sender host name (default is auto which means use the name of the actual host)
command The name of the command that the remote daemon should run
alias Same as command
message Message
result Result code either a number or OK, WARN, CRIT, UNKNOWN
separator Separator to use for the batch command (default is
batch Add multiple records using the separator format is: command
certificate The client certificate to use
dh The DH key to use
certificate-key Client certificate to use
certificate-format Client certificate format
ca Certificate authority
verify Client certificate format
allowed-ciphers Client certificate format
ssl 1 Initial an ssl handshake with the server.
password Password
ssl:

Initial an ssl handshake with the server.

Default Value: 1

Configuration

Path / Section Description
/settings/NSCP/client NSCP CLIENT SECTION
/settings/NSCP/client/handlers CLIENT HANDLER SECTION
/settings/NSCP/client/targets REMOTE TARGET DEFINITIONS

NSCP CLIENT SECTION

Section for NSCP active/passive check module.

Key Default Value Description
channel NSCP CHANNEL
# Section for NSCP active/passive check module.
[/settings/NSCP/client]
channel=NSCP

CHANNEL

The channel to listen to.

Key Description
Path: /settings/NSCP/client
Key: channel
Default value: NSCP
Used by: NSCPClient

Sample:

[/settings/NSCP/client]
# CHANNEL
channel=NSCP

CLIENT HANDLER SECTION

This is a section of objects. This means that you will create objects below this point by adding sections which all look the same.

REMOTE TARGET DEFINITIONS

This is a section of objects. This means that you will create objects below this point by adding sections which all look the same.

Keys:

Key Default Value Description
address TARGET ADDRESS
allowed ciphers ALLOWED CIPHERS
ca CA
certificate SSL CERTIFICATE
certificate format CERTIFICATE FORMAT
certificate key SSL CERTIFICATE
dh DH KEY
host TARGET HOST
password PASSWORD
port TARGET PORT
retries 3 RETRIES
timeout 30 TIMEOUT
use ssl ENABLE SSL ENCRYPTION
verify mode VERIFY MODE

Sample:

# An example of a REMOTE TARGET DEFINITIONS section
[/settings/NSCP/client/targets/sample]
#address=...
#allowed ciphers=...
#ca=...
#certificate=...
#certificate format=...
#certificate key=...
#dh=...
#host=...
#password=...
#port=...
retries=3
timeout=30
#use ssl=...
#verify mode=...