-# <a id="script-debugger"></a> Script Debugger
+# Script Debugger <a id="script-debugger"></a>
You can run the Icinga 2 daemon with the `-X` (`--script-debugger`)
parameter to enable the script debugger:
# icinga2 daemon -X
-When an exception occurs or the [debugger](18-language-reference.md#breakpoints)
-keyword is encountered in a user script Icinga 2 launches a console that
+When an exception occurs or the [debugger](17-language-reference.md#breakpoints)
+keyword is encountered in a user script, Icinga 2 launches a console that
allows the user to debug the script.
-Here is a list of common error which can be diagnosed with the script debugger:
+You can also attach the script debugger to the [configuration validation](11-cli-commands.md#config-validation):
-* Configuration errors (apply)
-* Errors in user-defined functions
+ # icinga2 daemon -C -X
+
+Here is a list of common errors which can be diagnosed with the script debugger:
+
+* Configuration errors e.g. [apply rules](03-monitoring-basics.md#using-apply)
+* Errors in user-defined [functions](17-language-reference.md#functions)
-## <a id="script-debugger-config-errors"></a> Debugging Configuration Errors
+## Debugging Configuration Errors <a id="script-debugger-config-errors"></a>
-The following example illustrates the problem of a service [apply rule](3-monitoring-basics.md#using-apply-for)
+The following example illustrates the problem of a service [apply rule](03-monitoring-basics.md#using-apply-for)
which expects a dictionary value for `config`, but the host custom attribute only
provides a string value:
Additionally you can view the service object attributes by printing the value of `this`.
-## <a id="script-debugger-breakpoints"></a> Using Breakpoints
+## Using Breakpoints <a id="script-debugger-breakpoints"></a>
In order to halt execution in a script you can use the `debugger` keyword: