Plugin to check memory usage on linux boxes

Rick Mangus rick.mangus+nagios at gmail.com
Thu Mar 11 15:04:32 CET 2010


On Thu, Mar 11, 2010 at 7:36 AM, Mark Elsen <mark.elsen at gmail.com> wrote:
>> Hi
>>
>> Is there a plugin bundled with nagios-plugins that helps us in checking
>> the memory usage on the linux box. I basically want to know the used
>> memory and the total available , Even if it is given in percentage i am
>> fine. Please let me know if there are plugins to do so.
>>
>> I checked the plugins that come by default in the libexex folder but
>> none are there for checking the memory usage.
>>
>>
>  I use : 'check_snmp_mem' ; yet you have to make sure that the snmp
> configuration file on the targeted
> Linux box, allows access to the MIB Subtree, containing the queried variables.
>
> M.
>
I just use a bash script (passive check) that does the following:

#Get the amount of RAM used
ram_used=`free | grep Mem | awk '{ print $3 }'`

#Get the total amount of RAM
total_ram=`free | grep Mem | awk '{ print $2 }'`

#Calculate the percent of RAM used
percent_ram_used=$((100 * ram_used / total_ram))

#Get the amount of swap used
swap_used=`free | grep Swap | awk '{ print $3 }'`

--Rick

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list