Got a Hyper-V cluster that needs monitoring. Problem is that when a guest is moved to another host, it shows as failed on one node, and does not show up on the other node before next autodiscover
Monitor Hyper-V cluster
Votes:
0
Best Answer
Votes:
0
PRTG now supports monitoring of Virtual Machines which were moved by Live Migration. Use the Hyper-V Virtual Machine Sensor with the System Center Virtual Machine Manager (SCVMM) as parent device and the monitoring will continue after the VM changed the physical host.
Do also have a look at our manual for further information.
19 Replies
Votes:
0
vMotion on HyperV is not yet sported by the sensors, sorry.
Votes:
0
We have it on our wishlist, but no target date has been set yet.
Votes:
0
This would be a huge benefit to our company if this worked properly with failover clustering...
I understand no target date has been set, however, is there anyway we can get any more details on what are the chances of this being implemented in the next 3 - 6 Months?
Votes:
0
Not very likely, but I also can't say this with certainty. Sorry.
Votes:
0
Just to keep the interest going... I''m running into the same "problem".
Any news on a target date?
Votes:
0
Count me as another with this issue.
Votes:
0
PRTG now supports monitoring of Virtual Machines which were moved by Live Migration. Use the Hyper-V Virtual Machine Sensor with the System Center Virtual Machine Manager (SCVMM) as parent device and the monitoring will continue after the VM changed the physical host.
Do also have a look at our manual for further information.
Votes:
0
And if you have two hyper-v servers in a cluster without SCVMM? I would say that is the most common situation in smaller companies.
Votes:
0
I am afraid that this is not possible at the moment, sorry.
Votes:
0
I'm running into a similar situation. We have a 3 node hyper-v cluster with on SCVMM. I just live migrated a guest server and the sensors seemed to work. However, when I look into the CPU usage... the numbers seemed to be off, like it is reporting from another server. How do I properly monitor guest VMs without SCVMM?
Votes:
0
I also have Hyper-V cluster without SCVMM and we are not planning to implement it. I am wondering if anyone had implement creative hack to follow health and availability.
I guess we could have a sensor that claim everything's fine if one of two other sensors is up. Can we monitor sensors in PRTG?
Votes:
0
Hello Dan,
I'm sorry, there is no native sensor and there are no known custom scripts yet.
Best regards, Felix
Votes:
2
Hi All, I'm hoping I have this worked out, it might not be complete but if you come up with amendments and improvements, just post them back here. Thing's you'll need
- FailoverCluster powershell module installed on your probe(s)
- 64bit_runner.ps1 (below) in your EXEXML folder (C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML)
- HyperV - Query Cluster for a VM.ps1 (below) in your EXEXML folder (C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML)
64bit_runner.ps1
param ( [string]$filename, [string]$hypervclustername, [string]$VMName ) if ($env:PROCESSOR_ARCHITEW6432 -eq "AMD64") { &"$env:WINDIR\sysnative\windowspowershell\v1.0\powershell.exe" -NonInteractive -NoProfile -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\$filename" -hypervclustername $hypervclustername -vmname $VMName }
HyperV - Query Cluster for a VM.ps1
param ( [string]$hypervclustername, [string]$VMName ) Function WriteXmlToScreen ([xml]$xml) { $StringWriter = New-Object System.IO.StringWriter; $XmlWriter = New-Object System.Xml.XmlTextWriter $StringWriter; $XmlWriter.Formatting = "indented"; $xml.WriteTo($XmlWriter); $XmlWriter.Flush(); $StringWriter.Flush(); Write-Output $StringWriter.ToString(); } # Make the script dynamic by getting the node list from the cluster $clusternodes = Get-ClusterNode -Cluster $hypervclustername | select name #add the list of VMs to an array $details = @() foreach($clusternode in $clusternodes) { $details += Get-VM -ComputerName $clusternode.name | select VMName, State, ComputerName, Uptime, CPUUsage, MemoryAssigned, MemoryDemand } #filter the array for the VM we asked for $details = $details | ?{$_.VMName -eq $VMName} #create the XML $XML = "<prtg>" foreach($detail in $details) { $VMName = $detail.VMName $VMState = $detail.State if($detail.state -eq "Running") { $CPUUsage = $detail.CPUUsage $cluster = $detail.ComputerName $MemoryUsage = ("{0:p0}" -f ($detail.MemoryDemand / $detail.MemoryAssigned)).Replace("%","") $XML += "<result>" $XML += "<channel>CPU Usage</channel>" $XML += "<value>$CPUUsage</value>" $XML += "<unit>CPU</unit>" $XML += "</result>" $XML += "<result>" $XML += "<channel>Memory Usage</channel>" $XML += "<value>$MemoryUsage</value>" $XML += "<unit>Percent</unit>" $XML += "</result>" $XML += "<text>Node: $cluster</text>" }elseif($VMState -eq "Off") { $XML += "<error>1</error>" $XML += "<text>VM Offline</text>" } } $XML += "</prtg>" #output the XML WriteXmlToScreen $XML
Process
- First, add a new device with the name of the cluster.
- Add a new sensor of type "EXE/Script Advanced"
- Name the new sensor to the name of VM you want to monitor
- Choose 64bit runner as the script
- Enter the parameters
-filename "HyperV - Query Cluster for a VM.ps1" -hypervclustername %device -vmname %name
It's possible to add more channels, if you're not comfortable doing it, let me know i should be able to knock something together. Once we've got something workable, i can submit to script world.
Created on Oct 1, 2020 2:53:13 PM
Last change on Oct 14, 2020 5:52:08 AM by
Stephan Linke [Paessler Support]
Votes:
0
That is superb, thanks Chris!
Votes:
1
Hi, it looks like it has been truncated, the full script for the hyperV query is https://pastebin.com/TWJKaiQf Could it be updated? My edits don't seem to stick Thanks
Votes:
0
Done :)
Votes:
0
When I try to add the hyper-v virtual machine sensor to my SCVMM parent in PRTG, I get the following error:
Sorry, the scan for available monitoring items has failed! Could not create the Hyper-V Virtual Machine sensor on device <SCVMM Server> (<IP Address>). 80041010: The specified class is not valid.
How can I add this sensor to my SCVMM server to monitor my VMs per the PRTG recommended way?
I tried the scripts above with the 64bit runner and those seem to work well, but just curious what the difference was vs the official PRTG SCVMM method.
Votes:
0
Please use this instead - https://kb.paessler.com/en/topic/68767-how-can-i-monitor-scvmm-hosts-and-vms-with-prtg - it has proven to be working for many customers :)
Add comment