4 Operator

 • 

14.4K Posts

August 30th, 2007 12:00

Only with script - I did solution like that for one customer recently.

32 Posts

September 4th, 2007 00:00

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.

32 Posts

September 4th, 2007 01:00

It's fair. Thanks anyway. At least I know now that I need script to achieve it. =)

4 Operator

 • 

14.4K Posts

September 4th, 2007 01:00

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.

32 Posts

September 5th, 2007 01:00

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.

4 Operator

 • 

14.4K Posts

September 5th, 2007 08:00

Go to GUI and check what control path is. Or simply get it from inquire/changers output.

32 Posts

September 5th, 2007 08:00

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?

4 Operator

 • 

14.4K Posts

September 5th, 2007 08:00

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.

32 Posts

September 5th, 2007 09:00

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)

4 Operator

 • 

14.4K Posts

September 5th, 2007 12:00

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.

32 Posts

September 5th, 2007 17:00

I didn't get the last part. What is changer command? Could you kindly elaborate? Many thanks.

4 Operator

 • 

14.4K Posts

September 6th, 2007 07:00

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.

32 Posts

September 6th, 2007 20:00

Hrvoje, thanks a lot for your help!

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.
No Events found!

Top