Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MemFree is misleading
#1
Hello everybody ,
i've started the memfree alarm for a debian agent . I noticed that alarm is triggered although i see only a few process on server .
I think that command in agent is not correctly : "cat /proc/meminfo | grep MemFree | awk '{ print $2 }'" because memory management in linux is not critical if this value is low .

I suggest "free -m | grep buffers/cache | awk '{print $4}'"

What do you think ?
 Reply
#2
Hi.

Ok. I send your information to my jobmates for to study and they will made the changes.

Bye.
 Reply
#3
Hi again.

I test in my machine with run a virtualbox (this program use much memory) and without this program:

Code:
[email protected]:~$ cat /proc/meminfo | grep MemFree
MemFree:           33120 kB
[email protected]:~$ cat /proc/meminfo | grep MemFree
MemFree:         1274172 kB
[email protected]:~$

And the value go down when the machine have less memory.
 Reply
#4
What I'm trying to say although my English is not the best, is that the value you are seeking is not a critical situation.
 Reply
#5
Ok. I have talk with jobmates and you are right. Because the memory in GNU/Linux is management in other priorities and the system may take all memory but it is free.

I have add this changes in the "Pending Task" tracker of project in the SourceForge:

https://sourceforge.net/tracker/?func=de...id=1226163

But at the moment you could change the line for you correct line in your system.

Thanks.
 Reply
#6
Hi guys.

  I use this modules to monitor the memory, and they are pretty usefull to me.

-----------------------------------------------------------------------------------------------
# Memory Session
module_begin
module_name memfree
module_type generic_data
module_exec free |grep "buffers/cache" | awk {'print $4'}
module_description Free memory
module_end

module_begin
module_name memused
module_type generic_data
module_exec free |grep "buffers/cache" | awk {'print $3'}
module_description Used memory
module_end

module_begin
module_name mem_comm
module_type generic_data
module_exec cat /proc/meminfo | grep "Committed_AS:"  | awk '{ print $2 }'
module_description Commited memory
module_end

module_begin
module_name mem_swpin
module_type generic_data
module_exec cat /home/pandora/swp.txt |grep "Average" | awk '{ print $2 }'
module_description Total swap pages in per second
module_end

module_begin
module_name mem_swpout
module_type generic_data
module_exec cat /home/pandora/swp.txt |grep "Average" | awk '{ print $3 }'
module_description Total swap pages out per second
module_end
-----------------------------------------------------------------------------------------------

My alerts are set based on sar -W (for page faults). This is used when the memory is over and the system starts to swaping (using virtual memory).


The script I use to run sar and generate the swp.txt is cpu.sh:

-----------------------------------------------------------------------------------------------
#!/bin/bash
# Versao 1.0
# Script para recuperar a media de processamento
# dos ultimos 5 minutos.
MIN=$(date +%M)
HOR=$(date +%H)
MSA=$(date -d "5 minutes ago" +%M)
HSA=$(date -d "5 minutes ago" +%H)
CPU=$(echo "/home/pandora/cpu.txt")
SWP=$(echo "/home/pandora/swp.txt")

# O script repete o ultimo valor obtido a meia noite
if [ $HOR -eq 0 ] && [ $MIN -lt 5 ]; then
        #Nao atualiza os arquivos cpu e swp e finaliza script
        cat $CPU
        exit
fi

# Ajuste para uso do sar com valores com 2 digitos
INICIO=$(printf "%s:%s:00" $HSA $MSA)
FIM=$(printf "%s:%s:00" $HOR $MIN)

sar -s $INICIO -e $FIM > $CPU
sar -W -s $INICIO -e $FIM > $SWP
cat $CPU
-----------------------------------------------------------------------------------------------

I call the script at the first module in pandora, so the result in cpu.txt and swp.txt are ready for the other modules.

-----------------------------------------------------------------------------------------------
# SAR Session
module_begin
module_name cpu_sar_user
module_type generic_data
module_exec /home/pandora/cpu.sh | grep Average |awk '{ print $3 }'
module_description CPU sar used by Users
module_end
-----------------------------------------------------------------------------------------------


This script has a flaw for the first value of the day, but this is not a problem to me.

I hope this helps. Sorry for the loooong post ;-)

Regards.
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes