How To Create Advanced Thresholds


  • Permissions to edit device templates
  • Access to zendmd highly recommended

Applies To

  • Zenoss 4.2.x
  • Zenoss 4.1.1
  • Zenoss 4.1.0
  • Zenoss 4.0.2


It is often necessary to set up a threshold based on a percentage instead of a raw value. To do this, we need two things:

  • The current value
  • Either the minimum or maximum value possible

Because component templates provide us with some of these minimum or maximum values, it is relatively easy to accomplish in some cases. The information needs to be called from wherever it exists in the object database.


Component Template Example:

Component templates provide us with a lot of valuable information that we can use in creating thresholds. One of the most common thresholds that support is asked to assist in creating is memory utilization based on percentage. In this example, we're using a device in the /Server/SSH/Linux device class. We have a few relevant data points available, both for different things:

  • mem.MemFree

    The above data point gives us the amount of free (unused) memory available on the system in bytes.

  •  mem.SwapFree

    The above data point gives us the amount of free (unused) swap available on the system in bytes.

We can create a threshold based on memory or swap utilization using the maximum values that the component template gathers during modeling. To create a threshold that generates an event based on utilization of either memory or swap, create a MinMaxThreshold based off whichever data point you want to use, and then set the threshold's minimum or maximum include attribute that the component template gathered.

For this example, setting the Minimum value of a threshold based on the data point MemFree to be 10% of the total memory looks like this:

here.hw.totalMemory * .1

The above line references here.hw.totalMemory -- an attribute in the object database that was gathered by the component template during modeling. At the beginning, "here" refers to the device being monitored. The "hw" organizer exists in the object database, and "totalMemory" is one of the attributes stored in it. The "totalMemory" attribute is the total installed physical memory of the system in bytes. We want to multiply it by ".1" to get 10% of the maximum memory. That way, if the memory available drops below 10% of total, we get an event.

We can do the same for swap:

here.os.totalSwap * .1

Note that the above line references a different organizer, os, from which the value totalSwap is pulled.


Was this article helpful?
1 out of 2 found this helpful


  • Avatar
    Larry Ouellette

    Where do you get the hw.totalMemory and os.totalSwap data names from? What object database? How can I see the names of all the objects in the object database? I used here.hw.totalMemory * .49 to set a threshold for a max of 50% total memory used, and it generates an event saying 100% of memory is used. Where is any and all of these object datapoints documented? the zope link in the 425 documentation is defunct, as is the entire wiki for zope.

  • Avatar
    Matthew Burley

    Was the previous question ever answered as I am wondering the same, where can I check against a list of data names?

  • Avatar
    Larry Ouellette

    No, it was never answered. A table of the object database names and datatypes would be a great help.

  • Avatar
    Ben Lefor


Powered by Zendesk