From owner-freebsd-questions@FreeBSD.ORG Sun Jun 29 20:33:59 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34E2F1065673 for ; Sun, 29 Jun 2008 20:33:59 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from unsane.co.uk (unsane-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:110::2]) by mx1.freebsd.org (Postfix) with ESMTP id 91B5A8FC12 for ; Sun, 29 Jun 2008 20:33:58 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from crab.unsane.co.uk (crab.unsane.co.uk [10.0.0.111]) (authenticated bits=0) by unsane.co.uk (8.14.0/8.14.0) with ESMTP id m5TKXhom015837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Jun 2008 21:33:43 +0100 (BST) (envelope-from jhary@unsane.co.uk) Message-ID: <4867F16D.3000700@unsane.co.uk> Date: Sun, 29 Jun 2008 21:32:45 +0100 From: Vince Hoffman User-Agent: Thunderbird 2.0.0.14 (X11/20080623) MIME-Version: 1.0 To: "Diego F. Arias R." References: <3b93bd110806290517k2050b114g984b9e4186a3beda@mail.gmail.com> In-Reply-To: <3b93bd110806290517k2050b114g984b9e4186a3beda@mail.gmail.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Problem With ZFS script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2008 20:33:59 -0000 Diego F. Arias R. wrote: > Hi: > > Im testing the new ZFS feature on freebsd. On the page i got a script > to monitor kernel memory but the script dont works. > --------------------------------------------------------------------------------------------------------------------------------------------------- > #!/bin/sh - > > TEXT=kldstat | tr a-f A-F | awk 'BEGIN {print "ibase=16"}; NR > 1 > {print $4}' | bc | awk '{a+=$1}; END {print a}' > DATA=vmstat -m | sed 's/K//' | awk '{a+=$3}; END {print a*1024}' > TOTAL=echo $DATA $TEXT | awk '{print $1+$2}' > > echo TEXT=$TEXT, echo $TEXT | awk '{print $1/1048576 " MB"}' > echo DATA=$DATA, echo $DATA | awk '{print $1/1048576 " MB"}' > echo TOTAL=$TOTAL, echo $TOTAL | awk '{print $1/1048576 " MB"}' > --------------------------------------------------------------------------------------------------------------------------------------------------- > > link: > > http://wiki.freebsd.org/ZFSTuningGuide > > > > the error i got is > > freebsd# ./kernmem.sh > > -m: not found > > try ---------------------- #!/bin/sh - TEXT=$(kldstat | tr a-f A-F | \ awk 'BEGIN {print "ibase=16"}; NR > 1 {print $4}'\ | bc | awk '{a+=$1}; END {print a}') DATA=$(vmstat -m | sed 's/K//' | awk '{a+=$3}; END {print a*1024}') TOTAL=$(echo "$DATA $TEXT" | awk '{print $1+$2}') echo "TEXT=$TEXT, $(echo $TEXT | awk '{print $1/1048576 " MB"}')" echo "DATA=$DATA, $(echo $DATA | awk '{print $1/1048576 " MB"}')" echo "TOTAL=$TOTAL, $(echo $TOTAL | awk '{print $1/1048576 " MB"}')" ------------------------------------------------------ Looks like the wiki stripped some formatting. Vince > > Thanks.