]> granicus.if.org Git - icinga2/blobdiff - doc/11-cli-commands.md
Merge pull request #7445 from Icinga/bugfix/ddos-reconnect-7444
[icinga2] / doc / 11-cli-commands.md
index d288c64f502e1835d3655a17a5a5580665b3e5c4..7eac4247c344298a7b5995354f46d7ca507d5691 100644 (file)
@@ -13,17 +13,18 @@ options.
 
 ```
 # icinga2
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 <command> [<arguments>]
 
 Supported commands:
   * api setup (setup for API)
-  * api user (API user creation helper)
   * ca list (lists all certificate signing requests)
+  * ca restore (restores a removed certificate request)
+  * ca remove (removes an outstanding certificate request)  
   * ca sign (signs an outstanding certificate request)
-  * console (Icinga console)
+  * console (Icinga debug console)
   * daemon (starts Icinga 2)
   * feature disable (disables specified feature)
   * feature enable (enables specified feature)
@@ -37,7 +38,6 @@ Supported commands:
   * pki save-cert (saves another Icinga 2 instance's certificate)
   * pki sign-csr (signs a CSR)
   * pki ticket (generates a ticket)
-  * troubleshoot (collect information for troubleshooting)
   * variable get (gets a variable)
   * variable list (lists all variables)
 
@@ -56,7 +56,7 @@ Global options:
   -X [ --script-debugger ]  whether to enable the script debugger
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 
@@ -136,20 +136,19 @@ added.
 
 ## CLI command: Api <a id="cli-command-api"></a>
 
-Provides the helper functions `api setup` and `api user`. The first to enable the REST API, the second to create
-ApiUser objects with hashed password strings.
-More details in the [Icinga 2 API](12-icinga2-api.md#icinga2-api-setup) chapter.
+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>
 
 ```
-# icinga2 api --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+# icinga2 api setup --help
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
-  icinga2 <command> [<arguments>]
+  icinga2 api setup [<arguments>]
 
-Supported commands:
-  * api setup (setup for API)
-  * api user (API user creation helper)
+Setup for Icinga 2 API.
 
 Global options:
   -h [ --help ]             show this help message
@@ -157,16 +156,19 @@ Global options:
   --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:
+  --cn arg                  The certificate's common name
+
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Get support: <https://icinga.com/support/>
+Documentation: <https://icinga.com/docs/>
+Icinga home page: <https://icinga.com/>
 ```
 
 ## CLI command: Ca <a id="cli-command-ca"></a>
@@ -177,7 +179,7 @@ chapter. This CLI command is available since v2.8.
 
 ```
 # icinga2 ca --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 <command> [<arguments>]
@@ -185,6 +187,8 @@ Usage:
 Supported commands:
   * ca list (lists all certificate signing requests)
   * ca sign (signs an outstanding certificate request)
+  * ca restore (restores a removed certificate request)
+  * ca remove (removes an outstanding certificate request)
 
 Global options:
   -h [ --help ]             show this help message
@@ -201,7 +205,44 @@ Global options:
   -X [ --script-debugger ]  whether to enable the script debugger
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
+```
+
+
+### 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.
+  --removed                 List all removed CSRs (for use with 'ca restore')
+  --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/>
 ```
 
 ## CLI command: Console <a id="cli-command-console"></a>
@@ -211,7 +252,7 @@ e.g. to test [functions](17-language-reference.md#functions) in your local sandb
 
 ```
 $ icinga2 console
-Icinga 2 (version: v2.8.0)
+Icinga 2 (version: v2.11.0)
 <1> => function test(name) {
 <1> ..   log("Hello " + name)
 <1> .. }
@@ -226,7 +267,7 @@ Further usage examples can be found in the [library reference](18-library-refere
 
 ```
 # icinga2 console --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 console [<arguments>]
@@ -255,7 +296,7 @@ Command options:
   --sandbox                 enable sandbox mode
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 
@@ -273,7 +314,7 @@ are required for executing config expressions and auto-completion.
 
 > **Note**
 >
-> The debug console does not currently support SSL certificate verification.
+> The debug console does not currently support TLS certificate verification.
 >
 > Runtime modifications are not validated and might cause the Icinga 2
 > daemon to crash or behave in an unexpected way. Use these runtime changes
@@ -294,19 +335,19 @@ Here's an example:
 
 ```
 $ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/'
-Icinga 2 (version: v2.8.0)
+Icinga 2 (version: v2.11.0)
 <1> =>
 ```
 
 Once connected you can inspect variables and execute other expressions by entering them at the prompt:
 
 ```
-<1> => var h = get_host("icinga2-client1.localdomain")
+<1> => var h = get_host("icinga2-agent1.localdomain")
 null
 <2> => h.last_check_result
 {
         active = true
-        check_source = "icinga2-client1.localdomain"
+        check_source = "icinga2-agent1.localdomain"
         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
@@ -341,10 +382,10 @@ 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.
 
-Here's an example that retrieves the command that was used by Icinga to check the `icinga2-client1.localdomain` host:
+Here's an example that retrieves the command that was used by Icinga to check the `icinga2-agent1.localdomain` host:
 
 ```
-$ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' --eval 'get_host("icinga2-client1.localdomain").last_check_result.command' | python -m json.tool
+$ 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
 [
     "/usr/local/sbin/check_ping",
     "-H",
@@ -363,7 +404,7 @@ Furthermore it allows to run the [configuration validation](11-cli-commands.md#c
 
 ```
 # icinga2 daemon --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 daemon [<arguments>]
@@ -389,11 +430,13 @@ Command options:
   -z [ --no-config ]        start without a configuration file
   -C [ --validate ]         exit after validating the configuration
   -e [ --errorlog ] arg     log fatal errors to the specified log file (only
-                            works in combination with --daemonize)
+                            works in combination with --daemonize or
+                            --close-stdio)
   -d [ --daemonize ]        detach from the controlling terminal
+  --close-stdio             do not log to stdout (or stderr) after startup
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 ### Config Files <a id="cli-command-daemon-config-files"></a>
@@ -403,7 +446,7 @@ Configuration files are processed in the order they're specified on the command-
 
 When no configuration file is specified and the `--no-config` is not used
 Icinga 2 automatically falls back to using the configuration file
-`SysconfDir + "/icinga2/icinga2.conf"` (where SysconfDir is usually `/etc`).
+`ConfigDir + "/icinga2.conf"` (where ConfigDir is usually `/etc/icinga2`).
 
 ### Validation <a id="cli-command-daemon-validation"></a>
 
@@ -442,7 +485,7 @@ nodes in a [distributed monitoring](06-distributed-monitoring.md#distributed-mon
 
 ```
 # icinga2 node --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 <command> [<arguments>]
@@ -466,7 +509,7 @@ Global options:
   -X [ --script-debugger ]  whether to enable the script debugger
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 ## CLI command: Object <a id="cli-command-object"></a>
@@ -485,7 +528,7 @@ More information can be found in the [troubleshooting](15-troubleshooting.md#tro
 
 ```
 # icinga2 object --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.7.1-196-g23e8a6253; debug)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 <command> [<arguments>]
@@ -508,7 +551,7 @@ Global options:
   -X [ --script-debugger ]  whether to enable the script debugger
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 ## CLI command: Pki <a id="cli-command-pki"></a>
@@ -527,7 +570,7 @@ You will need them in the [distributed monitoring chapter](06-distributed-monito
 
 ```
 # icinga2 pki --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 <command> [<arguments>]
@@ -555,51 +598,7 @@ Global options:
   -X [ --script-debugger ]  whether to enable the script debugger
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
-```
-
-## CLI command: Troubleshoot <a id="cli-command-troubleshoot"></a>
-
-Collects basic information like version, paths, log files and crash reports for troubleshooting
-purposes and prints them to a file or the console. See [troubleshooting](15-troubleshooting.md#troubleshooting-information-required).
-
-Its output defaults to a file named `troubleshooting-[TIMESTAMP].log` so it won't overwrite older troubleshooting files.
-
-Keep in mind that this tool can not collect information from other icinga2 nodes, you will have to run it on
-each of one of you instances.
-This is only a tool to collect information to help others help you, it will not attempt to fix anything.
-
-```
-# icinga2 troubleshoot --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0)
-
-Usage:
-  icinga2 troubleshoot [<arguments>]
-
-Collect logs and other relevant information for troubleshooting purposes.
-
-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 [ --console ]          print to console instead of file
-  -o [ --output ] arg       path to output file
-  --include-objects         Print the whole objectfile (like `object list`)
-  --include-vars            Print all Variables (like `variable list`)
-
-Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 ## CLI command: Variable <a id="cli-command-variable"></a>
@@ -608,7 +607,7 @@ Lists all configured variables (constants) in a similar fashion like [object lis
 
 ```
 # icinga2 variable --help
-icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.0; debug)
+icinga2 - The Icinga 2 network monitoring daemon (version: v2.11.0)
 
 Usage:
   icinga2 <command> [<arguments>]
@@ -632,7 +631,7 @@ Global options:
   -X [ --script-debugger ]  whether to enable the script debugger
 
 Report bugs at <https://github.com/Icinga/icinga2>
-Icinga home page: <https://www.icinga.com/>
+Icinga home page: <https://icinga.com/>
 ```
 
 ## Enabling/Disabling Features <a id="enable-features"></a>
@@ -731,4 +730,3 @@ safely reload the Icinga 2 daemon.
 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.
-