Follow

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)

Summary

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.

Procedures

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:
    /Perf/Memory
  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 = re.search('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
    evt.total = 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
    else:
        evt.summary = 'High Memory Utilization: Currently: %s' %(convToUnits(consumed))
        evt.message = evt.summary
Was this article helpful?
0 out of 0 found this helpful

Comments

Powered by Zendesk