From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 8 22:54:58 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB6AD106564A for ; Wed, 8 Dec 2010 22:54:58 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 96FBB8FC1F for ; Wed, 8 Dec 2010 22:54:58 +0000 (UTC) Received: by qwj9 with SMTP id 9so1827406qwj.13 for ; Wed, 08 Dec 2010 14:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8t1bnXqc5Bvt76jvaC5kzpjDKzucOoQx5hN92unOgnM=; b=az7T5vtvt9FqegSoJg5ytPAnkGVf0iduDCthzOcra1lIXxb+eo/T2WKjYY6l3b0rhd EjbF29cx0UFCuJr1xbXMn8KASPizZqXrQM18nlhZ4/XjRZ1AduAocNo7cvq1vNWnBpAA EL/+X7kAVypKIKT/nZLZXa22vPyZ4q8VLOGwQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=pfhbWwN3azlOaXe21MW5UmKAO7RCrbrukxfNxzG183np3VLwQqxKC/S7TEghUfQK9h Bxu//rJ0SuWQu+H2ojduEFoAc7Z8DgXn+f/EKe4ueelim5400TgNRbqAx3iopORZPRlN HZT4fnfAduRV/NfbHmZbC330bCjYM62dJhuII= MIME-Version: 1.0 Received: by 10.229.248.142 with SMTP id mg14mr7490504qcb.26.1291848897657; Wed, 08 Dec 2010 14:54:57 -0800 (PST) Received: by 10.229.91.135 with HTTP; Wed, 8 Dec 2010 14:54:57 -0800 (PST) In-Reply-To: <4D000448.1050606@telenix.org> References: <4D000448.1050606@telenix.org> Date: Wed, 8 Dec 2010 14:54:57 -0800 Message-ID: From: Matthew Fleming To: Chuck Robey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD-Hackers Subject: Re: getting a list of open files versus PID nos.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 22:54:58 -0000 On Wed, Dec 8, 2010 at 2:18 PM, Chuck Robey wrote: > I think, *maybe* that I have located what's been giving me all of those > machine lockups. =A0I was all ready to replace the mobo & cpu when I noti= ced a > panic error of being out of open files. =A0The message suggested just add= ing > the ability for more open files, but if it's what I think it is, that wou= ld > only mean it would take longer to panic, but it would still be tossing > panics at me. > > What I want to see is a list of all Pids and how many open files there ar= e > associated with each Pid? =A0And maybe a "ps ax" list, so I can associate= an > application with a pid. =A0I would set things up so it would do this ever= y 15 > minutes, and it might just point me at my real problem here. > > Any idea what would be the best way to get a list of all openfiles versus > each open pid? =A0I would be happy to write up a python script to give me > application versus count of open files list, if I could start with that > files versus pids thing. This is what lsof is for. I believe there's one in ports, but I have never tried it. Cheers, matthew