- Zenoss Resource Manager 4.x
- Zenoss Resource Manager 5.x
(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:
- Within the Resource Manager UI, navigate to:
Events > Event Classes
- In the left pane, navigate to:
- 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.
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()) 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