perf

Description

The perf command extracts a values from a PerfCounter. You can get a list of all available counters with a short description (as provided by the API) with the list-metrics command.

Options

Besides the general options this command supports the following options:

optiondescription
--vimtype VIMTYPEthe object type to check, see common options
--vimname VIMNAMEname of the vimtype object, see common options
--critical CRITICALwarning threshold, see common options
--warning WARNINGwarning threshold, see common options
--perfcounter PERFCOUNTERa colon separated string composed of groupInfo.key:nameInfo.key:rollupType
--perfinstance PERFINSTANCEthe instance of of the metric to monitor.
defaults to empty string, which is not always available but means an aggregated value over all instances.
Can also be * meaning all instances, in this case the threshold is checked against each of the instances
--maintenance-stateexit state if the host is in maintenance,
one of OK, WARNING, CRITICAL, UNKNOWN (only has a meaning with --vimtype HostSystem
--interval INTERVALIDdefaults to 20 which works in most cases, other possible values 300, 1800, 7200, 86400 and maybe more …

In case of --vimtype HostSystem it may be useful to omit the --vimname when you run this command directly against the HostSystem (not through the vcenter).

Examples

# check for too much cpu usage
check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
  --vimtype HostSystem  --vimname esx1.int.example.com \
  --perfcounter cpu:usage:average --perfinstance '' \
  --critical 80

# check for too less cpu usage (application died?)
check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
  --vimtype HostSystem  --vimname esx1.int.example.com \
  --perfcounter cpu:usage:average \
  --critical 5:

# check if there was a reboot within the last 10 minutes
check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
  --vimtype HostSystem  --vimname esx1.int.example.com \
  --perfcounter sys:uptime:latest \
  --critical 600:

# check disk latency
$ check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
	--vimname esx1.int.example.com --vimtype HostSystem \
	--perfcounter disk:totalLatency:average
UNKNOWN: Cannot find disk:totalLatency:average for the queried resources

# On that error you may want to try --perfinstance '*'

$ check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
	--vimname esx1.int.example.com --vimtype HostSystem \
	--perfcounter disk:totalLatency:average --perfinstance '*'
OK: disk:totalLatency:average_naa.6000eb3810d426400000000000000277 has value 0 Millisecond
  disk:totalLatency:average_naa.600605b00ba8cb0022564867b8c8cc32 has value 2 Millisecond
  disk:totalLatency:average_naa.6000eb3810d4264000000000000000b2 has value 0 Millisecond
  disk:totalLatency:average_naa.600605b00ba8cb001fd947850523e56d has value 0 Millisecond
  disk:totalLatency:average_naa.600605b00ba8cb0029700b163217244e has value 6 Millisecond
  disk:totalLatency:average_naa.6000eb3810d4264000000000000002b3 has value 1 Millisecond
| 'disk:totalLatency:average_naa.6000eb3810d426400000000000000277'=0.0ms;;;;
'disk:totalLatency:average_naa.600605b00ba8cb0022564867b8c8cc32'=2.0ms;;;;
...

$ check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
	--vimname esx1.int.example.com --vimtype HostSystem \
	--perfcounter disk:totalLatency:average --perfinstance 'naa.600605b00ba8cb0022564867b8c8cc32'

$ check_vsphere perf -s vcenter.example.com -u naemon@vsphere.local -nossl \
    --vimname esx1.int.example.com --vimtype HostSystem --perfcounter power:power:average
OK: Counter power:power:average on HostSystem:esx1.int.example.com reported 227 Watt
| 'power:power:average'=227.0;;;;

Rosetta

check_vmware_esxcheck_vspherevimtypes
--select cpu --subselect usageperf --perfcounter cpu:usage:averageHostSystem, VirtualMachine
--select cpu --subselect readyperf --perfcounter cpu:ready:summationHostSystem, VirtualMachine
--select cpu --subselect waitperf --perfcounter cpu:wait:summationHostSystem, VirtualMachine
--select mem --subselect usageperf --perfcounter mem:usage:averageHostSystem, VirtualMachine
--select mem --subselect consumedperf --perfcounter mem:consumed:averageHostSystem, VirtualMachine
--select mem --subselect swapusedperf --perfcounter mem:swapused:averageHostSystem, VirtualMachine
--select mem --subselect overheadperf --perfcounter mem:overhead:averageHostSystem, VirtualMachine
--select mem --subselect memctlperf --perfcounter mem:vmmemctl:averageHostSystem, VirtualMachine
--select io --subselect abortedperf --perfcounter disk:commandsAborted:summationHostSystem, VirtualMachine
--select io --subselect resetsperf --perfcounter disk:busResets:summationHostSystem, VirtualMachine
--select io --subselect readperf --perfcounter disk:read:averageHostSystem, VirtualMachine
--select io --subselect read_latencyperf --perfcounter disk:totalReadLatency:averageHostSystem, VirtualMachine
--select io --subselect writeperf --perfcounter disk:write:averageHostSystem, VirtualMachine
--select io --subselect write_latencyperf --perfcounter disk:totalWriteLatency:averageHostSystem, VirtualMachine
--select io --subselect usageperf --perfcounter disk:usage:averageHostSystem, VirtualMachine
--select io --subselect kernel_latencyperf --perfcounter disk:kernelLatency:averageHostSystem, VirtualMachine
--select io --subselect device_latencyperf --perfcounter disk:deviceLatency:averageHostSystem, VirtualMachine
--select io --subselect queue_latencyperf --perfcounter disk:queueLatency:averageHostSystem, VirtualMachine
--select io --subselect total_latencyperf --perfcounter disk:totalLatency:averageHostSystem, VirtualMachine
--select net --subselect usageperf --perfcounter net:usage:averageHostSystem, VirtualMachine
--select net --subselect receiveperf --perfcounter net:received:averageHostSystem, VirtualMachine
--select net --subselect sendperf --perfcounter net:transmitted:averageHostSystem, VirtualMachine
--select uptimeperf --perfcounter sys:uptime:latestHostSystem,VirtualMachine
--select cluster --subselect effectivecpuperf --perfcounter clusterservices:effectivecpu:averageClusterComputeResource
--select cluster --subselect effectivememperf --perfcounter clusterservices:effectivemem:averageClusterComputeResource
--select cluster --subselect failoverperf --perfcounter clusterservices:failover:latestClusterComputeResource
--select cluster --subselect cpufairnessperf --perfcounter clusterservices:cpufairness:latestClusterComputeResource
--select cluster --subselect memfairnessperf --perfcounter clusterservices:memfairness:latestClusterComputeResource