IBM Support

Script to audit volumes on a volume list - UNIX/Linux

Troubleshooting


Problem

This document provides a sample script that can be used to run audit volume processes based on a list of volumes to be audited.

Resolving The Problem

The following script is provided as-is and is unsupported. The script is for use with a Tivoli Storage Manager administrative client on a UNIX system.
auditvols.sh :

#!/bin/ksh
#######################################################################
#
# This script will start audit of volumes based on input file and will
# run "X" number of audit volumes concurrently. The script will check
# the number of running audit volume every 10 minutes and will start
# new ones as needed. The audit is run with default fix=no value.
#
# The script accepts 4 arguments,
#    1. The Tivoli Storage Manager administrator userid
#    2. The Tivoli Storage Manager administrator password
#    3. The input file which contains the volumes to audit, 1 per line
#    4. The maximum number of audit volumes to run concurrently
#
#######################################################################

tsmid=$1
tsmpa=$2
vollist=$3
auditmax=$4

while read onevol ; do
 oktostartaudit="NO"
 while [ $oktostartaudit = "NO" ] ; do
   #Get the current count of audit volume processes
   auditcount=$(dsmadmc -id=$tsmid -pa=$tsmpa -dataonly=yes "select count(*) from processes where PROCESS like 'Audit Volume%'")
   #Get the allowed number of processes that can be started
   auditallowed=$(($auditmax - $auditcount))
   if (($auditallowed > 0 ))
     then
      oktostartaudit="YES"
   else  
      sleep 600
   fi
 done
 #Start the audit processes
 dsmadmc -id=$tsmid -pa=$tsmpa audit volume $onevol
done < $vollist

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Server","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"All Supported Versions","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Document Information

More support for:
Tivoli Storage Manager

Software version:
All Supported Versions

Operating system(s):
AIX, HP-UX, Linux, Solaris

Document number:
502653

Modified date:
17 June 2018

UID

swg21656591