ZABBIX Forums  
  #1  
Old 18-04-2013, 23:48
nick0909 nick0909 is offline
Member
 
Join Date: Apr 2013
Posts: 73
Default Hyper-V Template

I am working on making a Hyper-V template using perfmon counters for my Server 2012 HyperV hosts. I am reading up on what counters are useful, testing and tweaking it now and can post it to the template wiki once I am done, but I was wondering if anyone already had one created or comments on what is good to monitor. Currently I am basing most of it off of this article and things I discover along the way that look interesting. I only have a smallish Hyper V cluster (4 nodes but only about 8VMs) right now (but it will be growing soon, which is why I am putting in the time now) so if anyone is interested in testing it on a larger environment that would be helpful as well.
Reply With Quote
  #2  
Old 20-04-2013, 04:10
JDNight JDNight is offline
Junior Member
 
Join Date: Nov 2006
Location: Michigan, USA
Posts: 13
Default Hyper V Template

Just finished off my first version of a Hyper-V Template. Link here

The template monitors the Hyper V Service, CPU, Memory, and auto discovers the virtual machines running on the server. It uses a powershell script to get some of the information.

I'm still working on improving it, so thanks for the link I will look to add additional monitors. I too have a small but rapidly growing Hyper V cluster.
Reply With Quote
  #3  
Old 22-04-2013, 19:36
nick0909 nick0909 is offline
Member
 
Join Date: Apr 2013
Posts: 73
Default

I have uploaded mine here:
https://zabbix.org/mw/images/9/9f/Za...yperV-Host.xml
It uses quite a few perfmon counters on the host to monitor health, I am still working on adding more and taking out things that don't really seem to matter as I learn more about what counters represent in real world performance. I will take a look at yours as well, maybe we can merge the best of the two in to one.
Reply With Quote
  #4  
Old 29-04-2013, 20:38
nick0909 nick0909 is offline
Member
 
Join Date: Apr 2013
Posts: 73
Default

I like the powershell output! I wonder if there is another item you could help me add? I want to know if there are snapshots running on a VM. If possible, also I would like to know their age, so I could alert if there were snapshots more than 5 days old (or whatever you pick in the trigger). If that is too difficult then just alert if there are any snapshots will work. So far I have the basic command:
Code:
PS C:\Windows\system32> get-vmsnapshot zabbix

VMName Name                              SnapshotType CreationTime         ParentSnapshotName
------ ----                              ------------ ------------         ------------------
Zabbix Zabbix - (4/26/2013 - 4:02:08 PM) Standard     4/26/2013 4:03:16 PM
You could select the creationtime, but could you input that in to zabbix in a date it would understand and be able to tell you if it was older than a specific age? If not simply inputting a 1 that a snapshot exists would be great.
Reply With Quote
  #5  
Old 14-05-2013, 20:25
nick0909 nick0909 is offline
Member
 
Join Date: Apr 2013
Posts: 73
Default

I have added snapshot detection to your original script by adding this in the $QueryName section:
Code:
('Snapshots') {$Results = Get-VMSnapshot -VMName "$VMName" | select Name | Format-Table -HideTableHeaders -AutoSize}
Then I just created an item for that, and a trigger that fires if the string is longer than 0. I hope to improve this in the future to only alert if there is a snapshot older than X number of days, as we use snapshots quickly sometimes but don't want them hanging around forgotten about.

Discovery item:
Code:
hyperv.check[Snapshots,{#VMNAME}]
Discovery trigger:
Code:
{Template_Windows_HyperV_Guests:hyperv.check[Snapshots,{#VMNAME}].strlen(0)}>1
Reply With Quote
  #6  
Old 07-04-2014, 20:42
lucsmitty lucsmitty is offline
Junior Member
 
Join Date: Apr 2014
Posts: 1
Default I'm not quite there...

Nick,
I want to use your HyperV template. I imported it, graphs show "No Data".

On the agent side, I'm using: PerfCounter=perf_counter[\Hyper-V Hypervisor\Logical Processors],"\Hyper-V Hypervisor\Logical Processors",30

That's how I think it would work as I look through the xml of the template file. I'm new to Zabbix, so I'm not ruling out that I'm totally wrong, but any help would be gladly accepted. Thanks,
Greg
Reply With Quote
  #7  
Old 24-01-2016, 18:14
Deslok Deslok is offline
Junior Member
 
Join Date: Jan 2016
Posts: 2
Default

Quote:
Originally Posted by lucsmitty View Post
Nick,
I want to use your HyperV template. I imported it, graphs show "No Data".

On the agent side, I'm using: PerfCounter=perf_counter[\Hyper-V Hypervisor\Logical Processors],"\Hyper-V Hypervisor\Logical Processors",30

That's how I think it would work as I look through the xml of the template file. I'm new to Zabbix, so I'm not ruling out that I'm totally wrong, but any help would be gladly accepted. Thanks,
Greg
Did you ever get this working? I have a large 3 node/30ish vm cluster i'm trying to monitor
Reply With Quote
  #8  
Old 26-01-2016, 00:24
nick0909 nick0909 is offline
Member
 
Join Date: Apr 2013
Posts: 73
Default

We are phasing out our HyperV cluster in favor of VMWare, but I did have decent enough monitoring. Here are the templates and the scripts, import the template and put the scripts the agent folder. I only applied the CSV template to one host in the cluster, otherwise they will all alert at the same time as they share the same CSV's.

Add this to your Zabbix agent config, change the path to the script if you install the agent somewhere else:
Code:
#HyperV discovery
UserParameter=hyperv.discover,powershell.exe -file "C:\Zabbix\HyperV_Status.ps1"
UserParameter=hyperv.check[*],powershell.exe -file "C:\Zabbix\HyperV_Status.ps1" $1 $2
UserParameter=windisk.discover,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:\Zabbix\CSVDrives_Status.ps1"
UserParameter=windisk.check[*],powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:\Zabbix\CSVDrives_Status.ps1" $1 "$2"
Let me know if it works out.
Nick
Reply With Quote
  #9  
Old 07-03-2016, 16:52
mrjibbles mrjibbles is offline
Junior Member
 
Join Date: Mar 2016
Posts: 1
Default

Hi,
I have been trying to get your Hyper-V template working on a test Windows 2012/2016 server, however I may be missing something!
I have imported the template and attached to my test server.
I have added the additional lines to the zabbix_agent.conf file running on the server.
The 2 PS scripts work fine, but I am not seeing any data appearing or able to see any graphs.
Have I missed something to get this reporting?
The Zabbix queue is showing 38 Hyper-V item waiting to be updated.
Thanks in advance.
Mr Jibbles
Attached Images
 
Reply With Quote
  #10  
Old 07-03-2017, 17:09
ruediger.wahl ruediger.wahl is offline
Junior Member
 
Join Date: Mar 2017
Posts: 1
Default

@ Mr Jibbles

have you ever solved the Problem with the refresh of the values?
i try the Hyper-V template but have the same problem like you
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:14.