Icinga / icinga-powershell-hyperv

A collection of Hyper-V plugins for the Icinga Powershell Framework
GNU General Public License v2.0
5 stars 0 forks source link

Invoke-IcingaCheckHyperVVMHealth - the check counts the output section "Active VMs" itself as a VM to the number of "Virtual Computers" #39

Closed K0nne closed 2 years ago

K0nne commented 3 years ago

Hello,

I was looking at the plugin output of Invoke-IcingaCheckHyperVVMHealth and I was confused when the check counted one additional VM, which is not there.

In my case there are 18 active and 2 disabled vms on the hyperv host. I manipulated "Active VMs" to be critical to demonstrate it. "Virtual Computers" refers to "Active VMs" as a critical VM.

PS C:\WINDOWS\system32> icinga { invoke-icingacheckhypervvmhealth -verbosity 3 -activevms -criticalactivevms 19:}
[CRITICAL] Virtual Computers: 1 Critical 18 Ok [CRITICAL] Active VMs (18) (All must be [OK])
\_ [CRITICAL] Active VMs: 18 is lower than threshold 19
LordHepipud commented 2 years ago

Sorry for the late response. I just tested this issue and you are right, the line [OK] Virtual Computers: 7 Ok (All must be [OK]) is counting in the Active VMs check package.

This behavior is fine, as the Virtual Computers package is referring to the amount of check packages added to this package, and not the amount of virtual machines.

The summary header was introduced with Icinga for Windows v1.5.0, to give a quick overview of problems within the first line of the check.

Therefor this is not a bug, but intended behavior.

orbison commented 2 years ago

May I suggest changing the wording of Icinga Agent plugin output, or at least adding some punctuation? It would help at least us, boomers, who are used to reading full sentences ;-)

[CRITICAL] Virtual Computers: 1 Critical 18 Ok [CRITICAL] Active VMs (18) (All must be [OK])

Cf.

[CRITICAL] Virtual Computers: 1 Critical, 18 OK. [CRITICAL] Number of active VMs (18). (All must be [OK].)

LordHepipud commented 2 years ago

Thank you for the input. Modifying just the summary header is not possible, at it is entirely auto generated based on the added packages of the check plugin itself.

If we take aboves exmaple, the entire output would have to change for this:

PS C:\WINDOWS\system32> icinga { invoke-icingacheckhypervvmhealth -verbosity 3 -activevms -criticalactivevms 19:}
[CRITICAL] Virtual Computers: 1 Critical 18 Ok [CRITICAL] Number of active VMs (18) (All must be [OK])
\_ [CRITICAL] Number of active VMs: 18 is lower than threshold 19

I'm not sure if it is beneficial in this matter. Anyone else having feedback regarding this?

K0nne commented 2 years ago

Therefor this is not a bug, but intended behavior.

I am fine with this. You are free to close it.