How to Display Memory Utilization Values in Percentages for ESX host Memory Events in VCenter

Applies To

  • Zenoss Resource Manager 4.x
  • Zenoss Resource Manager 5.x
  • ZenPacks.zenoss.vSphere
    (vSphere ZenPack monitoring ESX host components in vCenter)


The vSphere ZenPack includes monitoring of ESX host components in vCenter. The monitoring capabilities include memory utilization thresholds. This KB provides a transform that generates human readable percentage memory utilization values in event notifications when applied to the /perf/memory event class.


Apply the attached transform file to the event class /perf/memory for ESX hosts to display memory utilization thresholds in event notifications as percentage values.

To attach the transform file:

  1. Within the Resource Manager UI, navigate to:
    Events > Event Classes
  2. In the left pane, navigate to:
  3. Select Transforms:
    • In RM version 5.x - 
      In the right pane select Transforms from the drop-down list.
    • In RM version 4.x - 
      Click the Gear icon at the bottom of the left pane and select Transforms.
  • Paste the block transform code into the form.
    Note: If the transform is incorrectly formatted, warnings display.
  • Click the Save icon to save and compile the transform.

Transform file

import time, re, logging
match ='threshold of .*(swap|ESXHost Memory Utilization Error|ESXHost Memory Utilization Warning).* (exceeded|restored|not met): current value ([\d\.]+)', evt.message, re.I)
if match and device and component:
    consumed = float(match.groups()[2])
    total = component.totalMemory / 1024
    evt.memoryavailable = total - consumed = total
    if total:
        percent_consumed = (consumed / total) * 100
        percent_free = ((total - consumed) / total) * 100
        evt.summary = "High Memory Utilization: Currently %3.0f%% used (%3.0f%% free)" % (percent_consumed, percent_free)
        evt.message = evt.summary
        evt.summary = 'High Memory Utilization: Currently: %s' %(convToUnits(consumed))
        evt.message = evt.summary
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk