That's great! Do you mind posting a sample script here? Can I use it directly by including the code in legato.control file? Thanks again for your help.
I won't post as I did it for customer and it belongs to customer as they paid for it.
I have 2 scripts; one which runs before NSR is started and that one is called from networker.cntl and second one which takes care of jukebox config and runs from legato.monitor.
Hi, I'm trying to write my own script now. Could you give me some hint here, like where should I look for the port name? I know it should be somewhere in /nsr/res/nsrdb/, but since there are 9 folders with 8 files in each folder and they're changing all the time, how do I know which one is for the kill? Or the info of autochanger is placed in a fixed location? Or at least I can find it manually for the first time and it won't change in future? Thanks.
Sorry, I found I didn't state myself very clear. I know the control name of the autochanger (i.e. scsidev@8.3.0). What I meant is that how I can find the location of this parameter definition in the resource files. Isn't there a 'control port' or something like that refering to the port name in some resource file under /nsr/res?
Yes it is and you can also see it via nsradmin dump for NSR jukebox resource. And to find it under directory forest where NW keeps configuration grep should be enough.
So in Shell script, I need to use loop statement to go through the 9 folders (00~09) and find in which file exactly the definition is located? But I sorta under the impression that the location may change each time you run NW? (Am I going too detailed here? heehee)
No, it is not changing thus you don't need to find it that way, but rather use fixed value. In case that you changes in environment I would suggest to use changers command.
NAME
changers - list SCSI autochangers attached to the system
SYNOPSIS
changers [ -dv ] [ -a b.t.l ] [ -l ]
DESCRIPTION
The changers program lists all of the SCSI autochangers
(jukeboxes) connected to the current system.
OPTIONS
-a b.t.l
Selects a specific ordinal SCSI address, where b is the
logical SCSI bus, t is the SCSI target, and l is the SCSI
logical unit number (LUN) on that target. See
libscsi(1m).
-d Determines the names and addresses of the autochanger¿s
media elements (for example, tape drives).
-l Performs a complete LUN search for all SCSI adapters in
the system. This argument is accepted on all systems, but
does not have any effect on HP-UX systems. Due to the
method used to scan for available devices on HP-UX
systems, all accessible devices are always shown, and the
-l option has no additional effect. On all other
platforms, the normal behavior is to start checking at LUN
0 for SCSI devices. The first empty LUN found will end
the search for a given target ID. With the -l option, all
LUN present on all target IDs for all SCSI busses in the
system will be checked for devices. This can take a very
long time and should therefore only be used when
necessary. For example, a Fibre Channel adapter can
support 126 target IDs, each of which may have 80 or more
LUNs. Checking all LUNs on this single adapter may take
over 10 minutes.
-v Lists more detailed information about each autochanger.
The details indicate how many media transports (MT, for
example, robot arm), storage transports (ST, for example,
slot), import/export elements (IE, for example, mail
slot), and data transport (DT) elements the autochanger
contains. The -v option also provides information about
the element movement matrix supported by the autochanger.
EXAMPLE
Sample output is shown below: hal$ changers -dv -a 0.2.0
scsidev@0.2.0:Vendor , Product <4000>
Data Transfer Element at address 80 is scsidev@0.5.0
Device:Vendor , Product
Type:Tape
System Name: /dev/rmt2.1
Data Transfer Element at address 81 is scsidev@0.6.0
Device:Vendor , Product
Type:Tape
System Name: /dev/rmt3.1
1 MT Element starting at address 79
60 ST Elements starting at address 1
1 IE Element starting at address 0
2 DT Elements starting at address 80
Element Movement Matrix
->DT, ->IE, ->ST, ->MT
MT->DT,MT->IE,MT->ST,______
ST->DT,ST->IE,ST->ST,ST->MT
IE->DT,______,IE->ST,IE->MT
DT->DT,DT->IE,DT->ST,DT->MT
______,______,______,______
______,______,______,______
______,______,______,______
______,______,______,______
SEE ALSO
libscsi(1m)
You probably wish to use changers -l in your case.
Actually I achieved the autochanger failover yesterday. Here's a brief description of the steps executed in my script. Hope it'd help ppl in the future.
1. check if the current node is the active node 2. find the file which contains 'control port' and fetch the file name; 3. use 'sed -e s/' command to replace the control path and the jb name
This script should be executed before 'function start_services' in legato.control file.
ble1
4 Operator
•
14.4K Posts
0
August 30th, 2007 12:00
missyang
32 Posts
0
September 4th, 2007 00:00
missyang
32 Posts
0
September 4th, 2007 01:00
ble1
4 Operator
•
14.4K Posts
1
September 4th, 2007 01:00
I have 2 scripts; one which runs before NSR is started and that one is called from networker.cntl and second one which takes care of jukebox config and runs from legato.monitor.
missyang
32 Posts
0
September 5th, 2007 01:00
ble1
4 Operator
•
14.4K Posts
0
September 5th, 2007 08:00
missyang
32 Posts
0
September 5th, 2007 08:00
ble1
4 Operator
•
14.4K Posts
0
September 5th, 2007 08:00
missyang
32 Posts
0
September 5th, 2007 09:00
ble1
4 Operator
•
14.4K Posts
1
September 5th, 2007 12:00
missyang
32 Posts
0
September 5th, 2007 17:00
ble1
4 Operator
•
14.4K Posts
0
September 6th, 2007 07:00
You probably wish to use changers -l in your case.
missyang
32 Posts
0
September 6th, 2007 20:00
Actually I achieved the autochanger failover yesterday. Here's a brief description of the steps executed in my script. Hope it'd help ppl in the future.
1. check if the current node is the active node
2. find the file which contains 'control port' and fetch the file name;
3. use 'sed -e s/' command to replace the control path and the jb name
This script should be executed before 'function start_services' in legato.control file.