[BACK]Return to check_amap CVS log [TXT][DIR] Up to [local] / nagios / check_amap

File: [local] / nagios / check_amap / check_amap (download)

Revision 1.1, Tue Feb 16 16:47:13 2010 UTC (14 years, 2 months ago) by andrew
Branch: MAIN
CVS Tags: HEAD

add some more checks to CVS, not important checks, but they should be here anyway

#!/bin/sh
. /usr/local/libexec/nagios/utils.sh

_sizes=`vmstat -m | awk '/^ *UVM amap/ { gsub("K", " "); print $4  " " $6}'`
_free=`dc -e "3 k 1 ${_sizes} / - 100 * p"`

if [ ${_free%.*} -lt 25 ]; then
	echo WARNING: less than 25% amap free [${_free}%]!
	exit $STATE_WARNING
fi

if [ ${_free%.*} -lt 10 ]; then
	echo CRITICAL: less than 10% amap free [${_free}%]!
	exit $STATE_CRITICAL
fi

echo OK: [${_free}%] free
exit $STATE_OK