How To: Remove TSM header from reports

chad_small

ADSM.ORG Moderator
Joined
Dec 17, 2002
Messages
2,262
Reaction score
52
Points
0
Location
Gilbert, AZ
Website
www.tsmadmin.com
How do I remove this garbage from my batch reports?



IBM Tivoli Storage Manager

Command Line Administrative Interface - Version 5, Release 3, Level 4.0

(c) Copyright by IBM Corporation and other(s) 1990, 2006. All Rights Reserved.



Session established with server TSMSERVER1: AIX-RS/6000

Server Version 5, Release 3, Level 4.0

Server date/time: 12/18/06 15:31:20 Last access: 12/18/06 15:16:51



ANS8000I Server command: 'select volume_name from drmedia where state='MOUNTABLE''




I thought there was a way to output just the data but can't seem to remember the right command. The -outfile option is not good enough I need it to strip everything but the data.
 
When I use the -dataonly=y from the command line I receivethe message:



dsmadmc -id=xxxxxxx -password=xxxxxxxx -dataonly=y q sess

ANS8017E Command line parameter 3: 'dataonly=y' is not valid.



ANS8002I Highest return code was 9.



FYI



Server Version 5, Release 3, Level 2.2



I have seen other messages of folks with v5.3 having this problem but no one seems to have a work around.
 
JP,

You could use a little perl wrapper as follows:

cheers,

Neil

===================================



$DSMCMD = "dsmadmc -id=tsmadmin -pa=bitemetsm";



open (LISTPRO, "$DSMCMD -se=$server select node from ....)



while (<LISTPRO>) {

if ( $reallist eq "true" ) {

# remove lines beginning with the # symbol, blank lines, ANS and SPACE

if (!/^\s\s\s|^\s*$|^\#|ANS800|SPACEMGPOOL/) {

@fields = split /\s\s\s*/;

print;

...... # do whatever

}

# NOTE order of 'if' statements is SIGNIFICANT!

# this /^------/ if statement is needed to get rid of header stuff

# returned by dsmadmc command

if (/^----------/) {

# dashed line delimiter between trash and list is also removed

$reallist = "true";

}

}

close LISTPRO;

============================
 
When I use the -dataonly=y from the command line I receivethe message:



dsmadmc -id=xxxxxxx -password=xxxxxxxx -dataonly=y q sess

ANS8017E Command line parameter 3: 'dataonly=y' is not valid.



ANS8002I Highest return code was 9.



FYI



Server Version 5, Release 3, Level 2.2



I have seen other messages of folks with v5.3 having this problem but no one seems to have a work around.



just use a "tail +10" if necessary, this will just remove the first 9 lines
 
Agree with blackminder:

"dsmadmc -id=USERID -password=PASSWORD -dataonly=yes"

works well for me! Note '-dataonly=yes' with yes spelled out instead of just y. My TSM server version is 5.3.1.2
 
-dataonly=yes works fine. I use it in my lame script to check scratch in the library and page me if it is below a certain value.

#!/bin/ksh

S=`dsmadmc -id=<id> -pa=<password> -dataonly=yes -servern=<server name> "select count(volume_name) from libvolumes where status='Scratch' and library_name=<library_name>

if [ $S -lt 20 ]
then
mail -s "Library <library_name> is below 20 scratch" $HN [email protected] < scratchwarn.txt
else
exit
fi

I'm not the best korn shell scripter but am working on getting better.
 
-dataonly=yes is not a server code specific option but a administrative client (dsmadmc) option which was introduced in 5.3 (or 5.3.x?)
 
Back
Top