You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #633 from Al2Klimov/ifw_api_arguments
Get-IcingaCheckCommandConfig: provide vars.ifw_api_arguments in each command
Adds support for Icinga 2.14.0 native Icinga for Windows API communication
Copy file name to clipboardExpand all lines: doc/100-General/10-Changelog.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
25
25
*[#544](https://github.com/Icinga/icinga-powershell-framework/issues/544) Adds support to configure the Icinga Director JSON string for registering hosts via self-service API
26
26
*[#619](https://github.com/Icinga/icinga-powershell-framework/pull/619) Adds feature to securely read enum provider values with new function `Get-IcingaProviderEnumData`
27
27
*[#623](https://github.com/Icinga/icinga-powershell-framework/issues/623) Adds support to provide the Icinga service user written as `user@domain`
28
+
*[#633](https://github.com/Icinga/icinga-powershell-framework/pull/633) Adds support for Icinga 2.14.0 native Icinga for Windows API communication
28
29
*[#635](https://github.com/Icinga/icinga-powershell-framework/pull/635) Adds support for `Write-IcingaAgentApiConfig` function to configure the Icinga Agent TLS cipher list setting by new argument `-CipherList`
29
30
*[#640](https://github.com/Icinga/icinga-powershell-framework/issues/640) Adds support to set the flag `-NoSSLValidation` for Cmdlets `icinga` and `Install-Icinga`, to ignore errors on self-signed certificates within the environment
30
31
*[#643](https://github.com/Icinga/icinga-powershell-framework/pull/643) Adds support for `-RebuildCache` flag on `icinga` cmd to rebuild component cache as well
In case a check could not be executed by using this experimental feature, either because of timeouts or other issues, they are added with `EventId 1553` inside the EventLog for `Icinga for Windows`. A description on why the check could not be executed is added within the event output.
109
+
110
+
## Icinga Communication to API
111
+
112
+
With Icinga 2.14.0 and later, you can enable the Icinga Agent to natively communicate with the Icinga for Windows API, allowing checks being executed without having to start a PowerShell.
113
+
114
+
This is a huge performance boost and should be **mandatory** on all Windows machines.
115
+
116
+
To enable this feature, ensure you have **all** plugins updated by importing the latest version of the Icinga Director baskets or use the latest `.conf` files for Icinga provided by each plugin repository.
117
+
118
+
Once your configuration is updated, you have to enable this feature.
119
+
120
+
### Requirements
121
+
122
+
* Icinga for Windows v1.11.0 or later
123
+
* Icinga Director v.1.11.0 or later
124
+
* Icinga 2.14.0 or later (at least master)
125
+
126
+
### Icinga Director
127
+
128
+
Navigate to `Icinga Director` and click on `Commands` -> `Commands` and search for `PowerShell Base`.
129
+
130
+
Click on this CheckCommand and under the `Import` section add the check `ifw-api`.
131
+
132
+
If the CheckCommand `ifw-api` does not exist, click on the `Icinga Director` on the menu and then `Icinga Infrastructure` -> `Kickstart Wizard` and then `Run Import` to import the latest CheckCommands shipped with Icinga. Please ensure you have updated to Icinga 2.14.0 or later on your master, otherwise this command is not available.
133
+
134
+
You can verify that the `ifw-api` CheckCommand was installed by clicking on `Icinga Director` on the menu and then `Activity Log`. You should now see an entry like this:
135
+
136
+
```
137
+
[username] create command "ifw-api"
138
+
```
139
+
140
+
Now proceed with the previous step, to update the `PowerShell Base` to import the `ifw-api` CheckCommand.
141
+
142
+

143
+
144
+
Once you deploy the configuration, Icinga will communicate directly with the Icinga for Windows API, as long as on the Agent side 2.14.0 or later is installed. In case you are running an older version, Icinga will fall back to the previous handling and check the system either with or without API, depending on the configuration.
145
+
146
+
### Icinga Plain Configuration
147
+
148
+
Ensure you have updated to the latest version of Icinga and all `.conf` files for the Icinga for Windows CheckCommands are updated to the latest version.
149
+
150
+
Afterwards navigate to the file containing your `PowerShell Base` CheckCommand and add the following line
151
+
152
+
```
153
+
import "ifw-api"
154
+
```
155
+
156
+
directly below `import "plugin-check-command"`
157
+
158
+
**Note:** For backwards compatibility, if you didn't manage to update your entire environment (Master, Satellite and Agents) to v2.14.0 or later, you will have to deploy an additional check command on your global zones. This global configuration will create a dummy check-command `ifw-api`, ensuring the older Agents and Satellites older than 2.14.0 will not fail with a configuration error. Please read the section **`Global Zone Config`** for more details below.
159
+
160
+
**Example:**
161
+
162
+
```
163
+
object CheckCommand "PowerShell Base" {
164
+
import "plugin-check-command"
165
+
import "ifw-api"
166
+
167
+
...
168
+
```
169
+
170
+
Once modified, save the file and test your Icinga configuration with
171
+
172
+
```
173
+
icinga2 daemon -C
174
+
```
175
+
176
+
If the configuration is valid, restart your Icinga service
177
+
178
+
```
179
+
systemctl restart icinga2
180
+
```
181
+
182
+
**Global Zone Config:**
183
+
184
+
<spanstyle="color:red">**This only applies in multi-version environments NOT using Icinga Director and not fully upgraded to v2.14.0**!</span>
185
+
186
+
Please validate your Icinga zones.conf for your global zone in (`/etc/icinga2/zones.conf`). There should be a zone configured as `global = true`, like `global-templates`. Please **DO NOT USE**`director-global`!
187
+
188
+
In case your global zone is using the default `global-templates`, create a new file at the location
189
+
190
+
`/etc/icinga2/zones.d/global-templates`
191
+
192
+
with the name `ifw-fallback.conf` and add the following content:
Full path example: `/etc/icinga2/zones.d/global-templates/ifw-fallback.conf`
203
+
204
+
Now validate your configuration and restart your master.
205
+
206
+
```
207
+
icinga2 daemon -C
208
+
```
209
+
210
+
If the configuration is valid, restart your Icinga service
211
+
212
+
```
213
+
systemctl restart icinga2
214
+
```
215
+
216
+
Icinga will now communicate directly with the Icinga for Windows API, as long as on the Agent side 2.14.0 or later is installed. In case you are running an older version, Icinga will fall back to the previous handling and check the system either with or without API, depending on the configuration.
Copy file name to clipboardExpand all lines: doc/300-Knowledge-Base.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,3 +22,4 @@ For this reason you will find a list of Icinga knowledge base entries below. Ent
22
22
|[IWKB000012](knowledgebase/IWKB000012.md)| Icinga for Windows cannot be used with Microsoft Defender: `Windows Defender Antivirus has detected malware or other potentially unwanted software`|
23
23
|[IWKB000013](knowledgebase/IWKB000013.md)| The local Icinga Agent certificate seems not to be signed by our Icinga CA yet. Using this certificate for the REST-Api as example might not work yet. Please check the state of the certificate and complete the signing process if required |
24
24
|[IWKB000014](knowledgebase/IWKB000014.md)| Installing or Updating Icinga for Windows causes error messages regarding `framework_cache.psm1` errors |
25
+
|[IWKB000015](knowledgebase/IWKB000015.md)| Got JSON, but not an object, from IfW API on host 'localhost' port '5668': "Exception while calling \\"Fill\\" with 1 arguments: \\"Invalid syntax near \\"`<Argument>:`\\".\\"" |
Got JSON, but not an object, from IfW API on host 'localhost' port '5668': "Exception while calling \\"Fill\\" with 1 argument: \\"Invalid syntax near \\"`<Argument>:`\\".\\""
6
+
7
+
## Example Exception
8
+
9
+
Got JSON, but not an object, from IfW API on host 'localhost' port '5668': "Exception while calling \\"Fill\\" with 1 arguments: \\"Invalid syntax near \\"SQLServer:`\\".\\""
10
+
11
+
## Reason
12
+
13
+
This issue is caused by using the native communication over the Icinga for Windows API with Icinga 2.14.0 or later, while using values for arguments manually escaped by the user with `''`:
Remove all added `' '` from your Icinga configuration, regardless if you are using the Icinga Director or plain Icinga configuration files. Latest Icinga for Windows versions, will escape and build strings properly anyway, even without the new Icinga communication feature.
20
+
21
+
Once the `' '` are removed from your configuration, deploy your configuration and the check will run just fine.
0 commit comments