From 9844a2c9906ef9b27aa0f201e8a49d12a6d7c84a Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Sat, 1 Nov 2014 21:35:48 +0100 Subject: [PATCH] Docs: Move troubleshooting after getting started, mention object list in validation fixes #7514 fixes #7478 --- doc/2-getting-started.md | 51 +++++++++++++++++-- ...roubleshooting.md => 3-troubleshooting.md} | 37 +++++++------- ...oring-basics.md => 4-monitoring-basics.md} | 0 ...tems.md => 5-monitoring-remote-systems.md} | 0 ...-addons-plugins.md => 6-addons-plugins.md} | 0 ...-icinga-2.md => 7-configuring-icinga-2.md} | 0 6 files changed, 66 insertions(+), 22 deletions(-) rename doc/{7-troubleshooting.md => 3-troubleshooting.md} (99%) rename doc/{3-monitoring-basics.md => 4-monitoring-basics.md} (100%) rename doc/{4-monitoring-remote-systems.md => 5-monitoring-remote-systems.md} (100%) rename doc/{5-addons-plugins.md => 6-addons-plugins.md} (100%) rename doc/{6-configuring-icinga-2.md => 7-configuring-icinga-2.md} (100%) diff --git a/doc/2-getting-started.md b/doc/2-getting-started.md index c938c364d..645378a4e 100644 --- a/doc/2-getting-started.md +++ b/doc/2-getting-started.md @@ -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 + ### Reload on Configuration Changes diff --git a/doc/7-troubleshooting.md b/doc/3-troubleshooting.md similarity index 99% rename from doc/7-troubleshooting.md rename to doc/3-troubleshooting.md index 9a10d2be2..1768150c3 100644 --- a/doc/7-troubleshooting.md +++ b/doc/3-troubleshooting.md @@ -30,7 +30,9 @@ Additionally you can enable the debug log using ## 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. +## Where are the check command definitions +Icinga 2 ships additional [plugin check command definitions](#plugin-check-commands) which are +included using + + include + include + +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. ## 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. -## Where are the check command definitions - -Icinga 2 ships additional [plugin check command definitions](#plugin-check-commands) which are -included using - - include - include - -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. - - ## Cluster Troubleshooting You should configure the [cluster health checks](#cluster-health-check) if you haven't diff --git a/doc/3-monitoring-basics.md b/doc/4-monitoring-basics.md similarity index 100% rename from doc/3-monitoring-basics.md rename to doc/4-monitoring-basics.md diff --git a/doc/4-monitoring-remote-systems.md b/doc/5-monitoring-remote-systems.md similarity index 100% rename from doc/4-monitoring-remote-systems.md rename to doc/5-monitoring-remote-systems.md diff --git a/doc/5-addons-plugins.md b/doc/6-addons-plugins.md similarity index 100% rename from doc/5-addons-plugins.md rename to doc/6-addons-plugins.md diff --git a/doc/6-configuring-icinga-2.md b/doc/7-configuring-icinga-2.md similarity index 100% rename from doc/6-configuring-icinga-2.md rename to doc/7-configuring-icinga-2.md