From 14938778dcec4e9c0d68d2d177bc108ef1aa0a01 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 11 Feb 2015 10:20:36 +0100 Subject: [PATCH] Add documentation for the 'icinga2 console' command fixes #8386 --- doc/7-cli-commands.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/7-cli-commands.md b/doc/7-cli-commands.md index 32430e953..6bb9518c6 100644 --- a/doc/7-cli-commands.md +++ b/doc/7-cli-commands.md @@ -18,6 +18,7 @@ options. icinga2 [] Supported commands: + * console (Icinga console) * daemon (starts Icinga 2) * feature disable (disables specified feature) * feature enable (enables specified feature) @@ -127,6 +128,25 @@ Using the `--include` command-line option additional search directories can be added. +### CLI command: Console + +The CLI command `console` can be used to evaluate Icinga config expressions, e.g. to test +`assign where` rules. + + $ icinga2 console + Icinga (version: v2.2.0-435-gc95d2f1) + <1> => function test(name) { + <1> .. log("Hello " + name) + <1> .. } + null + <2> => test("World") + information/config: Hello World + null + +The `console` command does not support line-editing or a command history. However you can +use the `rlwrap` program if you require those features: + + $ rlwrap icinga2 console ### CLI command: Daemon