We gave up on this and no longer monitor any memory on linux boxes. Instead we monitor the state of SWAP. As long as that isn't being used much then we do not care at all about the memory usage.
I'm about to give up on Zenoss all together because of this annoying bug. Come on now. If you are always going to report red on all my linux boxes, then what is the point of monitoring? And adding the ignore is not the answer for we rely on the memory monitoring for leaks.
This is working perfect for me. I've used this in "/Events/Perf/Snmp" transform.
m = re.search("threshold of [^:]+: current value ([\d\.]+)", evt.message)
if m and device:
fbc = device.hw.memAvailReal + device.hw.memBuffer + device.hw.memCached
total = device.hw.totalMemory
tot_25pc = (total * 25)/100
if fbc < tot_25pc:
evt._action = "drop"
How can this work? As far as I can see the various memory data points gathered via SNMP are not accessible via zendmd, and thus not accessible from within an event transform.
For example, trying to access device.hw.memAvailReal in an event transform results in...
Problem on line 5: AttributeError: memAvailReal
the same for any given linux server in zendmd:
Traceback (most recent call last):
File "<console>", line 1, in <module>
Are you sure this is working? Is there something I'm missing?
Sorry for opening this thread again, but to me it seems this problem still isn't solved: Zenoss cannot monitor the real memory usage of a Linux installation. This is really annoying.
Even though it is quite easy to with a formula like this (assuming 90% memory usage is your threshold):
memAvailReal + memBuffer + memCached > memTotalReal * 0,1
The problem here is the left side of this fomula: is there any way to combine several datapoints in an alias or something like that?
I looked into this fairly extensively and from what I can gather, there is no way for the zenoss snmp performance engine to perform operations across values obtained by polling multiple OIDs. As such, there's no out-of-the box way to perform the required equation.
In the end, I wrote a python script that collects the various values via snmp and derives the actual memory usage. I use a command data source to run this against my linux servers.
If it would be useful I can create a zenpack that pulls together my script, the command data source and the graph output?
You can do this one of three ways.
1) Ryan Mattes comibined datasource zenpack. Don't use this in medium or larger scenarios.
2) Write a command datasource that fetches the values and adds them as needed
3) Write a script that gets the added values and puts them in a custom oid. Poll this oid.
James, Shane, thanks for you suggestions!
James, if you have a script in place and can make a Zenpack from it, that would be great.
Also checked out the 'Forumla Data Source' from Ryan Mattes that Shane suggested and that looks like a good suggestion as well, although this might not work on 3.2.1 (which I use) and be kinda hard on the Zenoss server.
I'll try both.
You can use my script, for monitoring Memory or swap percentage used...
Example how to use the script below...
zenoss@localhost:/usr/local/zenoss/zenoss/libexec$ python getMemPercentage.py -d server1
OK |swapPercentageAvail=96 swapPercentageUsed=3 memPercentageAvail=30 memPercentageUsed=69