Archived community.zenoss.org | full text search
Skip navigation
5854 Views 2 Replies Latest reply: Jul 31, 2009 10:07 AM by dveezy RSS
dveezy Rank: White Belt 35 posts since
Jul 23, 2009
Currently Being Moderated

Jul 30, 2009 4:51 PM

Change Alerts to Display % of disk or cpu used, not actual #

How would I edit the alert templates to make the email notification alerts that are sent say

currentvalue 95%


for example instead of saying xxxxxx referring to amount of bytes being actually used like it is doing by default?

Thank you.
  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Event transforms. For example, in /Perf/Filesystem:
    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)

    # This is where we change to a per device threshold
    perDeviceThreshold = 95.0
    m = re.search("zz(\d{3})", f.id)
    perDeviceThreshold = m and float(m.groups()[0]) or 95.0
    if p >= perDeviceThreshold: evt.severity = 5
    break
    --
    James Pulver
    Information Technology Area Supervisor
    LEPP Computer Group
    Cornell University



    dveezy wrote, On 7/30/2009 4:51 PM:

     

     

    How would I edit the alert templates to make the email notification alerts that are sent say

    currentvalue 95%


    for example instead of saying xxxxxx referring to amount of bytes being actually used like it is doing by default?

    Thank you.







    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users

    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users

More Like This

  • Retrieving data ...