cancel
Showing results for 
Search instead for 
Did you mean: 

How to check contant of drive via UNIX CLI.

waisblaster
Level 3
Hi,

i am trying to find a command that i will be able to run via UNIX CLI and get an output that will let me know if there is a tape in the drive or not.
if the robot is fine and all the drives are in TLD mode, i can get this output from "vmoprcmd" command.
The problem starts when there is a drive that his status is DOWN-TLD. when the drive is in this mode i have to get into the library and check for my answer.

can someone help to make it eazier ?

Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions

Andy_Welburn
Level 6
There are options that go with it, but run without you should get what you are looking for

e.g. for a Solaris master with SSO option:
# vmoprcmd

                           HOST STATUS
Host Name                                  Version   Host Status
=========================================  =======   ===========
master                                      654000    ACTIVE

                                PENDING REQUESTS


                                    <NONE>

                                  DRIVE STATUS

Drive Name               Label   Ready  RecMID  ExtMID  Wr.Enbl.  Type
    Host                       DrivePath                            Status
=============================================================================
Overland_Drive_1         Yes     Yes    300693  300693  Yes       hcart3
    host                      nrst11a (ndmp_host)                    ACTIVE

Overland_Drive_2         Yes     Yes    300650  300650  Yes       hcart3
    host                      nrst12a (ndmp_host)                    TLD
    host                      /dev/rmt/2cbn                        ACTIVE

Overland_Drive_3         Yes     Yes    300676  300676  Yes       hcart3
    host                      /dev/rmt/0cbn                        TLD
    host                      nrst13a (ndmp_host)                    ACTIVE

Overland_Drive_4         No      No                     No        hcart3
    host                      /dev/rmt/1cbn                        TLD

Any DOWN paths would be shown here

***EDIT***
Why am I suggesting what you've already said you've tried? I take it vmoprcmd is not doing what you want for some reason?


View solution in original post

6 REPLIES 6

Andy_Welburn
Level 6
There are options that go with it, but run without you should get what you are looking for

e.g. for a Solaris master with SSO option:
# vmoprcmd

                           HOST STATUS
Host Name                                  Version   Host Status
=========================================  =======   ===========
master                                      654000    ACTIVE

                                PENDING REQUESTS


                                    <NONE>

                                  DRIVE STATUS

Drive Name               Label   Ready  RecMID  ExtMID  Wr.Enbl.  Type
    Host                       DrivePath                            Status
=============================================================================
Overland_Drive_1         Yes     Yes    300693  300693  Yes       hcart3
    host                      nrst11a (ndmp_host)                    ACTIVE

Overland_Drive_2         Yes     Yes    300650  300650  Yes       hcart3
    host                      nrst12a (ndmp_host)                    TLD
    host                      /dev/rmt/2cbn                        ACTIVE

Overland_Drive_3         Yes     Yes    300676  300676  Yes       hcart3
    host                      /dev/rmt/0cbn                        TLD
    host                      nrst13a (ndmp_host)                    ACTIVE

Overland_Drive_4         No      No                     No        hcart3
    host                      /dev/rmt/1cbn                        TLD

Any DOWN paths would be shown here

***EDIT***
Why am I suggesting what you've already said you've tried? I take it vmoprcmd is not doing what you want for some reason?


Anonymous
Not applicable
What you sound like you want is status alert notifications while you are away from the command line. NetBackup does not have this built-in out of the box.

However....

Solutions:
UNIX/Windows: Regular scheduled batch/cron job to parse output of the vmoprcmd and notify operations staff.
or
NOM 6.5 has some alerts for this.

Easier to implement the first if you dont have NOM.

There are some scripts (search for drivewatch) around that will provide this. And also if find this condition will try and UP the drive.
For example
#------------------------------------------------------------------
#BEGIN SCRIPT DRIVEWATCH
#!/usr/bin/ksh
#----------------------------------------------------------------------
# Check drives, bring drive up if down, email Staff
# If drives are up, do not create a report, runs from cron
#----------------------------------------------------------------------
# Add interested parties below:
someone_who_cares=operations@thiscorp.org
/usr/openv/volmgr/bin/vmoprcmd -d ds | grep "DOWN-TLD" 2>&1
if [ $? -ne 1 ];then
         echo " "
         echo " "
         rm /tmp/drivelog
         /usr/bin/date >> /tmp/drivelog
         
         echo "Please check DLT drives on MASTER:
        
`/usr/openv/volmgr/bin/vmoprcmd -d ds` 

I will now attempt to place drive(s) in UP status" >> /tmp/drivelog
echo "" >> /tmp/drivelog
        for i in `/usr/openv/volmgr/bin/vmoprcmd -d ds | tail +5 | grep "DOWN"|awk '{print $1}'`
        do
          /usr/openv/volmgr/bin/vmoprcmd -up $i
        done
/usr/openv/volmgr/bin/vmoprcmd -d ds >> /tmp/drivelog
cat /tmp/drivelog | /usr/bin/mail -s "Drive(s) on Veritas are DOWN" \
  $someone_who_cares
fi

sunbird
Level 4
If the tapedrive is "DOWN-TLD", you could use the UNIX  "mt" command on the device path...

mt  -f   <device_path>  status

Example:  mt  -f  /dev/rmt/0  status

If the OS believes there is a tape in the tapedrive, it will report some vendor sens code information.

If the OS believes that there is no tape, it will report "no tape loaded or drive offline".

Marianne
Level 6
Partner    VIP    Accredited Certified
You can also use robtest to see what's in the drive(s).
Run robtest on the robot control host, select the robot, then type 's d' to show drives.
Remember to exit from robtest as soon as status have been verified. Robtest will control the robot and put drives in AVR state.

waisblaster
Level 3
Sunbird - I am running the commands via control station that control few robots, so `mt` command can't help me if i don't have any option to query just one of the robot/servers (something like "-m server" option...).

Stuart -about the script : I don't want to up the drives without knowing if there is a tape inside or not. if the robot will try to insert a tape to drive when there is already one inside ,it can damage the drive phisicaly.

Andy - about the vmoprcmd : I can't  see if there is a tape inside or not unless the drive is up. for example, i had down drive that from the library i could see that it contained a tape but from the command , i saw like there is no tape.

Thanks for the help so far, but please advise if you can :)

Marianne
Level 6
Partner    VIP    Accredited Certified
Robtest calls the tldtest command.
You can run tldtest in a script on the robot control host. Something like:
echo “s d″ | tldtest -r /dev/sg/c0t......