Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to verify FILE storage pool volumes and devclass directory files

ADSM/TSM Troubleshooting Tips

Script to verify FILE storage pool volumes and devclass directory files

by  LED888  Posted    (Edited  )
Problem(Abstract)
This document provides a sample Windows batch command file that can be used to verify whether volumes in a FILE storage pool have their corresponding file at the operating system level and vice versa.

Environment
Tivoli Storage Manager server on Windows

Operating system(s):
Windows

Resolving the problem
The below script is provided as-is and unsupported. The script must be run on the Windows machine that runs the Tivoli Storage Manager server.
scanpool.cmd :
@echo off
rem **************************************************************************
rem *
rem * This command file will get the list of volumes defined in a FILE storage
rem * pool and then verify if the volumes sill exist at the operating system
rem * level. If the file volume is missing from the operating system, the volume
rem * will be identified as damaged.
rem *
rem * This command file will also get the list of files that exist in the path(s)
rem * identified in the directory parameter of the device class associated to
rem * FILE storage pool. If the file volume does not belong to any Tivoli Storage
rem * Manager server storage pool, the file volume will be identified as orphaned.
rem *
rem * The script accepts 3 arguments :
rem * 1. The Tivoli Storage Manager administrator userid
rem * 2. The Tivoli Storage Manager administrator password
rem * 3. The FILE storage pool name in UPPERCASE
rem *
rem ********************************************************************
setlocal
SET TSMID=%1
SET TSMPA=%2
SET FILEPOOL=%3
SET DIRPATH="dsmadmc -id="%TSMID%" -pa="%TSMPA%" -dataonly=yes -display=list select a.directory from devclasses a, stgpools b where a.devclass_name=b.devclass and stgpool_name='"%FILEPOOL%"'"
SET STGVOLS="dsmadmc -id="%TSMID%" -pa="%TSMPA%" -dataonly=yes -display=list select volume_name from volumes where stgpool_name='"%FILEPOOL%"'"
SET ALLVOLS="dsmadmc -id="%TSMID%" -pa="%TSMPA%" -dataonly=yes -display=list select volume_name from volumes"
rem Verify if the stgpool volume has a corresponding OS file
For /F "tokens=2" %%I in ('%STGVOLS%') do (CALL :VERIFY_VOL %%I)
rem Verify if the OS file has a corresponding stgpool volume
For /F "tokens=2" %%I in ('%DIRPATH%') do (
For %%J in (%%I) do (CALL :VERIFY_DIR %%J)
)
goto :END
:VERIFY_VOL
set FILENAME=%1
If NOT exist %FILENAME% echo STGPOOL volume without corresponding OS File=%FILENAME%
goto :EOF
:VERIFY_DIR
For /R %1 %%K in (*) do (CALL :VERIFY_FILE %%K)
goto :EOF
:VERIFY_FILE
SET VOLNAME=%1
SET VOLFOUND="NO"
For /F "tokens=2" %%L in ('%ALLVOLS%') do (IF /I %VOLNAME%==%%L SET VOLFOUND="YES")
IF %VOLFOUND%=="NO" echo OS File without corresponding STGPOOL volume=%VOLNAME%
goto :EOF
:END
endlocal


Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top