report really available memory

ged

09-11-2004 20:32:20

Hi,

How can I get the REAL available memory to be logged ?

I've setup netmrg, and I'm getting the default memAvailReal.0 report.

However that reports that I have only a few KB available,
although I've 1GB in my linux, and almost nothing is running.
This is due to the caches that use all the available memory.

[quote465b829d8f]UCD-SNMP-MIBmemTotalSwap.0 = INTEGER 4192956
UCD-SNMP-MIBmemAvailSwap.0 = INTEGER 4154272
UCD-SNMP-MIBmemTotalReal.0 = INTEGER 1016828
UCD-SNMP-MIBmemAvailReal.0 = INTEGER 49584
UCD-SNMP-MIBmemTotalFree.0 = INTEGER 4203856
UCD-SNMP-MIBmemMinimumSwap.0 = INTEGER 16000
UCD-SNMP-MIBmemShared.0 = INTEGER 0
UCD-SNMP-MIBmemBuffer.0 = INTEGER 254288
UCD-SNMP-MIBmemCached.0 = INTEGER 403912[/quote465b829d8f]

How can I get the value (memAvailReal + memBuffer + memCached ) to be logged instead of just memAvailReal ?
I don't want a graph that sums all three individual graphs. I'm looking for a way to have a unique value reported.

Thanks,

silfreed

09-11-2004 21:42:14

First things, the values UCD and Net-SNMP report are in Kilobytes to begin with, so this throws things off (unless you multiply by 1024).
Next, can you check what your box actually reports when you run 'free'? Commonly there is very little 'real' memory available in linux because the kernel will use free memory as disk buffers.

-Doug

balleman

10-11-2004 09:44:07

Why don't you want to do a summed graph of the three values? If you want to trigger events based on the value, that would be a problem. However, as far as efficiency of gathering and rendering the three values instead of one, I don't think it will be appreciable in most situations.

ged

10-11-2004 16:41:36

[quote8d004af1cc="silfreed"]Commonly there is very little 'real' memory available in linux because the kernel will use free memory as disk buffers.[/quote8d004af1cc]

What's the point of reporting a [b8d004af1cc]meaningless[/b8d004af1cc] value ?
As there is very little real memory available because everything which is available is taken by the caches, I'm interested by what could be available to my application.

A linux system is always going to report that there is just a few KB really free. But there is a huge difference between the memory is taken by caches, and the memory is taken by an application (and adding another application would send the machine into swapping hell).

What I want to now is how much memory [b8d004af1cc]could[/b8d004af1cc] be available for an application.
Or the opposite is true too
I bought 1024*1024KB of RAM which is my available resource. How much of that am I using (and caching disk is [b8d004af1cc]not[/b8d004af1cc] considered an use) ?


Let me rephrase my question in different ways

A) How can I filter the SNMP values by a gathering filter ? Let's imagine I want to store the substraction of two SNMP values ?

B) if not, How can I write a custom collecting script ?
I've read the manual and searched the forum, but I'm still a bit lost when it comes to How do I plug in my own reporting script into your tool.

Thanks for helping a newbie.

balleman

10-11-2004 17:10:08

[quotefd52d4bf4d="ged"]
What's the point of reporting a [bfd52d4bf4d]meaningless[/bfd52d4bf4d] value ?
[/quotefd52d4bf4d]

That's a question best left for the kernel and net-snmp developers. Not much we can do about it.

[quotefd52d4bf4d="ged"]
A) How can I filter the SNMP values by a gathering filter ? Let's imagine I want to store the substraction of two SNMP values ?
[/quotefd52d4bf4d]

NetMRG currently does not have a method for this

[quotefd52d4bf4d="ged"]
B) if not, How can I write a custom collecting script ?
I've read the manual and searched the forum, but I'm still a bit lost when it comes to How do I plug in my own reporting script into your tool.
[/quotefd52d4bf4d]

Write a script that outputs a single line containing only the numeric value you want gathered. Add this as a "Standard Out" script, and add monitors accordingly. Various things can be passed as parameters to the script, including hostname and SNMP read community. For a large installation, this will not be very efficient since a script spawns a lot (a shell to run in, an interpreter to parse the script, various snmpget commands, etc). Hence, the suggestion is to graph the quantities you don't care about and sum them on the graph to get the quantity you do care about.

[quotefd52d4bf4d="ged"]
Thanks for helping a newbie.[/quotefd52d4bf4d]

No problem, I just hope this helps ;)