Networker

Re: [Networker] Detecting cleaning required

2004-01-05 03:56:55
Subject: Re: [Networker] Detecting cleaning required
From: Davina Treiber <Treiber AT HOTPOP DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Mon, 5 Jan 2004 07:52:20 +0000
Tim, thanks for that. This prompted me also to start digging. I started
looking at some of the utilities supplied with NetWorker. These seem to
be more comprehensive and better organised at NetWorker 7.x than at 6.x.
There is a whole series of binaries named "cdi_*", some of which are
just renamed from earlier versions, but some which seem completely new.
However, I still don't think I found what I was looking for. It looked
like the cdi_get_status binary might do the trick, so I tried it on a
couple of storage nodes that have 10 DLT drives each. None of the drives
told me they needed cleaning, and from experience I'd say that one or
two would (firmware cleaning not active). They are on remote sites so I
can't see for sure. I'll try it again today after the weekend backups
have been running. Sadly I suspect that this program just doesn't do
what I hoped. I couldn't see anything else that looked promising, so
still open to suggestions. Surely there must be something in the public
domain that might do this.

I suppose you can guess where I'm going with this. I'm trying to solve
the dilemna of the best way to clean drives. If I could detect this
condition I could simply set the "needs cleaning" flag for jukebox
drives and NetWorker would clean it, effectively giving clean-on-demand
controlled by NetWorker. Apparently some newer versions of NetWorker can
do this for Win2K only, but this doesn't help me. I would use jukebox
firmware controlled cleaning, but the problem is the visibility of when
the cleaning tapes need replacing. This is fine if your jukebox is close
enough to physically visit regularly, but I am looking after kit that is
spread all over the country. Some libraries have a network interface
with a web console etc., but this is not universally available in the
company I am working at. So I am still looking for the holy grail of
drive cleaning.

Tim Mooney wrote:
In regard to: Re: [Networker] Detecting cleaning required, Stan Horwitz...:


It seems to me that the only generic way to write such a script would be
to maintain a table of every known tape device and the number of hours its
manufacturer recommends between cleanings, then scan the /nsr/daemon.log
file for use of the available tape drives and use nsradmin to determine
which type of tape drive(s) are in use in a particular NetWorker
environment.


Not what Davina or I were hoping for -- we want something that can query
a device, directly, and ask it "do you need to be cleaned?".

I've had a vague notion for a long time that it should be supported via
some SCSI command.

Davina's question today prompted me to do some digging in the "DTL7000
Tape Drive Product Manual" that we got with our older STK library.  I
don't have the manual handy for our SDLT library.

In any case, I think I found something *very* promising.  While browsing
through the manual, I started with the SCSI "INQUIRY" command, but didn't
find anything promising there.  That's where I thought the magic would be.

Looking through the "LOG SENSE" SCSI command, I think I stumbled on what
we're looking for. The guide defines "LOG SENSE (4D in hex)" as

        LOG SENSE allows the host to retrieve statistical information
        maintained by the device about its own hardware or the installed
        media.

In particular, some of the defined (but not necessarily *supported* -- you
need to ask the device what parameter code pages it supports, also via
a SCSI command) code pages are:

        Write Error Counter Page
        Read Error Counter Page
        Last n Errors Events Page
        Compression Ratio Page
        Device Wellness Log Page
        Device Status Log Page

The last two looked very very promising, so I started reading about them.
Device Wellness turned out to not have anything cleaning-related, but
Device Status does.  There is a page code (0001, in hex) that has three
bits dedicated to cleaning status.  They are

        ClnEx - (bit 0) set if cleaning tape is used up.
        ClnR  - (bit 1) set if cleaning Required condition.  This is a hard
                error status.
        ClnQ  - (bit 2) set if cleaning Requested condition.  This is a
                recovered error status.


With this information, it should be possible to construct a program that
sends a SCSI command to a device, determines if it supports the "Device
Status" LOG SENSE page code, and if so sends it that page code and reads
the response, looking specifically at the bits listed above.

To do this *portably* is a big challenge though.  It would be great if
there were a "high level" API for working with SCSI, that hid the
underlying platform's SCSI implementation details.  As it happens, Legato
has for years used a `libscsi' with NetWorker, but its API is completely
undocumented (man libscsi(1) to see what I mean).

If we had documentation for the API defined in that library, it might
be possible to leverage the library to write the kind of tool we're
looking for.

Anyone have documentation for the API of that library, or alternately
know of some OpenSource SCSI library that provides a
vendor/platform-neutral API layer over the platform-specific layer?

Tim
--
Tim Mooney                              mooney AT dogbert.cc.ndsu.NoDak DOT edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=


--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

<Prev in Thread] Current Thread [Next in Thread>