[root@wqk1 mnt]# ./check_memory.pl -h

 
check_mem.pl v1.0 - Nagios Plugin
 
usage:
 check_mem.pl -<f|u> -w <warnlevel> -c <critlevel>
 
options:
 -f           Check FREE memory
 -u           Check USED memory
 -C           Count OS caches as FREE memory
 -w PERCENT   Percent free/used when to warn
 -c PERCENT   Percent free/used when critical
 
Copyright (C) 2000 Dan Larsson <dl@tyfon.net>
check_mem.pl comes with absolutely NO WARRANTY either implied or explicit
This program is licensed under the terms of the
GNU General Public License (check source code for details)
 
 
=========================
[root@wqk1 mnt]# ./check_memory.pl -u -w 50 -c 90
WARNING - 66.7% (1372716 kB) used!|TOTAL=2059580KB;;;; USED=1372716KB;;;; FREE=686864KB;;;; CACHES=1181796KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -u -w 60 -c 90
WARNING - 66.7% (1372716 kB) used!|TOTAL=2059580KB;;;; USED=1372716KB;;;; FREE=686864KB;;;; CACHES=1181792KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -u -w 70 -c 90
OK - 66.7% (1372716 kB) used.|TOTAL=2059580KB;;;; USED=1372716KB;;;; FREE=686864KB;;;; CACHES=1181792KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -u -w 40 -c 50
CRITICAL - 66.7% (1372840 kB) used!|TOTAL=2059580KB;;;; USED=1372840KB;;;; FREE=686740KB;;;; CACHES=1181796KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -u -w 40 -c 60
CRITICAL - 66.8% (1374772 kB) used!|TOTAL=2059580KB;;;; USED=1374772KB;;;; FREE=684808KB;;;; CACHES=1181804KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -u -w 40 -c 70
WARNING - 66.7% (1372840 kB) used!|TOTAL=2059580KB;;;; USED=1372840KB;;;; FREE=686740KB;;;; CACHES=1181808KB;;;;
 
 
[root@wqk1 mnt]# ./check_memory.pl -f -w 50 -c 40
CRITICAL - 33.3% (686740 kB) free!|TOTAL=2059580KB;;;; USED=1372840KB;;;; FREE=686740KB;;;; CACHES=1181800KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -f -w 50 -c 30
WARNING - 33.3% (686864 kB) free!|TOTAL=2059580KB;;;; USED=1372716KB;;;; FREE=686864KB;;;; CACHES=1181800KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -f -w 50 -c 20
WARNING - 33.3% (686864 kB) free!|TOTAL=2059580KB;;;; USED=1372716KB;;;; FREE=686864KB;;;; CACHES=1181816KB;;;;
[root@wqk1 mnt]# ./check_memory.pl -f -w 30 -c 20
OK - 33.3% (686740 kB) free.|TOTAL=2059580KB;;;; USED=1372840KB;;;; FREE=686740KB;;;; CACHES=1181828KB;;;;
 
 附脚本: