4.29 VmCPUUsage

Use this Knowledge Script to monitor the following CPU metrics for a virtual machine:

  • CPU ready - Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. CPU ready time is dependent on the number of virtual machines on the host and their CPU loads.

  • CPU system - Amount of time spent on system processes on each virtual CPU in the virtual machine.

  • CPU usage - Amount of actively used virtual CPU, as a percentage of total available CPU. This is the host’s view of the CPU usage, not the guest operating system’s view. It is the average CPU utilization over all available virtual CPUs in the virtual machine.

  • CPU usage in MHz - Total amount of CPU used, in MHz, during the interval. This is the same value as CPU usage represented in MHz instead of a percentage.

  • CPU used - Total CPU usage. CPU used as a percentage and CPU usage as a percentage are the same value.

  • CPU wait - Amount of CPU time spent in wait state.

This script raises an event if a monitored value exceeds the threshold you set.

NOTE:

  • If the parent host of the monitored virtual machine is in maintenance mode, this Knowledge Script will not generate events.

  • Using this script and other VirtualCenter_Vm* scripts to monitor a large number of virtual machines at the same time might cause the jobs to fail. If the jobs fail on a regular basis, consider running the VirtualCenter_Vm* scripts on fewer virtual machines.

  • CPU wait is a combined metric that includes CPU idle, CPU wait, and CPU halted. CPU wait is a defect in VMware. NetIQ Corporation is currently researching a solution with VMware (SR #1123183421). AppManager matches the value provided by VMware. For more information about this issue, see the VI SDK Release Notes at http://www.vmware.com/support/developer/vc-sdk/visdk-2.5.0-200711-releasenotes.html.

  • In vCenter version 2.0.2 environments, event and datastream values for the CPU Wait metric correspond to the value of the CPU Idle metric.

4.29.1 Resource Object

vSphere virtual machine

4.29.2 Default Schedule

By default, this script runs every day at 15 minute intervals starting at 12:05 AM and ending at 11:59 PM. If you start the job after the scheduled starting time, the script runs at the time of the next scheduled interval. For example, if you start the job at 12:10 AM, it runs for the first time at 12:20 AM.

NOTE:If you are running this script as part of the Recommended Knowledge Script Groups, do not change the schedule. The schedules for the recommended scripts are staggered to lessen the impact on CPU utilization when you run the KSG.

4.29.3 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

Job Failure Notification

Raise event when CPU metrics are not available?

Select Yes to raise an event if CPU metrics are not available. The default is unselected.

Event severity when CPU metrics are not available

Set the event severity level, from 1 to 40, to indicate the importance of an event in which CPU metrics are not available. The default is 15.

Event severity when AppManger failed to get metrics

Set the event severity level, from 1 to 40, to indicate the importance of an event in which AppManager failed to retrieve metrics from vCenter. The default is 15.

Event severity when AppManager failed to log in

Set the severity level, from 1 to 40, to indicate the importance of an event in which AppManager failed to log in to vCenter. The default is 5.

Event severity when VmCPUUsage job fails unexpectedly

Set the severity level, from 1 to 40, to indicate the importance of an event in which the VmCPUUsage job fails unexpectedly. The default is 5.

Additional Settings

Event Details

Event detail format

Select either HTML Table or Plain Text as the format for event detail. The default is HTML Table.

Monitoring CPU Ready

Event Notification

Raise event when average CPU ready exceeds the threshold?

Select Yes to raise an event when average CPU ready exceeds the threshold you set. The default is Yes.

Threshold -- Maximum average CPU ready

Specify the maximum average CPU ready that can occur before an event is raised. The default is 10 percent.

Event severity when average CPU ready exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when average CPU ready exceeds the threshold. The default is 15.

Data Collection

Collect data for average CPU ready?

Select Yes to collect data about average CPU ready for charts and reports. The default is unselected.

Collect data for individual CPU ready?

Select Yes to collect data about individual CPU ready for charts and reports. The default is unselected.

Monitoring CPU System

Event Notification

Raise event when average CPU system exceeds the threshold?

Select Yes to raise an event when average CPU system exceeds the threshold you set. The default is unselected.

Threshold -- Maximum average CPU system

Specify the maximum average CPU system that can occur before an event is raised. The default is 20 percent.

Event severity when average CPU system exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when average CPU system exceeds the threshold. The default is 15.

Raise event when individual CPU system exceeds the threshold?

Select Yes to raise an event when individual CPU system exceeds the threshold you set. The default is unselected.

Threshold -- Maximum individual CPU system

Specify the maximum individual CPU system that can occur before an event is raised. The default is 20 percent.

Event severity when individual CPU system exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when individual CPU system exceeds the threshold. The default is 15.

Data Collection

Collect data for average CPU system?

Select Yes to collect data about average CPU system for charts and reports. The default is unselected.

Collect data for individual CPU system?

Select Yes to collect data about individual CPU system for charts and reports. The default is unselected.

Monitoring CPU Usage

Event Notification

Raise event when average CPU usage exceeds the threshold?

Select Yes to raise an event when average CPU usage exceeds the threshold you set. The default is Yes.

Threshold -- Maximum average CPU usage

Specify the maximum average CPU usage that can occur before an event is raised. The default is 80 percent.

Event severity when average CPU usage exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when average CPU usage exceeds the threshold. The default is 15.

Data Collection

Collect data for average CPU usage?

Select Yes to collect data about average CPU usage for charts and reports. The default is unselected.

Collect data for individual CPU usage?

Select Yes to collect data about individual CPU usage for charts and reports. The default is unselected.

Monitoring CPU Usage in MHz

Event Notification

Raise event when average CPU usage in MHz exceeds the threshold?

Select Yes to raise an event when average CPU usage in MHz exceeds the threshold you set. The default is unselected.

Threshold -- Maximum average CPU usage in MHz

Specify the maximum average CPU usage in MHz that can occur before an event is raised. The default is 2000 MHz.

Event severity when average CPU usage in MHz exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when average CPU usage in MHz exceeds the threshold. The default is 15.

Raise event when individual CPU usage in MHz exceeds the threshold?

Select Yes to raise an event when individual CPU usage in MHz exceeds the threshold you set. The default is unselected.

Threshold -- Maximum individual CPU usage in MHz

Specify the maximum individual CPU usage in MHz that can occur before an event is raised. The default is 2000 MHz.

Event severity when individual CPU usage in MHz exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when individual CPU usage in MHz exceeds the threshold. The default is 15.

Data Collection

Collect data for average CPU usage in MHz?

Select Yes to collect data about average CPU usage in MHz for charts and reports. The default is unselected.

Collect data for individual CPU usage in MHz?

Select Yes to collect data about individual CPU usage in MHz for charts and reports. The default is unselected.

Monitoring CPU Used

Event Notification

Raise event when average CPU used exceeds the threshold?

Select Yes to raise an event when average CPU used exceeds the threshold you set. The default is Yes.

Threshold -- Maximum average CPU used

Specify the maximum average CPU used that can occur before an event is raised. The default is 80 percent.

Event severity when average CPU used exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when average CPU used exceeds the threshold. The default is 15.

Data Collection

Collect data for average CPU used?

Select Yes to collect data about average CPU used for charts and reports. The default is unselected.

Collect data for individual CPU used?

Select Yes to collect data about individual CPU used for charts and reports. The default is unselected.

Monitoring CPU Wait

Event Notification

Raise event when average CPU wait exceeds the threshold?

Select Yes to raise an event when average CPU wait exceeds the threshold you set. The default is unselected.

Threshold -- Maximum average CPU wait

Specify the maximum average CPU wait that can occur before an event is raised. The default is 10 percent.

Event severity when average CPU wait exceeds the threshold

Set the event severity level, from 1 to 40, to indicate the importance of an event when average CPU wait exceeds the threshold. The default is 15.

Data Collection

Collect data for average CPU wait?

Select Yes to collect data about average CPU wait for charts and reports. The default is unselected.

Collect data for individual CPU wait?

Select Yes to collect data about individual CPU wait for charts and reports. The default is unselected.