- Permissions to edit device templates
- Access to zendmd highly recommended
- 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:
The above data point gives us the amount of free (unused) memory available on the system in bytes.
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.