Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Hyper-V CPU counters using check_nt

Rating
0 votes
Favoured:
0
Current Version
1
Last Release Date
2015-01-21
Compatible With
  • Nagios 3.x
Owner
License
GPL
Hits
13138
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Monitor CPU counters for Hyper-V hosts and guests using check_nt
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
}
##############################################################