Closed K0nne closed 1 year ago
This is the plugin execution:
icinga {Invoke-IcingaCheckHyperVSnapshot -CreationTimeCritical 1209600s -TotalSnapshotSizeWarning 30% -TotalSnapshotSizeCritical 40% -Verbosity 2 -AvoidEmptyCheck}
Important finding: The error appears only if the arguments -TotalSnapshotSizeWarning or -TotalSnapshotSizeCritical are used. Otherwise everything works fine.
with TotalSnapshotSizeWarning/Critical:
PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework> icinga {Invoke-IcingaCheckHyperVSnapshot -TotalSnapshotSizeWarning 30% -TotalSnapshotSizeCritical 40%}
Exception calling "WarnOutOfRange" with "1" argument(s): "Cannot convert value "B" to type "System.Decimal". Error: "Input string was not in a correct format.""
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-hyperv\compiled\icinga-powershell-hyperv.ifw_compilation.psm1:623 char:13
+ $SnapshotMainCheck.AddCheck(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ScriptMethodRuntimeException
[OK] VM Snapshots: 5 Ok
without on the same machine:
PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework> icinga {Invoke-IcingaCheckHyperVSnapshot}
[OK] VM Snapshots: 5 Ok
Could you please test the linked PR? This should resolve the problem.
With the PR the error message differs slightly, but its still the same. Do I have to change something within the framework?
Exception calling "WarnOutOfRange" with "1" argument(s): "Cannot convert value "B" to type "System.Decimal". Error: "Input string was not in a correct format.""
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-hyperv\compiled\icinga-powershell-hyperv.ifw_compilation.psm1:624 char:17
+ $SnapshotMainCheck.AddCheck(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ScriptMethodRuntimeException
[OK] VM Snapshots: 5 Ok
//edit: Framework 1.11.0 changed nothing.
Did you run the command within an Icinga shell and the arguments -DeveloperMode
and -RebuildCache
?
icinga { Invoke-IcingaCheckHyperVSnapshot -TotalSnapshotSizeWarning 30% -TotalSnapshotSizeCritical 40% } -DeveloperMode -RebuildCache
Unfortunately I did everything right.
sniplet from overview:
framework 1.11.0
hyperv 1.3.0
check execution:
PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework> icinga {Invoke-IcingaCheckHyperVSnapshot -TotalSnapshotSizeWarning 30% -TotalSnapshotSizeCritical 40%} -DeveloperMode -RebuildCache
Exception calling "WarnOutOfRange" with "1" argument(s): "Cannot convert value "B" to type "System.Decimal". Error: "Input string was not in a correct format.""
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-hyperv\compiled\icinga-powershell-hyperv.ifw_compilation.psm1:624 char:17
+ $SnapshotMainCheck.AddCheck(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ScriptMethodRuntimeException
[OK] VM Snapshots: 5 Ok
The affected snapshot is from a vm without scsi controller and disk:
The updated PR fixes the problem 👍
Hello!
On some of our HyperV hosts the check
Invoke-IcingaCheckHyperVSnapshot
has problems while parsing the results. Those machines seems to behave different than the majority. It happens in our qs and prod stage.Output:
Line 623: