diff --git a/doc/200-Icinga-Integration/04-Icinga-Config.md b/doc/200-Icinga-Integration/04-Icinga-Config.md index 3d6a806..407f8fd 100644 --- a/doc/200-Icinga-Integration/04-Icinga-Config.md +++ b/doc/200-Icinga-Integration/04-Icinga-Config.md @@ -1,35 +1,31 @@ # Icinga Config Generator -To make the integration as easy as possible, the Framework is shipping with an Icinga 2 configuration generator. Each Check-Plugin available within the Framework is able to auto-generate a Icinga config which can be copied to your Icinga 2 hosts. +To make the integration as easy as possible, the Framework is shipping with an Icinga 2 configuration generator. Each Check-Plugin available within the Framework is able to auto-generate an Icinga config which can be copied to your Icinga 2 hosts. ## Generating Configuration To automatically generate the Icinga configuration, open a PowerShell terminal and type in ```powershell -icinga +Use-Icinga ``` -to load the Icinga PowerShell Framework. +to load the framework Cmdlets. + +Now use the same commands as for the [Icinga Director Basket](01-Director-Baskets.md) but make sure to specify an `-OutDirectory` together with the `-IcingaConfig` switch. The `-IcingaConfig` switch only changes the generated output file format, not the returned resp. printed string. Thus, using `-IcingaConfig` without an `-OutDirectory` does not have an impact. Afterwards use the command ```powershell -Get-IcingaCheckCommandConfig -IcingaConfig; +Get-IcingaCheckCommandConfig -OutDirectory 'C:\Users\myuser\Documents\' -IcingaConfig ``` -to automatically generate the configuration for all found Check-Commands. +to automatically generate the configuration for all found Check-Commands in the given directory. If you wish to specify specific commands only, you can filter them as well: ```powershell -Get-IcingaCheckCommandConfig -CheckName Invoke-IcingaCheckBiosSerial, Invoke-IcingaCheckCPU -IcingaConfig; -``` - -Last but not least you can output the Icinga configuration directly into a file. To do this, simply use the `OutDirectory` argument. You only require to specify a directory here, as the file including a timestamp is generated by the Cmdlet itself - -```powershell -Get-IcingaCheckCommandConfig -OutDirectory 'C:\Users\myuser\Documents\' +Get-IcingaCheckCommandConfig -CheckName Invoke-IcingaCheckBiosSerial, Invoke-IcingaCheckCPU -OutDirectory 'C:\Users\myuser\Documents\' -IcingaConfig ``` Once the file is exported, you can copy the `.conf` files onto your Icinga 2 hosts to use them. diff --git a/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 b/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 index f65f695..8964d8d 100644 --- a/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 +++ b/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 @@ -54,7 +54,8 @@ .PARAMETER IcingaConfig Will switch the configuration generator to write plain Icinga 2 `.conf` - files instead of Icinga Director Basket `.json` files + files instead of Icinga Director Basket `.json` files. + Does only affect the written files, not the Cmdlet's String output. .INPUTS System.Array