Follow

How To Show CPU Used Percentage In Threshold Events

Pre-Requisites

A Zenoss installation with added devices that have CPU usage monitored.

Applies To

  • Zenoss 4.x
  • Zenoss 3.x
  • Zenoss 2.5.x

Summary

The following will convert your events generated by thresholds on CPU utilization to show the used value instead of the idle value.

Procedure

Use the code block included below and paste it into your /Perf/Cpu event class transform field.

  1. To locate navigate to: Events -> Event Classes -> Perf -> Cpu.
  2. Select the action wheel at the bottom of the left side-bar.
  3. Choose Transform.
  4. Paste the code and click Save at the bottom of the code field. Now any events that display the default threshold name of 'low CPU idle' will contain both the percent used and percent idle in the message displayed.

Code:

import re
m = re.search("threshold of low CPU idle not met: current value ([\d\.]+)", evt.message)
currentValue = float(m.groups()[0])
newValue = 100 - currentValue
evt.summary = "threshold of low CPU idle not met: current value %3.1f%% used (%s idle)" % (newValue, currentValue)
evt.message = evt.summary
Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Mark Passell

    need to know how to show graphs of CPU Percentage Used on SSH monitored multiprocessor systems for Linux that have 100% max instead of the usual 600%

Powered by Zendesk