Hi Ben,<br><br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The rabbit_memsup_linux module parses these values out of /proc/meminfo:<br>
'MemTotal', 'MemFree', 'Buffers', 'Cached'<br>
such that<br>
MemUsed = MemTotal - MemFree - Buffers - Cached<br></blockquote></div><br>Thanks for that..<br><br>Hacked up the following script for Nagios so I could keep an eye on memory approaching threshold..<br><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#!/bin/bash</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">STATE_OK=0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">STATE_WARNING=1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">STATE_CRITICAL=2</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">STATE_UNKNOWN=3</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">STATE_DEPENDENT=4</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">MEMTOTAL="`grep "^MemTotal: " /proc/meminfo |\</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> awk '{print $2}'`"</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">MEMFREEEQN="`egrep "^(MemTotal|MemFree|Buffers|Cached):" /proc/meminfo |\</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> awk '{print $1 " " $2}' |\</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> sed -r 's/^MemTotal:/+/g</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> s/^(MemFree|Buffers|Cached):/-/g'`"</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">MEMFREE="$(( ${MEMFREEEQN} ))"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">MEMPCFREE="$(( ( ${MEMFREE} * 100 ) / ${MEMTOTAL} ))"</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">MEMPCFREECRIT=5</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">MEMPCFREEWARN=10</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if [ ${MEMPCFREE} -gt ${MEMPCFREEWARN} ]; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> echo "OK: ${MEMFREE} (${MEMPCFREE}%) > ${MEMPCFREEWARN}% free"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> exit $STATE_OK</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">elif [ ${MEMPCFREE} -gt ${MEMPCFREECRIT} ]; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> echo "WARNING: ${MEMPCFREECRIT}% < ${MEMFREE} (${MEMPCFREE}%) < ${MEMPCFREEWARN}%"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> exit $STATE_WARNING</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">elif [ ${MEMPCFREE} -le ${MEMPCFREECRIT} ]; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> echo "CRITICAL: ${MEMFREE} (${MEMPCFREE}%) <= ${MEMPCFREECRIT}%"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> exit $STATE_CRITICAL</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">fi</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">echo "UNKNOWN: Something went awry!"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">exit $STATE_UNKNOWN</span><br><br>This'll let me go hunt down issues before they start causing throttle problems. In the event others are interested, this is the quick check I use to see if AMQP daemon is contactable in Nagios...<br>
<br><span style="font-family: courier new,monospace;">define command{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> command_name check_amqp</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 5672 -d 1 -E -s 'AMQP\r\n\r\n\r\n' -e 'AMQP'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br><br>(Wait 1 second, send "AMQP" followed by three EOL sequences and expect the string "AMQP" returned)<br><br>