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 #701 from Icinga:feature/add_icinga_for_windows_test_command
Feature: Adds new command to test the functionality of Icinga for Windows
Adds new command `Test-IcingaForWindows`to check the current environment health by also improving internal handlings on how service information are fetched, preventing a lock on those
Copy file name to clipboardExpand all lines: doc/100-General/10-Changelog.md
+1
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
37
37
*[#694](https://github.com/Icinga/icinga-powershell-framework/pull/694) Adds support for check objects not being added to summary header
38
38
*[#695](https://github.com/Icinga/icinga-powershell-framework/pull/695) Adds security hardening to JEA profiles by always prohibit certain cmdlets
39
39
*[#700](https://github.com/Icinga/icinga-powershell-framework/pull/700) Adds feature to support using pipes and multi lines for plugin documentation
40
+
*[#701](https://github.com/Icinga/icinga-powershell-framework/pull/701) Adds new command `Test-IcingaForWindows`to check the current environment health by also improving internal handlings on how service information are fetched, preventing a lock on those
Copy file name to clipboardExpand all lines: doc/300-Knowledge-Base.md
+1
Original file line number
Diff line number
Diff line change
@@ -25,3 +25,4 @@ For this reason you will find a list of Icinga knowledge base entries below. Ent
25
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>:`\\".\\"" |
26
26
|[IWKB000016](knowledgebase/IWKB000016.md)| Checks using Performance Counter fail with various messages like `Exception of type 'System.OutOfMemoryException' was thrown` or `Icinga Invalid Configuration Error was thrown: PerfCounterCategoryMissing: Category "Memory" not found`|
27
27
|[IWKB000017](knowledgebase/IWKB000017.md)| Icinga throws exception during plugin execution after uninstalling SCOM or other vendor software using PowerShell modules |
28
+
|[IWKB000018](knowledgebase/IWKB000018.md)| Icinga for Windows services throws event id 1500 with error `Exception while calling AuthenticateAsServer: The credentials supplied to the package were not recognized`|
Icinga for Windows services throws event id 1500 with error `Exception while calling AuthenticateAsServer: The credentials supplied to the package were not recognized`
6
+
7
+
## Example Exception
8
+
9
+
Icinga for Windows throws an error with event id 1500:
10
+
11
+
```
12
+
Failed to securely establish a communication between this server and the client
13
+
14
+
A client connection could not be established to this server. This issue is mostly caused by using Self-Signed/Icinga 2 Agent certificates for the server and the client not trusting the certificate. To resolve this issue, either use trusted certificates signed by your trusted CA or setup the client to accept untrusted certificates
15
+
16
+
Icinga for Windows exception report:
17
+
18
+
Exception Message:
19
+
Exception calling "AuthenticateAsServer" with "4" argument(s): "The credentials supplied to the package were not recognized"
20
+
21
+
Command Origin:
22
+
Internal
23
+
24
+
...
25
+
```
26
+
27
+
## Reason
28
+
29
+
This message happens in case the user assigned to run the Icinga for Windows has no sufficient permissions to access the `icingaforwindows.pfx` certificate file or has no permissions to read the private key from the certificate file.
30
+
31
+
## Solution
32
+
33
+
To resolve this issue, you will either have to use [JEA-Profiles](../130-JEA/01-JEA-Profiles.md) or use a different user having enough permissions to access private key to the file. In general, only `LocalSystem` or `Administrators` have access to this key, which is why we highly recommend the use of JEA.
Write-IcingaConsoleError'The Icinga Agent API directory is not present on this system. Please check if the Icinga Agent is installed';
36
36
return;
37
37
}
38
38
39
-
if ($IcingaService.configuration.Status.raw-eq4-And$Force-eq$FALSE) {
39
+
if ($IcingaService.Status-eq'Running'-And$Force-eq$FALSE) {
40
40
Write-IcingaConsoleError'The API directory can not be deleted while the Icinga Agent is running. Use the "-Force" argument to stop the service, flush the directory and restart the service again.';
41
41
return;
42
42
}
43
43
44
-
if ($IcingaService.configuration.Status.raw-eq4) {
44
+
if ($IcingaService.Status-eq'Running') {
45
45
Stop-IcingaService icinga2;
46
46
Start-Sleep-Seconds 1;
47
47
}
@@ -50,7 +50,7 @@ function Clear-IcingaAgentApiDirectory()
Copy file name to clipboardExpand all lines: lib/core/icingaagent/repair/Repair-IcingaService.psm1
+5-3
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ function Repair-IcingaService()
21
21
[string]$RootFolder=''
22
22
);
23
23
24
-
if ($null-ne (Get-Service'icinga2'-ErrorAction SilentlyContinue)) {
24
+
if ($Global:Icinga.Protected.Environment.'Icinga Service'.Present) {
25
25
Write-IcingaConsoleNotice-Message 'The Icinga Agent service is already installed. If you received the error "The specified service has been marked for deletion", please have a look at https://icinga.com/docs/icinga-for-windows/latest/doc/knowledgebase/IWKB000011/'
26
26
return;
27
27
}
@@ -64,12 +64,14 @@ function Repair-IcingaService()
64
64
65
65
if ($IcingaService.ExitCode-ne0) {
66
66
Write-IcingaConsoleError`
67
-
-Message 'Failed to install Icinga Agent service: {0}{1}'`
0 commit comments