Commit 7867104b authored by mape2k's avatar mape2k
Browse files

Fix output parsing (changed with procps 3.3.10)


git-svn-id: https://subversion.fem.tu-ilmenau.de/repository/nagios@36 0c029375-f9a5-47ba-aa0c-8883c34e326a
parent 2c8205f8
......@@ -2,8 +2,8 @@
#
# RAM usage monitor plugin for Nagios
# Written by Vinicius de Figueiredo Silva (viniciusfs@gmail.com)
# Modified by Sascha Bendix (scrubb@localroot.de)
# Last Modified: 27-11-2007
# Modified by Sascha Bendix (scrubb@localroot.de) and Marcel Pennewiss (opensource@pennewiss.de)
# Last Modified: 14-12-2015
#
# Usage: ./check_ram <warning> <critical>
#
......@@ -77,7 +77,7 @@ OS=`uname -a | awk '{ print $1 }'`
case "$OS" in
Linux)
RAM_TOTAL=`free -m | grep -i mem | awk '{ print $2 }'`
RAM_INUSE=`free -m | grep -i 'buffers/cache' | awk '{ print $3 }'`
RAM_INUSE=`free -m | grep -i -E '(buffers/cache|Mem)' | tail -n1 | awk '{ print $3 }'`
;;
SunOS)
RAM_TOTAL=`prtconf | grep ^"Memory size" | awk '{print $3}'`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment