ADSM-L

Re: Q ACTL / SEARCH question

2001-07-03 11:53:40
Subject: Re: Q ACTL / SEARCH question
From: Lindsay Morris <lmorris AT SERVERGRAPH DOT COM>
Date: Tue, 3 Jul 2001 11:38:19 -0400
I've done a LOT of command-line queries.  Some tricks:

1. Use select rather than query.  The output of "q stg" etc. may change in
new releases of TSM and break your script, but the output of "select xxx
from stgpools" probably won't.

2. Use -tabd. If not, sometimes a query will come out formatted one way,
sometimes another.

3. " and * are special to the shell. You have to say 'q actlog s=\"my
stuff\"', and ' q event \* \* '

4. Get rid of the surrounding junk with this script, named "cleanhdrs":
#!/bin/sh
cat >/tmp/$$.stop <<EOF
SCHEDULE_NAME
ADSTAR Distributed
Tivoli Storage Man
Command Line Admin
(C) Copyright IBM
Session establishe
  Server Version
  Server date/time
ANS8000I Server co
ANR2034E QUERY EVE
ANS8001I Return co
ANS8002I Highest retur
ANS8009E
ANS1217E
ANR0944E
Scheduled Start
Date/Time
<ENTER> to continue
-------------
^$
^$
EOF
cat $1  | grep -vf /tmp/$$.stop
rm /tmp/$$.stop


A sample:
dsmadmc -id=servergraph -pas=servergraph -tabd select
stgpool_name,pct_utilized from stgpools | cleanhdrs
ARCHIVEPOOL     0.0
BACKUPPOOL      94.7
COPYPOOL        0.0
DIRMCDISK       22.0
SPACEMGPOOL     0.0
TAPEPOOL        6.0

And of course, you can awk and grep away at that output easily.

For efficiency, you may eventually find yourself using Perl, as we did,
especially if you want frequent, ongoing monitoring for trending purposes.

Hope this helps.

> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU]On Behalf Of
> Sheets, Jerald
> Sent: Tuesday, July 03, 2001 11:24 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Re: Q ACTL / SEARCH question
>
>
> Certainly.
>
> Here is my statement for querying the accounting log for the previous
> workday/night:
>
> LOG_Q=`dsmadmc -id=foo -pa=bar -outfile=actlog.tmp q actlog begindate=TODA
> Y-1 begintime=17:00:00 enddate=TODAY endtime=05:59:59`
>
> and later I clal it with:
>
> echo "Unavailable tape list:  $TAPELIST  " >>$REPORT
>
> So, my guess would be you could set a variable thus so:
>
> CHECKIN_Q=`dsmadmc -id=foo -pa=bar q actl begint=-48` |grep '119 minutes'
>
> (I couldn't get the "search" term to the command line without
> ADSM freaking
> out)
>
> You could also use the -outfile=filename parameter to chunk it to
> disk to do
> darn near any type of text processing you'd like with it.
>
> and provide the answer later with
>
> echo "My info:  $CHECKIN_Q" >>$REPORT
>
>
> Hope that helps
>
> Jerald Sheets, Systems Analyst TIS
> Our Lady of the Lake Regional Medical Center
> 5000 Hennessy Blvd, Baton Rouge, LA 70808
> Ph.225.765.8734..Fax.225.765.8784
> E-mail: jsheets AT ololrmc DOT com
>
>
>
>
> -----Original Message-----
> From: George Lesho [mailto:GLesho AT AFCE DOT COM]
> Sent: Tuesday, July 03, 2001 10:03 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Q ACTL / SEARCH question
>
>
> %SMers, From the command line interface, using a search string bounded by
> quotation marks will allow you to input a search string with spaces:
>
> example:
>
> tsm: AFCOPS2>q actl begint=-48 search="119 mi nutes"
>
> Date/Time                      Message
> --------------------
> ----------------------------------------------------------
> 07/01/01   14:03:07      ANR8765I 055: 3570 volume 074C18 in location
> datactr is
>                                           required for use in library
> 3575LIB1; CHECKIN LIBVOLUME
>                                           required within 119 mi nutes.
>
>
> The same command, from the command line produces an error using quotes to
> bound the search string.
>
> example:
>
> afcops2: /usr/local/bin # dsmadmc -id=<<<userid>>> -pass=<<<passwd>>>
> begint=-48 search="119 mi nutes"
> Tivoli Storage Manager
> Command Line Administrative Interface - Version 3, Release 7, Level 2.0
> (C) Copyright IBM Corporation, 1990, 1999, All Rights Reserved.
>
> Session established with server AFCOPS2: AIX-RS/6000
>   Server Version 3, Release 7, Level 3.6
>   Server date/time: 07/03/01   09:45:18  Last access: 07/03/01   09:33:02
>
> ANS8000I Server command: 'begint=-48 search=119 mi nutes'
> ANS8001I Return code 3.
>
> ANS8002I Highest return code was 3.
>
> Is there anything that I can do to introduce search strings with
> spaces into
> a command line "q actl". I removed the userid and
> password from the command line example below for security purposes.
>
> Thanks -
>
> George Lesho
> AFC Enterprises
> Storage/System Admin
>
<Prev in Thread] Current Thread [Next in Thread>