Use this Knowledge Script to monitor host CPU usage and CPU used. This script raises an event if CPU usage exceeds the threshold you set. This script monitors the following metrics:
CPU reserved capacity - Total CPU capacity reserved by the virtual machines.
CPU usage - Actively used CPU of the host, as a percentage of the total available CPU reserved by virtual machines running on this host.
CPU usage in MHz - Total amount of CPU used, in MHz, during the interval.
CPU used - Sum of the actively used CPU of all powered on virtual machines on a host.
NOTE:
When a host goes into maintenance mode all VirtualCenter_Host* Knowledge Scripts, except for the VirtualCenter_HostConnected Knowledge Script, suppress events and data.
In rare situations, queries to the ESX or ESXi host might fail with timeouts because the ESX or ESXi host stops responding. This issue affects all VirtualCenter_Host* Knowledge Scripts. You can work around this issue by restarting the management service on the ESX or ESXi host.
vSphere ESX or ESXi host
By default, this script runs every 15 minutes.
Set the following parameters as needed:
Parameter |
How to Set It |
---|---|
General Settings |
|
Job Failure Notification |
|
Raise event when CPU metrics are not available? |
Select Yes to raise an event when CPU metrics are not available. The default is Yes. |
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 AppManager 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 HostCPUUsage job fails unexpectedly |
Set the severity level, from 1 to 40, to indicate the importance of an event in which the HostCPUUsage 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. |
Monitor CPU Reserved Capacity |
|
Event Notification |
|
Raise event when CPU reserved capacity exceeds the threshold? |
Select Yes to raise an event when CPU reserved capacity exceeds the threshold you set. The default is unselected. |
Threshold -- Maximum CPU reserved capacity |
Specify the maximum CPU reserved capacity that can occur before an event is raised. The default is 80 percent. |
Event severity when CPU reserved capacity exceeds the threshold |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which CPU reserved capacity exceeds the threshold. The default is 15. |
Data Collection |
|
Collect data for CPU reserved capacity? |
Select Yes to collect data about CPU reserved capacity for charts and reports. The default is unselected. |
Monitor CPU Usage |
|
Event Notification |
|
Raise event when CPU usage in MHz exceeds the threshold? |
Select Yes to raise an event when CPU usage in MHz exceeds the threshold you set. The default is Yes. |
Threshold -- Maximum CPU usage in MHz |
Specify the maximum CPU usage in MHz that can occur before an event is raised. The default is 2000 MHz. |
Event severity when CPU usage in MHz exceeds the threshold |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which CPU usage in MHz exceeds the threshold. The default is 15. |
Raise event when percent CPU usage exceeds the threshold? |
Select Yes to raise an event when the percentage of CPU usage exceeds the threshold you set. The default is Yes. |
Threshold -- Maximum percent CPU usage |
Specify the maximum percentage of CPU usage that can occur before an event is raised. The default is 80 percent. |
Event severity when percent CPU usage exceeds the threshold |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which the percentage of CPU usage exceeds the threshold. The default is 15. |
Raise event when percent individual CPU usage exceeds the threshold? |
Select Yes to raise an event when the percentage of individual CPU usage exceeds the threshold you set. The default is Yes. |
Threshold -- Maximum individual CPU usage |
Specify the maximum percentage of individual CPU usage that can occur before an event is raised. The default is 80 percent. |
Event severity when individual CPU usage exceeds the threshold |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which the percentage of individual CPU usage exceeds the threshold. The default is 15. |
Data Collection |
|
Collect data for CPU usage in MHz? |
Select Yes to collect data about CPU usage in MHz for charts and reports. The default is unselected. |
Collect data for average CPU usage as percent? |
Select Yes to collect data about the average CPU usage as a percentage for charts and reports. The default is unselected. |
Collect data for individual CPU usage as percent? |
Select Yes to collect data about usage for individual CPUs as a percentage for charts and reports. The default is unselected. |
Monitor CPU Used |
|
Event Notification |
|
Raise event when CPU used exceeds the threshold? |
Select Yes to raise an event when CPU used exceeds the threshold you set. The default is Yes. |
Threshold -- Maximum CPU used |
Specify the maximum CPU used that can occur before an event is raised. The default is 80 percent. |
Event severity when CPU used exceeds the threshold |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which CPU used exceeds the threshold. The default is 15. |
Raise event when individual CPU used exceeds the threshold? |
Select Yes to raise an event when the individual CPU used exceeds the threshold you set. The default is Yes. |
Threshold -- Maximum individual CPU used |
Specify the maximum individual CPU used that can occur before an event is raised. The default is 80 percent. |
Event severity when individual CPU used exceeds the threshold |
Set the event severity level, from 1 to 40, to indicate the importance of an event in which the individual 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. |