From owner-freebsd-questions@FreeBSD.ORG Thu Aug 3 21:30:15 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 1CE6616A4E5 for ; Thu, 3 Aug 2006 21:30:09 +0000 (UTC) (envelope-from freebsd@hub.org) Received: from hub.org (hub.org [200.46.204.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id A471843D55 for ; Thu, 3 Aug 2006 21:30:08 +0000 (GMT) (envelope-from freebsd@hub.org) Received: from localhost (mx1.hub.org [200.46.208.251]) by hub.org (Postfix) with ESMTP id 77F68291B0F for ; Thu, 3 Aug 2006 18:30:04 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 71425-02 for ; Thu, 3 Aug 2006 18:30:07 -0300 (ADT) Received: from ganymede.hub.org (blk-224-179-167.eastlink.ca [24.224.179.167]) by hub.org (Postfix) with ESMTP id 5B85F291B0D for ; Thu, 3 Aug 2006 18:30:03 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1027) id 3BDCE5C2E3; Thu, 3 Aug 2006 18:30:08 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 39CF05C2AD for ; Thu, 3 Aug 2006 18:30:08 -0300 (ADT) Date: Thu, 3 Aug 2006 18:30:08 -0300 (ADT) From: User Freebsd To: freebsd-questions@freebsd.org Message-ID: <20060803180553.B6529@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Stand up and be counted - BSDStats Project 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: Thu, 03 Aug 2006 21:30:15 -0000 Okay, there has been alot of discussion on this in the other thread, some of it tangent'd to the original, so, I'm starting off a new thread as a sort of summary ... I've been doing some thinking on it this afternoon, and think I've figured out about the simpliest way of doing it ... it still doesn't deal with "fakers" and such, but, IMHO, I don't think that that is a *huge* problem that needs to be addressed ... some might do it for a lark, but, overall, it just sounds like something that is "more worth then its worth", so over time, it should eventually balance out ... Now, the idea is to make this: a) run on as many boxes as possible b) not require any special software to be installed on the clients c) not require any special "registration" by the clients d) not pull any "sensitive" information So, here is what I've kinda got it down to ... pseudo-ish code, since I haven't got the exact syntax worked out *yet* ... specifically, parsing pciconv to get query strings out of it ... Now, this is designed to be run *once* per month, per host ... it is also meant to try, to a certain extent, deal with NAT boxes ... its not perfect, but, unfortunately, as this whole discussion has shown, there really is no "perfect" way ... STEP 1: fetch -o /tmp/getid http://bsdstats.hub.org/get_id.php get_id.php will look at the IP that is coming in, search the database, and if a host already exist, will increment by 1 and return a new id ... all IPs will have at least one: IP:1 pair in the database, NAT hosts will have IP:2, IP:3, IP:4, etc ... STEP 2: pciconf -lv needs to be parsed, this being the hard step, into a string that can be sent via HTTP ... this is the hard part because it has to be done as/in a shell script ... anyone out there *really* good at shell programming? What needs to happen is: pcib4@pci6:0:2: class=0x060400 card=0x00000044 chip=0x032a8086 rev=0x09 hdr=0x01 vendor = 'Intel Corporation' device = '6700PXH PCI Express-to-PCI Express Bridge B' class = bridge subclass = PCI-PCI Needs to be converted into: device=pcib&vendor=Intel+Corporation&device=6700PXH+PCI+Express-to-PCI+Express+Bridge+B&class=bridge&subclass=PCI-PCI So that the final query would look something like: fetch http://bsdstats.hub.org/report.php?id=`cat /tmp/getid`&device=pcib&vendor=Intel+Corporation&device=6700PXH+PCI+Express-to-PCI+Express+Bridge+B&class=bridge&subclass=PCI-PCI So there would be one 'fetch' per device listed ... report.php would take the IP:getid pair, and store one record per device into the database, from which stats could be very easily generated using standard SQL queries ... STEP 3: fetch http://bsdstats.hub.org/report_sys.php?id=`cat /tmp/getid`&system=`uname -mr | sed 's/\ /+/g'` To record the FreeBSD version ... ================ I personally don't think there is anything else useful / non-sensitive that we'd want to report on ... Now, the idea is that this would be dump'd into /etc/periodic/monthly, and /etc/defaults/periodic.conf would have: monthly_statistics_enable="YES" monthly_statistics_report_pciconf="YES" Optimally, we'd love to have everyone report pciconf information, since knowing what vendors and devices are in use would definitely add more weight then *just* what version of FreeBSD, but in order to hopefully get as much "buy into" this as possible, the script should be written to allow it to be disabled ... again, I can't think of why someone would feel that that was 'sensitive information', but providing the option to shut it off is definitely a must ... How does that sound? ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email . scrappy@hub.org MSN . scrappy@hub.org Yahoo . yscrappy Skype: hub.org ICQ . 7615664