Docs: Move troubleshooting after getting started, mention object list in validation

fixes #7514
fixes #7478
This commit is contained in:
Michael Friedrich 2014-11-01 21:35:48 +01:00
parent 5934c02dd9
commit 9844a2c990
6 changed files with 66 additions and 22 deletions

View File

@ -1395,16 +1395,21 @@ 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.
apply Service "5872-ping4" {
import "test-generic-service"
import "generic-service"
check_command = "ping4"
//assign where match("5872-*", host.name)
}
Validate the configuration with the init script option `checkconfig`
Validate the configuration with the init script option `checkconfig`:
# /etc/init.d/icinga2 checkconfig
or manually passing the `-C` argument:
> **Note**
>
> Using [Systemd](#systemd-service) you need to manually validate the configuration using
> the cli command below.
Or manually passing the `-C` argument:
# /usr/sbin/icinga2 daemon -c /etc/icinga2/icinga2.conf -C
@ -1420,6 +1425,46 @@ or manually passing the `-C` argument:
[2014-05-22 17:07:25 +0200] critical/ConfigItem: 1 errors, 0 warnings.
Icinga 2 detected configuration errors.
> **Tip**
>
> Icinga 2 will automatically detect the default path for `icinga2.conf`
> in `SysconfDir + /icinga2/icinga2.conf` and you can safely omit this parameter.
>
> `# icinga2 daemon -C`
If you encouter errors during configuration validation, please make sure
to read the [troubleshooting](#troubleshooting) chapter.
You can also use the cli command `icinga2 object list` after validation passes
to analyze object attributes, inheritance or created objects by apply rules.
Find more on troubleshooting with `object list` in [this chapter](#list-configuration-objects).
Example filtered by `Service` objects with the name `ping*`:
# icinga2 object list --type Service --name *ping*
Object 'nbmif.int.netways.de!ping4' of type 'Service':
* __name = 'nbmif.int.netways.de!ping4'
* check_command = 'ping4'
% = modified in '/etc/icinga2/conf.d/services.conf', lines 17:3-17:25
* check_interval = 60
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 28:3-28:21
* host_name = 'nbmif.int.netways.de'
% = modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21
* max_check_attempts = 3
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 27:3-27:24
* name = 'ping4'
% = modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21
* retry_interval = 30
% = modified in '/etc/icinga2/conf.d/templates.conf', lines 29:3-29:22
* templates = [ 'ping4', 'generic-service' ]
% += modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21
% += modified in '/etc/icinga2/conf.d/templates.conf', lines 26:1-30:1
* type = 'Service'
* vars
% += modified in '/etc/icinga2/conf.d/services.conf', lines 18:3-18:19
* sla = '24x7'
% = modified in '/etc/icinga2/conf.d/services.conf', lines 18:3-18:19
### <a id="config-change-reload"></a> Reload on Configuration Changes

View File

@ -30,7 +30,9 @@ Additionally you can enable the debug log using
## <a id="list-configuration-objects"></a> List Configuration Objects
The `icinga2 object list` cli command can be used to list all configuration objects and their
attributes. The tool also shows where each of the attributes was modified:
attributes. The tool also shows where each of the attributes was modified.
That way you can also identify which objects have been created from your [apply rules](#apply).
# icinga2 object list
@ -82,12 +84,25 @@ You can filter by name or type too.
% += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19
* sla = '24x7'
% = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19
Found 1 Service objects.
[2014-10-15 14:27:19 +0200] information/cli: Parsed 175 objects.
## <a id="check-command-definitions"></a> Where are the check command definitions
Icinga 2 ships additional [plugin check command definitions](#plugin-check-commands) which are
included using
include <itl>
include <plugins>
in [icinga2.conf](#icinga2-conf). These configurations will be overridden on upgrade, so please
send modifications as proposed patches upstream. The default include path is set to
`LocalStateDir + "/share/icinga2/includes"`.
You should add your own command definitions to a new file in `conf.d/` called `commands.conf`
or similar.
## <a id="checks-not-executed"></a> Checks are not executed
@ -147,22 +162,6 @@ Icinga 2 allows you to import templates using the [import](#import) keyword. If
contain additional attributes, your objects will automatically inherit them. You can override
or modify these attributes in the current object.
## <a id="check-command-definitions"></a> Where are the check command definitions
Icinga 2 ships additional [plugin check command definitions](#plugin-check-commands) which are
included using
include <itl>
include <plugins>
in [icinga2.conf](#icinga2-conf). These configurations will be overridden on upgrade, so please
send modifications as proposed patches upstream. The default include path is set to
`LocalStateDir + "/share/icinga2/includes"`.
You should add your own command definitions to a new file in `conf.d/` called `commands.conf`
or similar.
## <a id="troubleshooting-cluster"></a> Cluster Troubleshooting
You should configure the [cluster health checks](#cluster-health-check) if you haven't