2017-07-12 20:46:12 +02:00
|
|
|
# Icinga 2 CLI Commands <a id="cli-commands"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2015-01-25 16:07:43 +01:00
|
|
|
Icinga 2 comes with a number of CLI commands which support bash autocompletion.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
These CLI commands will allow you to use certain functionality
|
2017-04-05 19:49:00 +02:00
|
|
|
provided by and around Icinga 2.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Each CLI command provides its own help and usage information, so please
|
|
|
|
make sure to always run them with the `--help` parameter.
|
|
|
|
|
|
|
|
Run `icinga2` without any arguments to get a list of all available global
|
|
|
|
options.
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 <command> [<arguments>]
|
|
|
|
|
|
|
|
Supported commands:
|
2017-08-11 16:23:24 +02:00
|
|
|
* api setup (setup for API)
|
2017-09-22 13:39:00 +02:00
|
|
|
* ca list (lists all certificate signing requests)
|
2018-08-08 18:09:41 +02:00
|
|
|
* ca restore (restores a removed certificate request)
|
2018-07-28 00:25:33 +02:00
|
|
|
* ca remove (removes an outstanding certificate request)
|
2017-09-22 13:39:00 +02:00
|
|
|
* ca sign (signs an outstanding certificate request)
|
2019-04-12 12:49:41 +02:00
|
|
|
* console (Icinga debug console)
|
2017-09-22 13:39:00 +02:00
|
|
|
* daemon (starts Icinga 2)
|
|
|
|
* feature disable (disables specified feature)
|
|
|
|
* feature enable (enables specified feature)
|
|
|
|
* feature list (lists all available features)
|
|
|
|
* node setup (set up node)
|
|
|
|
* node wizard (wizard for node setup)
|
|
|
|
* object list (lists all objects)
|
|
|
|
* pki new-ca (sets up a new CA)
|
|
|
|
* pki new-cert (creates a new CSR)
|
|
|
|
* pki request (requests a certificate)
|
|
|
|
* pki save-cert (saves another Icinga 2 instance's certificate)
|
|
|
|
* pki sign-csr (signs a CSR)
|
|
|
|
* pki ticket (generates a ticket)
|
2020-02-17 18:17:09 +01:00
|
|
|
* pki verify (verify TLS certificates: CN, signed by CA, is CA; Print certificate)
|
2017-09-22 13:39:00 +02:00
|
|
|
* variable get (gets a variable)
|
|
|
|
* variable list (lists all variables)
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## Icinga 2 CLI Bash Autocompletion <a id="cli-commands-autocompletion"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Bash Auto-Completion (pressing `<TAB>`) is provided only for the corresponding context.
|
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
While `--config` suggests and auto-completes files and directories on disk,
|
|
|
|
`feature enable` only suggests disabled features.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
RPM and Debian packages install the bash completion files into
|
|
|
|
`/etc/bash_completion.d/icinga2`.
|
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
You need to install the `bash-completion` package if not already installed.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
RHEL/CentOS/Fedora:
|
|
|
|
|
2020-12-09 12:32:09 +01:00
|
|
|
```bash
|
|
|
|
yum install bash-completion
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
SUSE:
|
|
|
|
|
2020-12-09 12:32:09 +01:00
|
|
|
```bash
|
|
|
|
zypper install bash-completion
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Debian/Ubuntu:
|
|
|
|
|
2020-12-09 12:32:09 +01:00
|
|
|
```bash
|
|
|
|
apt-get install bash-completion
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
Ensure that the `bash-completion.d` directory is added to your shell
|
|
|
|
environment. You can manually source the icinga2 bash-completion file
|
|
|
|
into your current session and test it:
|
|
|
|
|
2020-12-09 12:32:09 +01:00
|
|
|
```bash
|
|
|
|
source /etc/bash-completion.d/icinga2
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2016-11-23 15:33:28 +01:00
|
|
|
|
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## Icinga 2 CLI Global Options <a id="cli-commands-global-options"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2015-03-18 12:32:55 +01:00
|
|
|
### Application Type
|
|
|
|
|
|
|
|
By default the `icinga2` binary loads the `icinga` library. A different application type
|
|
|
|
can be specified with the `--app` command-line option.
|
2017-04-05 19:49:00 +02:00
|
|
|
Note: This is not needed by the average Icinga user, only developers.
|
2015-03-18 12:32:55 +01:00
|
|
|
|
2015-02-12 10:29:21 +01:00
|
|
|
### Libraries
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-08-13 15:59:06 +02:00
|
|
|
Instead of loading libraries using the [`library` config directive](17-language-reference.md#library)
|
2015-01-22 09:40:25 +01:00
|
|
|
you can also use the `--library` command-line option.
|
2017-04-05 19:49:00 +02:00
|
|
|
Note: This is not needed by the average Icinga user, only developers.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2015-02-12 10:29:21 +01:00
|
|
|
### Constants
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-08-13 15:59:06 +02:00
|
|
|
[Global constants](17-language-reference.md#constants) can be set using the `--define` command-line option.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
### Config Include Path <a id="config-include-path"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
When including files you can specify that the include search path should be
|
|
|
|
checked. You can do this by putting your configuration file name in angle
|
|
|
|
brackets like this:
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
include <test.conf>
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
This causes Icinga 2 to search its include path for the configuration file
|
|
|
|
`test.conf`. By default the installation path for the [Icinga Template Library](10-icinga-template-library.md#icinga-template-library)
|
2015-01-22 09:40:25 +01:00
|
|
|
is the only search directory.
|
|
|
|
|
|
|
|
Using the `--include` command-line option additional search directories can be
|
|
|
|
added.
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
## CLI command: Api <a id="cli-command-api"></a>
|
|
|
|
|
2019-04-26 10:51:39 +02:00
|
|
|
Provides helper functions to enable and setup the
|
|
|
|
[Icinga 2 API](12-icinga2-api.md#icinga2-api-setup).
|
|
|
|
|
|
|
|
### CLI command: Api Setup <a id="cli-command-api-setup "></a>
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
```
|
2019-04-26 10:51:39 +02:00
|
|
|
# icinga2 api setup --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
2019-04-26 10:51:39 +02:00
|
|
|
icinga2 api setup [<arguments>]
|
2017-09-22 13:39:00 +02:00
|
|
|
|
2019-04-26 10:51:39 +02:00
|
|
|
Setup for Icinga 2 API.
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
2019-04-26 10:51:39 +02:00
|
|
|
Command options:
|
|
|
|
--cn arg The certificate's common name
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2019-04-26 10:51:39 +02:00
|
|
|
Get support: <https://icinga.com/support/>
|
|
|
|
Documentation: <https://icinga.com/docs/>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## CLI command: Ca <a id="cli-command-ca"></a>
|
|
|
|
|
|
|
|
List and manage incoming certificate signing requests. More details
|
2017-10-09 21:09:12 +02:00
|
|
|
can be found in the [signing methods](06-distributed-monitoring.md#distributed-monitoring-setup-sign-certificates-master)
|
2017-09-22 13:39:00 +02:00
|
|
|
chapter. This CLI command is available since v2.8.
|
|
|
|
|
|
|
|
```
|
|
|
|
# icinga2 ca --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 <command> [<arguments>]
|
|
|
|
|
|
|
|
Supported commands:
|
|
|
|
* ca list (lists all certificate signing requests)
|
|
|
|
* ca sign (signs an outstanding certificate request)
|
2018-08-08 18:09:41 +02:00
|
|
|
* ca restore (restores a removed certificate request)
|
|
|
|
* ca remove (removes an outstanding certificate request)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2018-10-09 17:40:04 +02:00
|
|
|
|
|
|
|
### CLI command: Ca List <a id="cli-command-ca-list"></a>
|
|
|
|
|
|
|
|
```
|
|
|
|
icinga2 ca list --help
|
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 ca list [<arguments>]
|
|
|
|
|
|
|
|
Lists pending certificate signing requests.
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Command options:
|
|
|
|
--all List all certificate signing requests, including
|
|
|
|
signed. Note: Old requests are automatically
|
|
|
|
cleaned by Icinga after 1 week.
|
2019-05-10 17:57:42 +02:00
|
|
|
--removed List all removed CSRs (for use with 'ca restore')
|
2018-10-09 17:40:04 +02:00
|
|
|
--json encode output as JSON
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
|
|
|
Get support: <https://icinga.com/support/>
|
|
|
|
Documentation: <https://icinga.com/docs/>
|
|
|
|
Icinga home page: <https://icinga.com/>
|
|
|
|
```
|
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Console <a id="cli-command-console"></a>
|
2015-02-11 10:20:36 +01:00
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
The CLI command `console` can be used to debug and evaluate Icinga 2 config expressions,
|
|
|
|
e.g. to test [functions](17-language-reference.md#functions) in your local sandbox.
|
2015-02-11 10:20:36 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
$ icinga2 console
|
2019-04-08 14:08:14 +02:00
|
|
|
Icinga 2 (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
<1> => function test(name) {
|
|
|
|
<1> .. log("Hello " + name)
|
|
|
|
<1> .. }
|
|
|
|
null
|
|
|
|
<2> => test("World")
|
|
|
|
information/config: Hello World
|
|
|
|
null
|
|
|
|
<3> =>
|
|
|
|
```
|
2015-02-11 10:20:36 +01:00
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
Further usage examples can be found in the [library reference](18-library-reference.md#library-reference) chapter.
|
2015-11-04 10:39:32 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 console --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 console [<arguments>]
|
|
|
|
|
|
|
|
Interprets Icinga script expressions.
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Command options:
|
|
|
|
-c [ --connect ] arg connect to an Icinga 2 instance
|
|
|
|
-e [ --eval ] arg evaluate expression and terminate
|
|
|
|
-r [ --file ] arg evaluate a file and terminate
|
|
|
|
--syntax-only only validate syntax (requires --eval or --file)
|
|
|
|
--sandbox enable sandbox mode
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2015-11-04 10:39:32 +01:00
|
|
|
On operating systems without the `libedit` library installed there is no
|
2015-11-07 13:49:14 +01:00
|
|
|
support for line-editing or a command history. However you can
|
2015-02-11 10:20:36 +01:00
|
|
|
use the `rlwrap` program if you require those features:
|
|
|
|
|
2020-12-09 12:32:09 +01:00
|
|
|
```bash
|
|
|
|
rlwrap icinga2 console
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
The debug console can be used to connect to a running Icinga 2 instance using
|
2016-08-13 15:59:06 +02:00
|
|
|
the [REST API](12-icinga2-api.md#icinga2-api). [API permissions](12-icinga2-api.md#icinga2-api-permissions)
|
2015-11-04 10:39:32 +01:00
|
|
|
are required for executing config expressions and auto-completion.
|
|
|
|
|
2015-11-07 13:49:14 +01:00
|
|
|
> **Note**
|
2017-04-05 19:49:00 +02:00
|
|
|
>
|
2019-04-12 12:49:41 +02:00
|
|
|
> The debug console does not currently support TLS certificate verification.
|
2017-04-05 19:49:00 +02:00
|
|
|
>
|
|
|
|
> Runtime modifications are not validated and might cause the Icinga 2
|
|
|
|
> daemon to crash or behave in an unexpected way. Use these runtime changes
|
|
|
|
> at your own risk and rather *inspect and debug objects read-only*.
|
2015-11-04 10:39:32 +01:00
|
|
|
|
2015-11-07 13:49:14 +01:00
|
|
|
You can specify the API URL using the `--connect` parameter.
|
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
Although the password can be specified there process arguments on UNIX platforms are
|
|
|
|
usually visible to other users (e.g. through `ps`). In order to securely specify the
|
2017-04-05 19:49:00 +02:00
|
|
|
user credentials the debug console supports two environment variables:
|
2015-11-07 13:49:14 +01:00
|
|
|
|
|
|
|
Environment variable | Description
|
|
|
|
---------------------|-------------
|
|
|
|
ICINGA2_API_USERNAME | The API username.
|
|
|
|
ICINGA2_API_PASSWORD | The API password.
|
|
|
|
|
|
|
|
Here's an example:
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
$ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/'
|
2019-04-08 14:08:14 +02:00
|
|
|
Icinga 2 (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
<1> =>
|
|
|
|
```
|
2015-11-04 10:39:32 +01:00
|
|
|
|
2015-11-07 13:49:14 +01:00
|
|
|
Once connected you can inspect variables and execute other expressions by entering them at the prompt:
|
2015-11-04 10:39:32 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2019-07-19 14:44:14 +02:00
|
|
|
<1> => var h = get_host("icinga2-agent1.localdomain")
|
2017-09-22 13:39:00 +02:00
|
|
|
null
|
|
|
|
<2> => h.last_check_result
|
|
|
|
{
|
|
|
|
active = true
|
2019-07-19 14:44:14 +02:00
|
|
|
check_source = "icinga2-agent1.localdomain"
|
2017-09-22 13:39:00 +02:00
|
|
|
command = [ "/usr/local/sbin/check_ping", "-H", "127.0.0.1", "-c", "5000,100%", "-w", "3000,80%" ]
|
|
|
|
execution_end = 1446653527.174983
|
|
|
|
execution_start = 1446653523.152673
|
|
|
|
exit_status = 0.000000
|
|
|
|
output = "PING OK - Packet loss = 0%, RTA = 0.11 ms"
|
|
|
|
performance_data = [ "rta=0.114000ms;3000.000000;5000.000000;0.000000", "pl=0%;80;100;0" ]
|
|
|
|
schedule_end = 1446653527.175133
|
|
|
|
schedule_start = 1446653583.150000
|
|
|
|
state = 0.000000
|
|
|
|
type = "CheckResult"
|
|
|
|
vars_after = {
|
|
|
|
attempt = 1.000000
|
|
|
|
reachable = true
|
|
|
|
state = 0.000000
|
|
|
|
state_type = 1.000000
|
|
|
|
}
|
|
|
|
vars_before = {
|
|
|
|
attempt = 1.000000
|
|
|
|
reachable = true
|
|
|
|
state = 0.000000
|
|
|
|
state_type = 1.000000
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<3> =>
|
|
|
|
```
|
2015-11-04 10:39:32 +01:00
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
You can use the `--eval` parameter to evaluate a single expression in batch mode.
|
|
|
|
Using the `--file` option you can specify a file which should be evaluated.
|
|
|
|
The output format for batch mode is JSON.
|
2016-08-25 19:14:54 +02:00
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
The `--syntax-only` option can be used in combination with `--eval` or `--file`
|
|
|
|
to check a script for syntax errors. In this mode the script is parsed to identify
|
|
|
|
syntax errors but not evaluated.
|
2015-11-07 13:49:14 +01:00
|
|
|
|
2019-07-19 14:44:14 +02:00
|
|
|
Here's an example that retrieves the command that was used by Icinga to check the `icinga2-agent1.localdomain` host:
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
```
|
2019-07-19 14:44:14 +02:00
|
|
|
$ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' --eval 'get_host("icinga2-agent1.localdomain").last_check_result.command' | python -m json.tool
|
2017-09-22 13:39:00 +02:00
|
|
|
[
|
|
|
|
"/usr/local/sbin/check_ping",
|
|
|
|
"-H",
|
|
|
|
"127.0.0.1",
|
|
|
|
"-c",
|
|
|
|
"5000,100%",
|
|
|
|
"-w",
|
|
|
|
"3000,80%"
|
|
|
|
]
|
|
|
|
```
|
2015-11-04 10:39:32 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Daemon <a id="cli-command-daemon"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
The CLI command `daemon` provides the functionality to start/stop Icinga 2.
|
2017-04-05 19:49:00 +02:00
|
|
|
Furthermore it allows to run the [configuration validation](11-cli-commands.md#config-validation).
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 daemon --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 daemon [<arguments>]
|
|
|
|
|
|
|
|
Starts Icinga 2.
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Command options:
|
|
|
|
-c [ --config ] arg parse a configuration file
|
|
|
|
-z [ --no-config ] start without a configuration file
|
|
|
|
-C [ --validate ] exit after validating the configuration
|
2022-11-21 12:37:07 +01:00
|
|
|
--dump-objects write icinga2.debug cache file for icinga2 object list
|
2017-09-22 13:39:00 +02:00
|
|
|
-e [ --errorlog ] arg log fatal errors to the specified log file (only
|
Fix logging under systemd
icinga2.service used `-e ${ICINGA2_ERROR_LOG}`, but this is documented
as having no effect without `-d`. Furthermore, icinga2 under systemd
unconditionally logged everything to the system log (but without setting
the log level etc), which contradicted the documentation. (Issue #6339)
Stop icinga2 on systemd from logging to stdout - and hence the system log -
once it has finished starting up. Just like when you start icinga2 from a
terminal using `-d`. And just like -d, we stop logging fatal errors to
stderr, and instead write to the log file passed with `-e`.
As per docs, mainlog (icinga2.log) is already enabled by default. And
pre-startup messages including config errors will still appear in the
system log.
This uses a new option --close-stdio, which has the same effect on logging as
--daemonize, but does not fork or call setsid().
For this purpose, I moved setsid() up and into Daemonize().
Consequence of that last point: if anyone is weird enough to specify a TTY
device file as the fatal error log (-e option), that will become icinga's
controlling terminal, which you generally don't want as a daemon. This
makes it consistent with the existing behaviour for icinga mainlog. For
this reason you're supposed to use O_NOCTTY in Linux daemons. But I wasn't
sure where icinga would want to put the ugly `#ifdef _WIN32 ... #else ...`.
2018-05-29 18:24:05 +02:00
|
|
|
works in combination with --daemonize or
|
|
|
|
--close-stdio)
|
2017-09-22 13:39:00 +02:00
|
|
|
-d [ --daemonize ] detach from the controlling terminal
|
Fix logging under systemd
icinga2.service used `-e ${ICINGA2_ERROR_LOG}`, but this is documented
as having no effect without `-d`. Furthermore, icinga2 under systemd
unconditionally logged everything to the system log (but without setting
the log level etc), which contradicted the documentation. (Issue #6339)
Stop icinga2 on systemd from logging to stdout - and hence the system log -
once it has finished starting up. Just like when you start icinga2 from a
terminal using `-d`. And just like -d, we stop logging fatal errors to
stderr, and instead write to the log file passed with `-e`.
As per docs, mainlog (icinga2.log) is already enabled by default. And
pre-startup messages including config errors will still appear in the
system log.
This uses a new option --close-stdio, which has the same effect on logging as
--daemonize, but does not fork or call setsid().
For this purpose, I moved setsid() up and into Daemonize().
Consequence of that last point: if anyone is weird enough to specify a TTY
device file as the fatal error log (-e option), that will become icinga's
controlling terminal, which you generally don't want as a daemon. This
makes it consistent with the existing behaviour for icinga mainlog. For
this reason you're supposed to use O_NOCTTY in Linux daemons. But I wasn't
sure where icinga would want to put the ugly `#ifdef _WIN32 ... #else ...`.
2018-05-29 18:24:05 +02:00
|
|
|
--close-stdio do not log to stdout (or stderr) after startup
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2016-11-23 15:33:28 +01:00
|
|
|
|
2018-04-12 19:12:37 +02:00
|
|
|
### Config Files <a id="cli-command-daemon-config-files"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
You can specify one or more configuration files with the `--config` option.
|
2016-11-23 15:33:28 +01:00
|
|
|
Configuration files are processed in the order they're specified on the command-line.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
When no configuration file is specified and the `--no-config` is not used
|
|
|
|
Icinga 2 automatically falls back to using the configuration file
|
2018-07-31 11:59:09 +02:00
|
|
|
`ConfigDir + "/icinga2.conf"` (where ConfigDir is usually `/etc/icinga2`).
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2018-04-12 19:12:37 +02:00
|
|
|
### Validation <a id="cli-command-daemon-validation"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-04-05 19:49:00 +02:00
|
|
|
The `--validate` option can be used to check if configuration files
|
2016-05-23 12:47:22 +02:00
|
|
|
contain errors. If any errors are found, the exit status is 1, otherwise 0
|
2016-08-13 15:59:06 +02:00
|
|
|
is returned. More details in the [configuration validation](11-cli-commands.md#config-validation) chapter.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Feature <a id="cli-command-feature"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2015-01-25 16:07:43 +01:00
|
|
|
The `feature enable` and `feature disable` commands can be used to enable and disable features:
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 feature disable <tab>
|
|
|
|
--app --define --include --log-level --version checker graphite mainlog
|
|
|
|
--color --help --library --script-debugger api command ido-mysql notification
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 feature enable <tab>
|
|
|
|
--app --define --include --log-level --version debuglog ido-pgsql livestatus perfdata syslog
|
|
|
|
--color --help --library --script-debugger compatlog gelf influxdb opentsdb statusdata
|
|
|
|
```
|
2015-01-25 16:07:43 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
The `feature list` command shows which features are currently enabled:
|
2015-01-25 16:07:43 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 feature list
|
|
|
|
Disabled features: compatlog debuglog gelf ido-pgsql influxdb livestatus opentsdb perfdata statusdata syslog
|
|
|
|
Enabled features: api checker command graphite ido-mysql mainlog notification
|
|
|
|
```
|
2015-01-25 16:07:43 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Node <a id="cli-command-node"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
Provides the functionality to setup master and client
|
2017-07-12 20:46:12 +02:00
|
|
|
nodes in a [distributed monitoring](06-distributed-monitoring.md#distributed-monitoring) scenario.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 node --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 <command> [<arguments>]
|
|
|
|
|
|
|
|
Supported commands:
|
|
|
|
* node setup (set up node)
|
|
|
|
* node wizard (wizard for node setup)
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2016-11-23 15:33:28 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Object <a id="cli-command-object"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
The `object` CLI command can be used to list all configuration objects and their
|
2017-04-05 19:49:00 +02:00
|
|
|
attributes. The command also shows where each of the attributes was modified and as such
|
|
|
|
provides debug information for further configuration problem analysis.
|
2016-08-13 15:59:06 +02:00
|
|
|
That way you can also identify which objects have been created from your [apply rules](17-language-reference.md#apply).
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2022-11-21 12:37:07 +01:00
|
|
|
Configuration modifications are not immediately updated. Furthermore there is a known issue with
|
2017-04-05 19:49:00 +02:00
|
|
|
[group assign expressions](17-language-reference.md#group-assign) which are not reflected in the host object output.
|
2022-11-21 12:37:07 +01:00
|
|
|
You need to run `icinga2 daemon -C --dump-objects` in order to update the `icinga2.debug` cache file.
|
2017-04-05 19:49:00 +02:00
|
|
|
|
2017-09-20 15:48:47 +02:00
|
|
|
More information can be found in the [troubleshooting](15-troubleshooting.md#troubleshooting-list-configuration-objects) section.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 object --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 <command> [<arguments>]
|
|
|
|
|
|
|
|
Supported commands:
|
|
|
|
* object list (lists all objects)
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Pki <a id="cli-command-pki"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Provides the CLI commands to
|
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
* generate a new certificate authority (CA)
|
2015-01-22 09:40:25 +01:00
|
|
|
* generate a new CSR or self-signed certificate
|
|
|
|
* sign a CSR and return a certificate
|
|
|
|
* save a master certificate manually
|
|
|
|
* request a signed certificate from the master
|
|
|
|
* generate a new ticket for the client setup
|
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
This functionality is used by the [node setup/wizard](11-cli-commands.md#cli-command-node) CLI commands.
|
2017-07-12 20:46:12 +02:00
|
|
|
You will need them in the [distributed monitoring chapter](06-distributed-monitoring.md#distributed-monitoring).
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 pki --help
|
2020-02-17 18:17:09 +01:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.12.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 <command> [<arguments>]
|
|
|
|
|
|
|
|
Supported commands:
|
|
|
|
* pki new-ca (sets up a new CA)
|
|
|
|
* pki new-cert (creates a new CSR)
|
|
|
|
* pki request (requests a certificate)
|
|
|
|
* pki save-cert (saves another Icinga 2 instance's certificate)
|
|
|
|
* pki sign-csr (signs a CSR)
|
|
|
|
* pki ticket (generates a ticket)
|
2020-02-17 18:17:09 +01:00
|
|
|
* pki verify (verify TLS certificates: CN, signed by CA, is CA; Print certificate)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## CLI command: Variable <a id="cli-command-variable"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-10-17 12:25:58 +02:00
|
|
|
Lists all configured variables (constants) in a similar fashion like [object list](11-cli-commands.md#cli-command-object).
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 variable --help
|
2019-04-08 14:08:14 +02:00
|
|
|
icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
|
2017-09-22 13:39:00 +02:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
icinga2 <command> [<arguments>]
|
|
|
|
|
|
|
|
Supported commands:
|
|
|
|
* variable get (gets a variable)
|
|
|
|
* variable list (lists all variables)
|
|
|
|
|
|
|
|
Global options:
|
|
|
|
-h [ --help ] show this help message
|
|
|
|
-V [ --version ] show version information
|
|
|
|
--color use VT100 color codes even when stdout is not a
|
|
|
|
terminal
|
|
|
|
-D [ --define ] arg define a constant
|
|
|
|
-a [ --app ] arg application library name (default: icinga)
|
|
|
|
-l [ --library ] arg load a library
|
|
|
|
-I [ --include ] arg add include search directory
|
|
|
|
-x [ --log-level ] arg specify the log level for the console log.
|
|
|
|
The valid value is either debug, notice,
|
|
|
|
information (default), warning, or critical
|
|
|
|
-X [ --script-debugger ] whether to enable the script debugger
|
|
|
|
|
|
|
|
Report bugs at <https://github.com/Icinga/icinga2>
|
2018-10-18 09:50:53 +02:00
|
|
|
Icinga home page: <https://icinga.com/>
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## Enabling/Disabling Features <a id="enable-features"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Icinga 2 provides configuration files for some commonly used features. These
|
|
|
|
are installed in the `/etc/icinga2/features-available` directory and can be
|
|
|
|
enabled and disabled using the `icinga2 feature enable` and `icinga2 feature disable`
|
2016-08-13 15:59:06 +02:00
|
|
|
[CLI commands](11-cli-commands.md#cli-command-feature), respectively.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
The `icinga2 feature enable` CLI command creates symlinks in the
|
|
|
|
`/etc/icinga2/features-enabled` directory which is included by default
|
|
|
|
in the example configuration file.
|
|
|
|
|
|
|
|
You can view a list of enabled and disabled features:
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 feature list
|
|
|
|
Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog
|
|
|
|
Enabled features: checker mainlog notification
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Using the `icinga2 feature enable` command you can enable features:
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 feature enable graphite
|
|
|
|
Enabling feature graphite. Make sure to restart Icinga 2 for these changes to take effect.
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
You can disable features using the `icinga2 feature disable` command:
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 feature disable ido-mysql livestatus
|
|
|
|
Disabling feature ido-mysql. Make sure to restart Icinga 2 for these changes to take effect.
|
|
|
|
Disabling feature livestatus. Make sure to restart Icinga 2 for these changes to take effect.
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
The `icinga2 feature enable` and `icinga2 feature disable` commands do not
|
|
|
|
restart Icinga 2. You will need to restart Icinga 2 using the init script
|
|
|
|
after enabling or disabling features.
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## Configuration Validation <a id="config-validation"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
Once you've edited the configuration files make sure to tell Icinga 2 to validate
|
|
|
|
the configuration changes. Icinga 2 will log any configuration error including
|
|
|
|
a hint on the file, the line number and the affected configuration line itself.
|
|
|
|
|
|
|
|
The following example creates an apply rule without any `assign` condition.
|
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
apply Service "my-ping4" {
|
|
|
|
import "generic-service"
|
|
|
|
check_command = "ping4"
|
|
|
|
//assign where host.address
|
|
|
|
}
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
Validate the configuration:
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
|
|
|
# icinga2 daemon -C
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
[2014-05-22 17:07:25 +0200] critical/ConfigItem: Location:
|
|
|
|
/etc/icinga2/conf.d/tests/my.conf(5): }
|
|
|
|
/etc/icinga2/conf.d/tests/my.conf(6):
|
|
|
|
/etc/icinga2/conf.d/tests/my.conf(7): apply Service "my-ping4" {
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
/etc/icinga2/conf.d/tests/my.conf(8): import "test-generic-service"
|
|
|
|
/etc/icinga2/conf.d/tests/my.conf(9): check_command = "ping4"
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2017-09-22 13:39:00 +02:00
|
|
|
Config error: 'apply' is missing 'assign'
|
|
|
|
[2014-05-22 17:07:25 +0200] critical/ConfigItem: 1 errors, 0 warnings.
|
|
|
|
Icinga 2 detected configuration errors.
|
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2015-11-20 15:57:16 +01:00
|
|
|
If you encounter errors during configuration validation, please make sure
|
2016-08-13 15:59:06 +02:00
|
|
|
to read the [troubleshooting](15-troubleshooting.md#troubleshooting) chapter.
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-08-13 15:59:06 +02:00
|
|
|
You can also use the [CLI command](11-cli-commands.md#cli-command-object) `icinga2 object list`
|
2015-01-22 09:40:25 +01:00
|
|
|
after validation passes to analyze object attributes, inheritance or created
|
|
|
|
objects by apply rules.
|
2017-09-20 15:48:47 +02:00
|
|
|
Find more on troubleshooting with `object list` in [this chapter](15-troubleshooting.md#troubleshooting-list-configuration-objects).
|
2015-01-22 09:40:25 +01:00
|
|
|
|
|
|
|
|
2017-07-12 20:46:12 +02:00
|
|
|
## Reload on Configuration Changes <a id="config-change-reload"></a>
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
Every time you have changed your configuration you should first tell Icinga 2
|
2016-08-13 15:59:06 +02:00
|
|
|
to [validate](11-cli-commands.md#config-validation). If there are no validation errors, you can
|
2015-01-22 09:40:25 +01:00
|
|
|
safely reload the Icinga 2 daemon.
|
|
|
|
|
2020-12-09 12:32:09 +01:00
|
|
|
```bash
|
|
|
|
systemctl reload icinga2
|
2017-09-22 13:39:00 +02:00
|
|
|
```
|
2015-01-22 09:40:25 +01:00
|
|
|
|
2016-11-23 15:33:28 +01:00
|
|
|
The `reload` action will send the `SIGHUP` signal to the Icinga 2 daemon
|
|
|
|
which will validate the configuration in a separate process and not stop
|
|
|
|
the other events like check execution, notifications, etc.
|