From owner-freebsd-questions@FreeBSD.ORG Sun Sep 17 16:17:27 2006 Return-Path: X-Original-To: freebsd-questions@FreeBSD.ORG Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0516116A417 for ; Sun, 17 Sep 2006 16:17:27 +0000 (UTC) (envelope-from phoffman@proper.com) Received: from balder-227.proper.com (Balder-227.Proper.COM [192.245.12.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E07243D7C for ; Sun, 17 Sep 2006 16:17:25 +0000 (GMT) (envelope-from phoffman@proper.com) Received: from [10.20.30.177] (dsl-63-249-108-169.cruzio.com [63.249.108.169]) (authenticated bits=0) by balder-227.proper.com (8.13.5/8.13.5) with ESMTP id k8HGHMla021678 for ; Sun, 17 Sep 2006 09:17:24 -0700 (MST) (envelope-from phoffman@proper.com) Mime-Version: 1.0 Message-Id: Date: Sun, 17 Sep 2006 09:17:13 -0700 To: freebsd-questions@FreeBSD.ORG From: Paul Hoffman Content-Type: text/plain; charset="us-ascii" ; format="flowed" Cc: Subject: Getting a specific value from netstat 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, 17 Sep 2006 16:17:27 -0000 Greetings again. If I do a 'netstat -I em0 -b', I get: Name Mtu Network Address Ipkts Ierrs Ibytes Opkts Oerrs Obytes Coll em0 1500 00:0e:0c:67:c8:04 93555198 0 2179562966 114493253 0 723565977 0 em0 1500 fe80:1::20e:c fe80:1::20e:cff:f 0 - 0 4 - 288 - em0 1500 192.245.12 Balder-227 35399016 - 1770283188 114484197 - 3415268168 - em0 1500 192.245.12.22 Balder-228 27063120 - 1655024896 0 - 0 - em0 1500 192.245.12.22 Balder-229 47427840 - 3954775975 18975500 - 2445620452 - What I care about is the number of input and output bytes (in this case, 2179562966 and 723565977). I can write a short Perl script to parse the netstat output, but I would rather just get the numbers directly from the OS. Are these values available without going through netstat?