There's a write-up somewhere around here, but the gist of it is to create an
event class transform for 'events/perf/filesystem'
The drop-down menu for the class has the option 'More->Transform', which takes
you to a window where you can put the event transform code. I'm using the
following (slightly modified from the write-up):
Welcome to slightly less shortly-numbered hell :)
import re
fs_id = device.prepId(evt.component)
for f in device.os.filesystems():
if f.id != fs_id: continue
# Extract the percent and free from the summary
m = re.search("threshold of [^:]+: current value ([\d\.]+)", evt.summary)
if not m: continue
usedBlocks = float(m.groups()[0])
p = (usedBlocks / f.totalBlocks) * 100
freeAmtGB = ((f.totalBlocks - usedBlocks) * f.blockSize) / 1073741824
# Make a nicer summary
evt.summary = "Disk space low: %3.1f%% used (%3.2f GB free)" % (p,freeAmtGB)
evt.message = "Disk space low: %3.1f%% used (%3.2f GB free)" % (p,freeAmtGB)
# This is where we change to a per device threshold
# perDeviceThreshold = 90.0
# m = re.search("zz(\d{3})", f.id)
# perDeviceThreshold = m and float(m.groups()[0]) or 90.0
# if p >= perDeviceThreshold: evt.severity = 5
# break
-------------------- m2f --------------------
Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=32948#32948
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users