Creating a Trigger for CPU Capacity

  1. In Cloudera Manager, go to the Hosts page.
  2. Click a link in the Name column to open a host status page.
  3. In the Health Tests section, click Create Trigger.
  4. On the New Trigger page, enter the name CPU Capacity.
  5. In Expression, set these metric conditions.
    • Scalar Function: Min.
    • Metric: cpu_percent.
    • Comparator: > (greater than).
    • Scalar Value: 90.
  6. Set Action to Mark as concerning.
  7. Click Create Trigger.

This trigger fires whenever the CPU percentage exceeds 90%. However, just exceeding 90% of available CPU resources is not necessarily a bad thing. What would be of more concern is if CPU resources were to consistently exceed 90% over an extended period. You can modify the trigger to evaluate the average CPU usage over time.

To modify the trigger to capture high CPU usage in a five minute window, do the following.

  1. In Cloudera Manager, go to the Hosts page.
  2. Click a link in the Name column to open the host status page.
  3. In the Health Tests section, click the Show n Good link.
  4. Click the link for CPU Capacity.
  5. Choose Actions > Edit Trigger.

    The metric expression function for average over time, moving_avg, is not available from the pop-up menu in the editor. You can edit the expression directly using tsquery language.

  6. Above the Expression editor, click Edit manually.
  7. Revise the expression as follows.
    IF (select cpu_percent where entityName=$HOSTID and min(moving_avg(cpu_percent, 300) ) > 90)
          DO health:concerning


  8. Click Save Trigger.