Re: [ADSM-L] Reg: script to get library & drive Serial Nos from OS level

2015-08-07 15:53:53
Subject: Re: [ADSM-L] Reg: script to get library & drive Serial Nos from OS level
From: Shawn Drew <shawndo AT GMAIL DOT COM>
Date: Fri, 7 Aug 2015 15:50:51 -0400
lscfg -vl rmt* | awk '/rmt/ {printf $1};/Serial/ {print $0};' | sed 

(ibm driver):
cat /proc/scsi/IBMtape
(tsm driver):
for each in /dev/tsmscsi/mt*; do echo $each $(sginfo -s $each); done

Also, here is an old AIX shell script I used to change all the device names so 
they match on every host. It uses "chdev" instead of "rendev” (I never heard of 
rendev until today!)
For linux, you would use the udev facility.



# Change devs to temp names
for i in `lsdev -Cc tape | awk '/LTO Ultrium Tape Drive/ {print $1}'`; do chdev 
-l $i -a new_name=$i-temp; done

#End result file
echo "rmt0 F001CD4001
rmt1 F001CD4007
rmt2 F001CD400D
rmt3 F001CD4013
rmt4 F001CD4019
rmt5 F001CD401F
rmt6 F001CD4025" > $TEMPFILE

# Get serial numbers
lscfg -vl rmt* | awk '/rmt/ {printf $1};/Serial/ {print $0};' | sed 
's/Serial.*\.//' | while read TEMPDEVICE SERIAL do if grep $SERIAL $TEMPFILE > 
/dev/null then chdev -l $TEMPDEVICE -a new_name=`grep $SERIAL $TEMPFILE | awk 
'{print $1}'` fi done


> On Aug 6, 2015, at 3:51 PM, Srikanth Kola23 <srkola23 AT IN.IBM DOT COM> 
> wrote:
> Hi Team,
> I am in the need of collecting drive & library serial numbers for 50
> servers from os level for lanfree setup
> any scripts for me to fetch data
> I have AIX , Linux boxes
> library 3573 scsi ( linux & AIX )
> Emc data domain(VTL) (linux)
> Thanks & Regards,
> Srikanth kola
> Backup & Recovery
> IBM India Pvt Ltd, Chennai
> Mobile: +91 9885473450