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

Feature: Please add a possibility to mitigate the checkresult from "unknown" to "ok" if no checks could be added to a package - v2 #42

Closed K0nne closed 2 years ago

K0nne commented 2 years ago

Expected Behavior

I whould love to have a way to mitigate the checkresult to "OK" if a check can not be added to the package.

Current Behavior

I have a few hyper-v checks, which sometimes go "unknown", because the things to check are currently not available.

The following checks are affected:

Invoke-IcingaCheckHyperVSnapshot Invoke-IcingaCheckHyperVVirtualSwitches

[UNKNOWN] VM Snapshots: No checks added to this package

[UNKNOWN] Virtual Switches: No checks added to this package

Possible Solution

Add a parameter to toggle the behaviour between OK and UNKNOWN.

Context

This ist a continuation of https://github.com/Icinga/icinga-powershell-plugins/issues/217, because I was missinng 2 checks.

K0nne commented 2 years ago

Hello @LordHepipud Could you please provide a PR?

LordHepipud commented 2 years ago

Hello, can you please test the linked PR @K0nne ?

K0nne commented 2 years ago

Thanks for the PR. I will report back on tuesday.

K0nne commented 2 years ago

Hello!

I tested the PR. It fixed the problem only for the overcommitment check.

before: 02-11-_2021_09-22-59

after: 02-11-_2021_09-24-23

From what I see, the overcommitment check has 3 sub sections, from which were 2 ok before.
The other 2 checks only have 1 sub section, which is still unknown. maybe there's a connection.

LordHepipud commented 2 years ago

Have you used the argument -AvoidEmptyCheck for snapshots and switches? I would not want to add this as default behavior, as it might be a real problem on certain machines, unlike the overcommitment check.

K0nne commented 2 years ago

I forgot to update the command bundle. Now the fix ist working as intended :)

LordHepipud commented 2 years ago

How are the tests going? Can we merge the PR or are any other issues remaining? I assume #48 is working as expected now?

K0nne commented 2 years ago

The checks are working fine now. Thanks a lot! You can merge it.

48 is working fine now.

We had to add the Monitoring-User to "Hyper-V Administrators". After a restart of the "Icinga2" Service the checks are working as expected.

Maybe #40 whould be nice :)