Fixed UOM in bytes finaly for performance data
root

root commited on 2011-01-17 16:16:51
Showing 1 changed files, with 5 additions and 5 deletions.

... ...
@@ -25,8 +25,8 @@ CS=`echo $4|cut -d',' -f2`
25 25
 RET=0
26 26
 MSG=""
27 27
 
28
-MT=`free|grep Mem|awk '{print $2}'`
29
-MU=`free|grep Mem|awk '{print $3-$7}'`
28
+MT=`free -b|grep Mem|awk '{print $2}'`
29
+MU=`free -b|grep Mem|awk '{print $3-$7}'`
30 30
 if [ "$MT" == "0" -o "$MT" == "" ]
31 31
 then
32 32
 	echo "CRITICAL - Can't read memory informations"
... ...
@@ -46,8 +46,8 @@ MSG="Mem : $MR% used"
46 46
 
47 47
 if [ $SWAP -eq 1 ]
48 48
 then
49
-	ST=`free|grep Swap|awk '{print $2}'`
50
-	SU=`free|grep Swap|awk '{print $3}'`
49
+	ST=`free -b|grep Swap|awk '{print $2}'`
50
+	SU=`free -b|grep Swap|awk '{print $3}'`
51 51
 	if [ "$ST" == "0" -o "$ST" == "" ]
52 52
 	then
53 53
 	        echo "CRITICAL - Can't read memory informations"
... ...
@@ -70,7 +70,7 @@ let MWV=MT*WM/100
70 70
 let MCV=MT*CM/100
71 71
 let SWV=ST*WS/100
72 72
 let SCV=ST*CS/100
73
-MSG="$MSG | mem=${MU}KB;$MWV;$MCV;0;$MT swap=${SU}KB;$SWV;$SCV;0;$ST"
73
+MSG="$MSG | mem=${MU}B;$MWV;$MCV;0;$MT swap=${SU}B;$SWV;$SCV;0;$ST"
74 74
 
75 75
 [ $RET -eq 2 ] && echo "CRITICAL - $MSG" && exit 2
76 76
 [ $RET -eq 1 ] && echo "WARNING - $MSG" && exit 1
77 77