From owner-freebsd-questions@FreeBSD.ORG Fri Aug 4 01:44:29 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 0D06716A4DF for ; Fri, 4 Aug 2006 01:44:29 +0000 (UTC) (envelope-from nikolas.britton@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.FreeBSD.org (Postfix) with ESMTP id 644D643D45 for ; Fri, 4 Aug 2006 01:44:28 +0000 (GMT) (envelope-from nikolas.britton@gmail.com) Received: by nf-out-0910.google.com with SMTP id n15so1269345nfc for ; Thu, 03 Aug 2006 18:44:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X4tZGxOLjqpCxxBMVI3+coIlsUZMLTPistcgOfYG1REmIxr5VzsGhgxfi9gJ6mCkN1QwSZPGUqkGFPLMro/O8Zp5OVVgJ0QH5xuzRrz8e+q92skbxuMV/7woF2I6lvBo1dooIN2BakosiMf9d6yraaTW4KDjDrH0rFicyJKzcCk= Received: by 10.78.170.6 with SMTP id s6mr1378354hue; Thu, 03 Aug 2006 18:44:27 -0700 (PDT) Received: by 10.78.143.11 with HTTP; Thu, 3 Aug 2006 18:44:26 -0700 (PDT) Message-ID: Date: Thu, 3 Aug 2006 20:44:26 -0500 From: "Nikolas Britton" To: "Antony Mawer" In-Reply-To: <44D29220.1000807@mawer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060728164526.E27679@ganymede.hub.org> <44D0F2FE.9020507@dial.pipex.com> <20060802203604.A6529@ganymede.hub.org> <44D153D0.9000304@webanoide.org> <87wt9qzh2i.fsf@photon.homelinux.org> <20060803011653.G6529@ganymede.hub.org> <44D1A866.2030206@mawer.org> <20060803154705.X6529@ganymede.hub.org> <44D29220.1000807@mawer.org> Cc: Xiao-Yong Jin , freebsd-questions@freebsd.org, User Freebsd Subject: Re: Gotta start somewhere ... how many of us are really out there? 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: Fri, 04 Aug 2006 01:44:29 -0000 On 8/3/06, Antony Mawer wrote: > On 4/08/2006 4:58 AM, User Freebsd wrote: > > Getting a list of devices is actually pretty easy, and I've tried this > > on my 4.x machines also, so it isn't something that will be a problem on > > older versions: > > > > # pciconf -l > > chip0@pci0:0:0: class=0x060000 card=0x00000000 chip=0x700c1022 rev=0x20 > > hdr=0x00 > ... > > And, more specifically, we can get: > > > > # pciconf -l -v > > asr0@pci0:9:0: class=0x010400 card=0xc0351044 chip=0xa5111044 rev=0x01 > > hdr=0x00 > > vendor = 'Adaptec (Formerly: Distributed Processing Technology > > (DPT))' > > device = 'Raptor SmartRAID Controller' > > class = mass storage > > subclass = RAID > > All of the expanded 'vendor', 'device', 'class' and 'subclass' > information is present in the non -v version of the command output. The > numbers shown earlier can be used to derive the text information: > > class=0x010400 > determines the class/subclass lines, using the table from here: > http://fxr.watson.org/fxr/source/dev/pci/pci.c#L1340 > > card=0xc0351044 chip=0xa5111044 > these make up the vendor and device lines, using the list in > /usr/share/misc/pci_vendors (which is derived from the PCIDEVS.TXT > listing). > > The last 4 hex digits of the card and chip lines are the vendor ID > while the first 4 are the device ID. The card is often given by > the vendor, while the chip identifies the actual part it uses to > implement functionality. For instance, a Netcomm ethernet NIC may > use a Realtek 8139 chip... so chip gives us the fact it's > essentially a generic Realtek chipset, while the card tells us the > vendor who manufactured the card & perhaps their name for it. > > In short, there's no reason to have to transmit all the text names back > to any server -- this can all be resolved at the server end, > > > > > So, with that one command, we can get a fair amount of hardware > > information ... but, how to feed that into a proper HTTP request? > > Storing all of that information would be cool, cause then we could build > > reports based on device driver / vendor / device / class and subclass > > ... but that might be a bit heavy to do in an HTTP request, no? I take > > it email isn't an option, in your case? > > Email may be a viable alternative -- one concern with email is that > various organisations SMTP servers blast their own disclaimer message > and so on across the bottom of all out-going emails, which might > complicate parsing of it on the server end. > > If you're only encoding purely the numeric details, this would make the > information far lighter to transmit than having the whole text blurb. > Just the pciconf -l version as-is: > > ~$ pciconf -l|wc -c > 1545 > > So that's ~1500 bytes. Now strip out all the unnecessary text - the > class=, card=, chip=, rev=, hdr=, extra spaces... something like: > > mpt0@pci2:5:0: 010000 34358086 00301000 08 00 > mpt1@pci2:5:1: 010000 34358086 00301000 08 00 > em0@pci3:4:0: 020000 10798086 10798086 03 00 > em1@pci3:4:1: 020000 10798086 10798086 03 00 > > ~$ cat pciconf-stripped | wc -c > 899 > > We've nearly halved the size of the information. Now it's still in > ASCII, so you could further shave bits off by converting that to binary > if you wanted to... > > > With that amount of information, you'd probably be more inclined to want > to use HTTP POST than HTTP GET. A quick glance suggests libfetch(3) > doesn't support this; I haven't looked at the code enough to see if > adding support for it would be trivial or not. > 899 bytes * (10^7) = 8.37258995 gigabytes... Remember... Once this code is pushed out to hosts you can't change it. 10 years from now we'll still have hosts sending in old data.... What was wrong with my netcat idea? uname -mr | nc statistics.freebsd.org 1234 It's one, short, line of code and you know exactly what it's doing. Simple, Easy, Done. -- BSD Podcasts @: http://bsdtalk.blogspot.com/ http://freebsdforall.blogspot.com/