IcingaClient
Icinga 2 client submits passive check results to an Icinga 2 server via the REST API
Enable module
To enable this module and and allow using the commands you need to ass IcingaClient = enabled to the [/modules] section in nsclient.ini:
[/modules]
IcingaClient = enabled
Queries
A quick reference for all available queries (check commands) in the IcingaClient module.
List of commands:
A list of all available queries (check commands)
| Command | Description |
|---|---|
| submit_icinga | Submit information to the remote Icinga 2 Server. |
submit_icinga
Submit information to the remote Icinga 2 Server.
Jump to section:
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 | |
| username | The username used to authenticate against the Icinga 2 REST API. | |
| password | The password used to authenticate against the Icinga 2 REST API. | |
| hostname | Source/sender host name (default is auto which means use the name of the actual host) | |
| ensure-objects | true | Create missing host/service objects in Icinga 2 before submitting (true/false). |
| host-template | Templates used when auto-creating host objects (default: generic-host). | |
| service-template | Templates used when auto-creating service objects (default: generic-service). | |
| check-command | The check_command to set on auto-created service objects (default: dummy). | |
| check-source | Override for the check_source field reported to Icinga 2. | |
| tls-version | 1.3 | The TLS version to use 1.0, 1.1, 1.2, 1.3 or any |
| verify-mode | Comma separated list of options: none, peer, peer-cert, client-once, fail-if-no-cert, workarounds, single. In general use peer-cert or none for self signed certificates. | |
| ca | Certificate authority to use when verifying certificates. |
ensure-objects:
Create missing host/service objects in Icinga 2 before submitting (true/false).
Default Value: true
tls-version:
The TLS version to use 1.0, 1.1, 1.2, 1.3 or any
Default Value: 1.3
Configuration
| Path / Section | Description |
|---|---|
| /settings/icinga/client | Icinga 2 client |
| /settings/icinga/client/handlers | CLIENT HANDLER SECTION |
| /settings/icinga/client/targets | REMOTE TARGET DEFINITIONS |
Icinga 2 client
Section for Icinga 2 (Icinga REST API) passive check submission.
| Key | Default Value | Description |
|---|---|---|
| channel | ICINGA | CHANNEL |
| hostname | auto | HOSTNAME |
# Section for Icinga 2 (Icinga REST API) passive check submission.
[/settings/icinga/client]
channel=ICINGA
hostname=auto
CHANNEL
The channel to listen to.
| Key | Description |
|---|---|
| Path: | /settings/icinga/client |
| Key: | channel |
| Default value: | ICINGA |
Sample:
[/settings/icinga/client]
# CHANNEL
channel=ICINGA
HOSTNAME
The host name of the monitored computer. Set this to auto (default) to use the windows name of the computer.
auto Hostname ${host} Hostname ${host_lc} Hostname in lowercase ${host_uc} Hostname in uppercase ${domain} Domainname ${domain_lc} Domainname in lowercase ${domain_uc} Domainname in uppercase
| Key | Description |
|---|---|
| Path: | /settings/icinga/client |
| Key: | hostname |
| Default value: | auto |
Sample:
[/settings/icinga/client]
# HOSTNAME
hostname=auto
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 | |
| ca | ${ca-path} | CERTIFICATE AUTHORITY |
| check command | CHECK COMMAND | |
| check source | CHECK SOURCE | |
| ensure objects | ENSURE HOST/SERVICE OBJECTS | |
| host | TARGET HOST | |
| host template | HOST TEMPLATE | |
| password | ICINGA API PASSWORD | |
| port | TARGET PORT | |
| retries | 3 | RETRIES |
| service template | SERVICE TEMPLATE | |
| timeout | 30 | TIMEOUT |
| tls version | 1.3 | TLS VERSION |
| username | ICINGA API USER | |
| verify mode | peer | TLS PEER VERIFY MODE |
Sample:
# An example of a REMOTE TARGET DEFINITIONS section
[/settings/icinga/client/targets/sample]
#address=...
ca=${ca-path}
#check command=...
#check source=...
#ensure objects=...
#host=...
#host template=...
#password=...
#port=...
retries=3
#service template=...
timeout=30
tls version=1.3
#username=...
verify mode=peer