Created
June 7, 2022 09:49
-
-
Save Steffen-MLR/bf8952910ca8b6245f4ec25d49b78788 to your computer and use it in GitHub Desktop.
checkmk localcheck for CPU Utilization including VMs for Hyper-V Hosts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get CPU % including Virtual Machines local check | |
$cpucounter = (Get-Counter -Counter "\Prozessorinformationen(_total)\Privilegierte Auslastung").CounterSamples[0] | |
$value = $cpucounter.CookedValue.toString().Replace(',','.') -as [double] | |
$output = "P 'CPU Utilization (with VMs)' All=$value" | |
Write-Host $output "Total CPU (with VMs):" ([math]::Round($value,2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment