Does the tape library need cleaning?
Dan Langille
dan at langille.org
Mon May 30 20:39:00 UTC 2011
On May 28, 2011, at 6:03 PM, Dan Langille wrote:
> 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 \
Reading http://support.gateway.com/s/Manuals/servers/quantum_7000_product_manual.pdf shows me that cleaning status detection is possible.
I started by understanding what my script (provided by a third partty) does.
Based on my script, I know that 43 is read statistics (as opposed to 42 which is write statistics).
So far, I've learned a bit about CDB and know that 4d = 'LOG SENSE'.
According to 5.4.8 LOG SENSE (4Dh), the third parameter, 43, seems to be the PC and Page Code.
43 = 0100 0101
* The 4 specifies cumulative values (see figure 5-20 LOG Page Control Definitions)
* The 3 specifies Last n Errors Events Page ( see figure 5-21 LOG SENSE Pages Supported)
Does this make sense to anyone else?
Section 5.4.8.6 Device Status Log Sense Page (3Eh) seems to have what I need. Particularly:
* parameter code (0001h)
* ASC 80h ASCQ 01h == Cleaning Required
It is at this point that I start getting confused about what camcontrol command I should use.
I don't know how to incorporate 3E into the camcontrol command. It seems that 4D is the key....
I'm confused...
> "{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"
The above output is related to Table 5-18 on page 114.
> `
> 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=`echo "($6 * 16777216 + $7) * 16777216 + $8" | bc`
> echo " Total bytes processed : $tmp"
--
Dan Langille - http://langille.org
More information about the freebsd-scsi
mailing list