My management is very interested in Zenoss, but we've got a few challenges.  
The first challenge is that we have a number of Windows machines that have 
large shadow copy volumes.  Those are intended to fill up, and alerting for 
those isn't particularly useful.  The second challenge is that a 
one-size-fits-all threshold doesn't actually fit all.

The solution we've fixed upon is to put a custom threshold into the volume name 
and work off that.  Here's the code used in the /Perf/Filesystem event 
transform (based off another user's change that made for more understandable 
messages)


Code:

import re

perDevicePattern = re.compile(r'zz(\d{3})')
fs_id = device.prepId(evt.component)
for f in device.os.filesystems():
    if f.id != fs_id: continue
    p = (float(f.usedBytes()) / f.totalBytes()) * 100
    freeAmtGB = (float(f.totalBytes() - f.usedBytes())) / 1024 / 1024 / 1024
    # Regardless of severity, this will be the message
    evt.summary = "Disk space low: %3.1f%% used (%3.2f GB free)" %  
(p,freeAmtGB)
    # Set a default for critical @ 95%
    perDeviceThreshold = 95.0
    # This is where we change to a per device threshold
    if perDevicePattern.search(f.id):
        perDeviceThreshold = float(perDevicePattern.search(f.id).groups()[0])
    if p >= perDeviceThreshold: evt.severity = 5
    break




So, is this a hack?  Or is there a better way to accomplish this?




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=25527#25527

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to