From owner-freebsd-arch@FreeBSD.ORG Sat Jul 14 04:25:53 2007 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D41A16A401; Sat, 14 Jul 2007 04:25:53 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from mojo.ru (mojo.ru [84.252.152.63]) by mx1.freebsd.org (Postfix) with ESMTP id 85AB613C478; Sat, 14 Jul 2007 04:25:52 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from [192.168.0.16] (nc-76-4-28-21.dhcp.embarqhsd.net [76.4.28.21]) (authenticated bits=0) by mojo.ru (8.12.11.20060308/8.12.10) with ESMTP id l6E4Pk92029829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Jul 2007 08:25:50 +0400 Message-ID: <46985043.8010204@FreeBSD.org> Date: Sat, 14 Jul 2007 00:25:39 -0400 From: "Constantine A. Murenin" Organization: Google Summer of Code 2007 Student @ The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-gb, en-gb-oed, en, en-us, ru, ru-ru, ru-su MIME-Version: 1.0 To: John Baldwin References: <55754.1184143579@critter.freebsd.dk> <200707121404.34168.jhb@freebsd.org> <46979EC3.20803@FreeBSD.org> <200707131252.08792.jhb@freebsd.org> In-Reply-To: <200707131252.08792.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Rui Paulo , Shteryana Shopova , "Constantine A. Murenin" , Poul-Henning Kamp , Robert Watson , freebsd-arch@FreeBSD.org, Alexander Leidinger Subject: Re: Porting OpenBSD's sysctl hw.sensors framework to FreeBSD X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2007 04:25:53 -0000 On 13/07/2007 12:52, John Baldwin wrote: > On Friday 13 July 2007 11:48:19 am Constantine A. Murenin wrote: > >>On 12/07/2007 14:04, John Baldwin wrote: >> >> >>>On Thursday 12 July 2007 03:00:08 am Alexander Leidinger wrote: >>> >>> >>>>Quoting John Baldwin (from Wed, 11 Jul 2007 >>> >>>11:45:26 -0400): >>> >>> >>>>>On Wednesday 11 July 2007 07:49:59 am Alexander Leidinger wrote: >>>> >>>>>>On the other hand you don't want to allow an userland tool to directly >>>>>>mess around with the registers on your RAID or NIC to get some status... >>>>> >>>>>Err, that's how all the RAID utilities I've used work. They send > > firmware > >>>>>commands from userland and parse the replies in userland. One exception >>> >>>I've >>> >>> >>>>That's sad... they should provide this functionality in the driver >>>>instead, it would allow to use access restrictions for some parts. >>> >>> >>>Not really, it avoids having to duplicate a lot of work in drivers that > > can be > >>>written once in a cross-platform userland utility. Drivers aren't really > > the > >>>place to be monitoring raid status sending pages, e-mails, etc. It's best > > to > >>>let userland invoke sendmail, not the kernel. :) >> >>John, I'm sorry to disappoint you, but RAID drivers in OpenBSD don't >>implement SMTP and don't do emails, they only provide updates to the >>sensors framework when there are some changes in the state of the drive. :) >> >>sensorsd(8) is used to send alerts and emails based on the information >>from the sensors framework, and user configuration. >> >>bioctl(8) is used to configure RAID for _all drivers_. There are no >>separate utilities for RAID configuration based on brand-name, just like >>nowadays there are no separate utilities for configuring Ethernet >>adapters. [0] > > > According to the various manpages on www.openbsd.org you cannot configure > arrays on the OS for at least mfi(4), ciss(4), twe(4), mpi(4) (like mpt(4) in > FreeBSD) or ami(4) (like amr(4) in FreeBSD). You can only do monitoring via > hw.sensors for ciss(4) and ami(4), and the example for monitoring ami(4) in > the manpage shows that you can only get volume level data, and as a _string_ > and that you can't get backing physical drive status to know which physical > drive has failed and needs to be replaced: > > $ sysctl hw.sensors.ami0 > hw.sensors.ami0.drive0=online (sd0), OK > hw.sensors.ami0.drive1=degraded (sd1), WARNING > hw.sensors.ami0.drive2=failed (sd2), CRITICAL I'm not an expert on RAID monitoring and rebuilding, so I don't think I can answer your questions about bioctl(8). You might want to refer to a presentation that was done at BSDCan 2006 by David Gwynne. [b] However, I can tell you that in this sysctl(8) output that you've quoted, "online" etc and "OK" etc fields are represented as enums (in sensor datastructure), not strings. I trust that bioctl(8) gives further status on which exact drive has failed, again, see dlg's presentation. (Note that the sensors part of that presentation is now a bit outdated.) As far as RAID drivers providing sensors are concerned -- a grep for SENSOR_DRIVE_ONLINE reveals that it is being referenced from ami(4), arc(4), ciss(4), mfi(4) and softraid(4). From what I could see in the man pages, mpi(4) chips usually don't provide any raid functionality and twe(4) lacks programming documentation from the manufacturer, thus unavailability of RAID sensors from those two drivers doesn't come as a surprise. ;) Cheers, Constantine. [b] http://www.openbsd.org/papers/bsdcan06-biosensors.pdf