From owner-freebsd-questions@FreeBSD.ORG Mon Apr 21 10:53:26 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7E681065671 for ; Mon, 21 Apr 2008 10:53:26 +0000 (UTC) (envelope-from pobox@verysmall.org) Received: from uranos.boku.ac.at (uranos.boku.ac.at [141.244.180.250]) by mx1.freebsd.org (Postfix) with ESMTP id 640CC8FC29 for ; Mon, 21 Apr 2008 10:53:26 +0000 (UTC) (envelope-from pobox@verysmall.org) Received: by uranos.boku.ac.at (Postfix, from userid 1001) id 390BA33817D; Mon, 21 Apr 2008 12:28:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on uranos.boku.ac.at X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.4 Received: from localhost (localhost [127.0.0.1]) by uranos.boku.ac.at (Postfix) with ESMTP id 11065338174 for ; Mon, 21 Apr 2008 12:28:15 +0200 (CEST) Received: from uranos.boku.ac.at ([127.0.0.1]) by localhost (uranos.boku.ac.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07228-04 for ; Mon, 21 Apr 2008 12:28:13 +0200 (CEST) Received: from [141.244.63.108] (unknown [141.244.63.108]) by uranos.boku.ac.at (Postfix) with ESMTP id 6B085338165 for ; Mon, 21 Apr 2008 12:28:13 +0200 (CEST) Message-ID: <480C6B37.4@verysmall.org> Date: Mon, 21 Apr 2008 12:23:51 +0200 From: "pobox@verysmall.org" User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: FreeBSD Questions Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: powered by ZID at uranos.boku.ac.at Cc: Subject: getting iostat -x %b with php 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: Mon, 21 Apr 2008 10:53:26 -0000 I am trying to add performance monitor to a php application working on a dedicated server and one of the informations I would like to collect is the hard drives load, which, as far as I could find out, can be seen in the %b of iostat -x. What would be the most reliable way to extract this information with php? I could imagine that I can exec() the iostat -x - but I am not sure about the best way to parse the iostst -x output, so that I get exactly this number. For instance, can I rely that %b is aways the Nth column in the answer? - then I could do it with regex. Iv