We are currently testing Icinga for Windows - most of the checks are working fine, but since we installed a JEA Profile, the "Invoke-IcingaCheckDiskHealth is in an unknown state with the following error message:
[UNKNOWN] Icinga Exception: Error while executing plugin in JEA context
Cannot convert value "SAS" to type "System.Int32". Error: "Input string was not in a correct format."
When using the PS command in the JEA context on the machine itself, we get the following error:
PS>Invoke-IcingaCheckDiskHealth
Cannot convert value "SAS" to type "System.Int32". Error: "Input string was not in a correct format."
At C:\Program
Files\WindowsPowerShell\Modules\icinga-powershell-plugins\compiled\icinga-powershell-plugins.ifw_compilation.psm1:6389
char:9
+ $DiskInfo.Add(
+ ~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastFromStringToInteger
Cannot convert value "UnSpecified" to type "System.Int32". Error: "Input string was not in a correct format."
At C:\Program
Files\WindowsPowerShell\Modules\icinga-powershell-plugins\compiled\icinga-powershell-plugins.ifw_compilation.psm1:6450
char:9
+ $DiskInfo.Add(
+ ~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastFromStringToInteger
[OK] Physical Disk Package: 2 Ok
| '_total::ifw_diskhealth::avgdiskqueuelength'=0%;;;0;100 '_total::ifw_diskhealth::diskreadbytessec'=0B;; '_total::ifw_d
iskhealth::avgdiskreadsec'=0s;; '_total::ifw_diskhealth::diskreadssec'=0;; '_total::ifw_diskhealth::avgdiskwritesec'=0s;
; '_total::ifw_diskhealth::diskwritebytessec'=0B;; '_total::ifw_diskhealth::diskwritessec'=0;; '_total::ifw_diskhealth::
avgdisktransfersec'=0s;; '_total::ifw_diskhealth::currentdiskqueuelength'=0;; '0::ifw_diskhealth::diskreadbytessec'=0B;;
'0::ifw_diskhealth::diskwritebytessec'=0B;; '0::ifw_diskhealth::avgdiskqueuelength'=0%;;;0;100 '0::ifw_diskhealth::avgd
iskreadsec'=0s;; '0::ifw_diskhealth::diskreadssec'=0;; '0::ifw_diskhealth::currentdiskqueuelength'=0;; '0::ifw_diskhealt
h::diskwritessec'=0;; '0::ifw_diskhealth::avgdisktransfersec'=0s;; '0::ifw_diskhealth::avgdiskwritesec'=0s;;
We tested this on a Windows Server 2012 R2 VM as well as on a Windows Server 2019 physical host. The message on the host looks the same but instead of “SAS” it says “RAID” - so it looks like there is some parsing error.
The command worked before we installed JEA. Most of the other commands also still work. An exception is for example the Invoke-IcingaCheckHyperVSnapshot command, which also did not work before due to permission issues (JEA being the solution to this) but it actually fails with the exact same error, i.e.
[UNKNOWN] Icinga Exception: Error while executing plugin in JEA context
Cannot convert value "RAID" to type "System.Int32". Error: "Input string was not in a correct format."
I tried looking for similar issues and the only similar issue I found is the following:
However, this seems to have been fixed in the meantime so I am not sure what’s causing this or how we can fix this.