<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://cocnm.computerisms.ca/index.php?action=history&amp;feed=atom&amp;title=%2Fusr%2Flocal%2Fnagios%2Flibexec%2Fcheck_mem_usage</id>
	<title>/usr/local/nagios/libexec/check mem usage - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://cocnm.computerisms.ca/index.php?action=history&amp;feed=atom&amp;title=%2Fusr%2Flocal%2Fnagios%2Flibexec%2Fcheck_mem_usage"/>
	<link rel="alternate" type="text/html" href="http://cocnm.computerisms.ca/index.php?title=/usr/local/nagios/libexec/check_mem_usage&amp;action=history"/>
	<updated>2026-11-14T11:56:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://cocnm.computerisms.ca/index.php?title=/usr/local/nagios/libexec/check_mem_usage&amp;diff=157&amp;oldid=prev</id>
		<title>Bob: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://cocnm.computerisms.ca/index.php?title=/usr/local/nagios/libexec/check_mem_usage&amp;diff=157&amp;oldid=prev"/>
		<updated>2013-09-19T06:19:56Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Creditation==&lt;br /&gt;
*http://blog.vergiss-blackjack.de/wp-uploads/2010/04/check_memory.txt&lt;br /&gt;
&lt;br /&gt;
==Script==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Nagios plugin to check memory consumption&lt;br /&gt;
# Excludes Swap and Caches so only the real memory consumption is considered&lt;br /&gt;
&lt;br /&gt;
source /usr/local/nagios/libexec/utils.sh&lt;br /&gt;
&lt;br /&gt;
# set default values for the thresholds&lt;br /&gt;
WARN=90&lt;br /&gt;
CRIT=95&lt;br /&gt;
&lt;br /&gt;
while getopts &amp;quot;c:w:h&amp;quot; ARG; do&lt;br /&gt;
	case $ARG in&lt;br /&gt;
		w) WARN=$OPTARG;;&lt;br /&gt;
		c) CRIT=$OPTARG;;&lt;br /&gt;
		h) echo &amp;quot;Usage: $0 -w &amp;lt;warning threshold&amp;gt; -c &amp;lt;critical threshold&amp;gt;&amp;quot;; exit;;&lt;br /&gt;
	esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
MEM_TOTAL=`free | fgrep &amp;quot;Mem:&amp;quot; | awk &amp;#039;{print $2}&amp;#039;`;&lt;br /&gt;
MEM_USED=`free | fgrep &amp;quot;/+ buffers/cache&amp;quot; | awk &amp;#039;{print $3}&amp;#039;`;&lt;br /&gt;
&lt;br /&gt;
PERCENTAGE=$(($MEM_USED*100/$MEM_TOTAL))&lt;br /&gt;
echo &amp;quot;${PERCENTAGE}% ($((($MEM_USED)/1024)) of $((MEM_TOTAL/1024)) MB) used&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
if [ $PERCENTAGE -gt $CRIT ]; then&lt;br /&gt;
	exit $STATE_CRITICAL;&lt;br /&gt;
elif [ $PERCENTAGE -gt $WARN ]; then&lt;br /&gt;
	exit $STATE_WARNING;&lt;br /&gt;
else&lt;br /&gt;
	exit $STATE_OK;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bob</name></author>
	</entry>
</feed>