What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Monitor Hyper-V cluster

Votes:

0

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

guest hyper-v monitor

Created on Jan 7, 2011 10:10:03 AM



Best Answer

Accepted 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.

Created on Aug 14, 2014 11:42:06 AM by  Felix Saure [Paessler Support]



19 Replies

Votes:

0

vMotion on HyperV is not yet sported by the sensors, sorry.

Created on Jan 9, 2011 6:16:37 AM by  Aurelio Lombardi [Paessler Support]



Votes:

0

Any plans for this in the future?

Created on Jan 10, 2011 8:22:19 AM



Votes:

0

We have it on our wishlist, but no target date has been set yet.

Created on Jan 11, 2011 4:43:10 PM by  Dirk Paessler [Founder Paessler AG] (11,025) 3 6



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?

Created on Jan 26, 2011 5:01:54 AM



Votes:

0

Not very likely, but I also can't say this with certainty. Sorry.

Created on Jan 26, 2011 1:28:17 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Just to keep the interest going... I''m running into the same "problem".

Any news on a target date?

Created on Apr 7, 2011 9:19:57 AM



Votes:

0

Count me as another with this issue.

Created on Apr 15, 2011 4:08:31 PM



Accepted 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.

Created on Aug 14, 2014 11:42:06 AM by  Felix Saure [Paessler Support]



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.

Created on Mar 3, 2015 8:20:25 AM



Votes:

0

I am afraid that this is not possible at the moment, sorry.

Created on Mar 3, 2015 12:54:27 PM by  Felix Saure [Paessler Support]



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?

Created on Feb 22, 2016 10:05:00 PM



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?

Created on Mar 7, 2017 2:49:37 PM



Votes:

0

Hello Dan,

I'm sorry, there is no native sensor and there are no known custom scripts yet.

Best regards, Felix

Created on Mar 8, 2017 12:17:01 PM by  Felix Saure [Paessler Support]



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!

Created on Oct 2, 2020 2:24:38 PM by  Stephan Linke [Paessler Support]



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

Created on Oct 13, 2020 12:56:26 PM



Votes:

0

Done :)

Created on Oct 14, 2020 5:52:27 AM by  Stephan Linke [Paessler Support]



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.

Created on Jul 19, 2021 9:27:08 PM



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 :)

Created on Jul 21, 2021 11:58:19 AM by  Stephan Linke [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.