Simple Hyper-V Guest and Host templates.
Compatible with Zabbix Server 5.0+
The following parameters are discovered and monitored:
Import provided templates.
Allow Zabbix to create necessary groups.
(Just to check that everything works as expected. You can modify all the details to suit your needs later.)
Copy provided PowerShell script to the desired location on your HyperV host machine. If your server(s) are not running a english version of windows, you will have to modify the performance counters to match the names in the server OS language.
Assuming your host is called my-hyperv-hostname, you can create a self siged certificate and sign it as follow:
Set-AuthenticodeSignature -Certificate $cert -FilePath 'C:\Program Files\Zabbix Agent 2\zabbix-vm-perf.ps1
$exportPath = "C:\myCert.cer"
Export-Certificate -Cert $cert -FilePath $exportPath
Import-Certificate -FilePath $exportPath -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Import-Certificate -FilePath $exportPath -CertStoreLocation Cert:\LocalMachine\Root
Remove-Item -Path $exportPath
In case you don't care about security, you can lower the restrictions If you downloaded the script from internet, then make sure windows is not blocking it.
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine
Put the file hyper-v.conf in C:\Program files\Zabbix Agent 2\zabbix_agentd.d Adjust the paths according to the previous step if needed
Restart zabbix agent.
Set-up Hyper-V host in Zabbix interface.
Go to the Hyper-V host in the Zabbix interface and click on the discoveries, and click on test.
Provide the path to an existing '.ps1' file as an argument to the -File parameter.
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
Depending on the load of your Hyper-V server, you will have to increase the default Zabbix Temout from 3 to 10-30 seconds
Copyright (c) 2014 , Dmitry Sarkisov ait.meijin@gmail.com Copyright (c) 2016-2017, Andre Schild a.schild@aarboard.ch
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.