Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Monitor CPU counters for Hyper-V hosts and guests using check_nt
Current Version
1
Last Release Date
2015-01-21
Owner
Adrian Lesovici
License
GPL
Compatible With
I was inspired from this article: http://windowsitpro.com/hyper-v/hyper-v-performance-counters Read it to understand what each counter represent and how can it help you.
For a Nagios deployment use the following commands (add them in commands.cfg):
############################################################## define command{ command_name hv-logical-processor command_line $USER1$/check_nt -H $HOSTADDRESS$ -s $USER4$ -p 12489 -v COUNTER -l "Hyper-V Hypervisor Logical Processor(_Total)% Total Run Time","overall the Logical Processors" -w 80 -c 90 } define command{ command_name hv-root-virtual-processor command_line $USER1$/check_nt -H $HOSTADDRESS$ -s $USER4$ -p 12489 -v COUNTER -l "Hyper-V Hypervisor Root Virtual Processor(_Total)% Total Run Time","overall the Root Virtual Processor" -w 80 -c 90 } define command{ command_name hv-virtual-processors command_line $USER1$/check_nt -H $HOSTADDRESS$ -s $USER4$ -p 12489 -v COUNTER -l "Hyper-V Hypervisor Virtual Processor(_Total)% Total Run Time","overall the Virtual Processors" -w 80 -c 90 } define command{ command_name hv-virtual-processor command_line $USER1$/check_nt -H $HOSTADDRESS$ -s $USER4$ -p 12489 -v COUNTER -l "Hyper-V Hypervisor Virtual Processor($ARG1$)% Total Run Time","Virtual Processor $ARG1$" -w 80 -c 90 } ##############################################################
... create Host Groups and Service Groups by adding into windows.cfg the following (replace HvServer1,HvServer2 with your servernames): ############################################################## define hostgroup{ hostgroup_name hyper-v-servers alias Hyper-V Servers members HvServer1,HvServer2 } define servicegroup{ servicegroup_name hyper-v alias Hyper-V performance } ##############################################################
... define services for monitoring the _total counters: ############################################################## define service{ use generic-service hostgroup_name hyper-v-servers service_description Hypervisor Logical Processor _total check_command hv-logical-processor servicegroups hyper-v } define service{ use generic-service hostgroup_name hyper-v-servers service_description Hypervisor Root Virtual Processor _total check_command hv-root-virtual-processor servicegroups hyper-v } define service{ use generic-service hostgroup_name hyper-v-servers service_description Hypervisor Virtual Processors _total check_command hv-virtual-processors servicegroups hyper-v } ##############################################################
... define services to monitor the Virtual Processor counters on individual VMs (in this example we have a VM named Nagios1 hosted on HvServer1 with 2 virtual processors, a VM named Server1 hosted on HvServer1 with 2 virtual processors and a VM named Server2 hosted on HvServer2 with 4 virtual processors): ############################################################## define service{ use generic-service service_description Hypervisor Virtual Processor Nagios1 VP0 check_command hv-virtual-processor!Nagios1:Hv VP 0 host_name HvServer1 servicegroups hyper-v } define service{ use generic-service service_description Hypervisor Virtual Processor Nagios1 VP1 check_command hv-virtual-processor!Nagios1:Hv VP 1 host_name HvServer1 servicegroups hyper-v }
define service{ use generic-service service_description Hypervisor Virtual Processor Server1 VP0 check_command hv-virtual-processor!Server1:Hv VP 0 host_name HvServer1 servicegroups hyper-v } define service{ use generic-service service_description Hypervisor Virtual Processor Server1 VP1 check_command hv-virtual-processor!Server1:Hv VP 1 host_name HvServer1 servicegroups hyper-v }
define service{ use generic-service service_description Hypervisor Virtual Processor Server2 VP0 check_command hv-virtual-processor!Server2:Hv VP 0 host_name HvServer2 servicegroups hyper-v } define service{ use generic-service service_description Hypervisor Virtual Processor Server2 VP1 check_command hv-virtual-processor!Server2:Hv VP 1 host_name HvServer2 servicegroups hyper-v } define service{ use generic-service service_description Hypervisor Virtual Processor Server2 VP2 check_command hv-virtual-processor!Server2:Hv VP 2 host_name HvServer2 servicegroups hyper-v } define service{ use generic-service service_description Hypervisor Virtual Processor Server2 VP3 check_command hv-virtual-processor!Server2:Hv VP 3 host_name HvServer2 servicegroups hyper-v } ##############################################################
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!