From owner-freebsd-scsi@FreeBSD.ORG Sat May 28 22:03:44 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C06B61065670 for ; Sat, 28 May 2011 22:03:44 +0000 (UTC) (envelope-from dan@langille.org) Received: from nyi.unixathome.org (nyi.unixathome.org [64.147.113.42]) by mx1.freebsd.org (Postfix) with ESMTP id 963A98FC0A for ; Sat, 28 May 2011 22:03:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by nyi.unixathome.org (Postfix) with ESMTP id B249050893 for ; Sat, 28 May 2011 23:03:43 +0100 (BST) X-Virus-Scanned: amavisd-new at unixathome.org Received: from nyi.unixathome.org ([127.0.0.1]) by localhost (nyi.unixathome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 97KEYbQiMPlo for ; Sat, 28 May 2011 23:03:43 +0100 (BST) Received: from smtp-auth.unixathome.org (smtp-auth.unixathome.org [10.4.7.7]) (Authenticated sender: hidden) by nyi.unixathome.org (Postfix) with ESMTPSA id 53DDA50882 for ; Sat, 28 May 2011 23:03:43 +0100 (BST) From: Dan Langille Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Sat, 28 May 2011 18:03:41 -0400 Message-Id: To: freebsd-scsi@freebsd.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: Does the tape library need cleaning? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 22:03:44 -0000 I'm wondering if there is a way to query my tape library to see if = cleaning is required? This information is shown on the display of the = unit, but I'd like to query the device and display it on a webpage. Here is what I have. $ mtx -f /dev/pass11 inquiry Product Type: Medium Changer Vendor ID: 'DEC ' Product ID: 'TL800 (C) DEC' Revision: '0326' Attached Changer API: No I'm guessing I need to know more about about the scsi commands I can = send to the device and use camcontrol to extract the information. Much = like this command pulls back data (as extracted from a a: set -- `camcontrol cmd $tape -v -t 3 -c "4d 0 43 0 0 0 0 0 40 0" -i 64 = \ "{skip} *i4 \ {skip} *i4 \ {Corrected errors with substantial delay } i4 \ {skip} *i4 \ {Corrected errors with possible delay } i4 \ {skip} *i4 \ {Total errors } i4 \ {skip} *i4 \ {Total errors corrected } i4 \ {skip} *i4 \ {Total times correction algorithm processed} i4 \ {skip} *i4 \ {Total bytes processed } i2 i3 i3 \ {skip} *i4 \ {Total uncorrected errors } i4" ` echo " Corrected errors with substantial delay: $1" echo " Corrected errors with possible delay : $2" echo " Total errors : $3" echo " Total errors corrected : $4" echo " Total times correction algorithm used : $5" tmp=3D`echo "($6 * 16777216 + $7) * 16777216 + $8" | bc` echo " Total bytes processed : $tmp" --=20 Dan Langille - http://langille.org