ADSM-L

Re: TSM Script

2002-03-19 11:55:55
Subject: Re: TSM Script
From: Andy Carlson <andyc AT ANDYC.CARENET DOT ORG>
Date: Tue, 19 Mar 2002 10:52:45 -0600
Here is my script (runs outside of TSM in Unix):
#!/usr/bin/ksh

ADMIN=tsmadmin
ADMINPASS=adminpass
ADSMPATH=/usr/bin

$ADSMPATH/dsmadmc -id=$ADMIN -password=$ADMINPASS
-outfile=/tmp/logcheck.out sel
ect pct_utilized from log
ect pct_utilized from log
temp=`/usr/local/bin/grep -v "[a-z]" /tmp/logcheck.out |
/usr/local/bin/grep -v
[A-Z] | /usr/local/bin/grep [0-9] | /usr/bin/tr -d ' ' | /usr/bin/cut
-f1 -d'.'`
echo $temp
echo $temp

if [[ $temp -gt 85 ]]; then
        mailx 3145388584 AT alphapage.airtouch DOT com <
/usr/local/adsm/adsmlogbig
        exit
fi

if [[ $temp -gt 80 ]]; then
        $ADSMPATH/dsmadmc -id=$ADMIN -password=$ADMINPASS
-outfile=/tmp/logproc.
out q proc
out q proc
        temp2=`/usr/local/bin/grep "Expiration" /tmp/logproc.out | cut
-f7 -d' '
`
`
        $ADSMPATH/dsmadmc -id=$ADMIN -password=$ADMINPASS
-outfile=/tmp/logcheck
.out cancel pr $temp2
.out cancel pr $temp2
        mailx user@email < /usr/local/adsm/adsmlogexp
fi


Andy Carlson                             |\      _,,,---,,_
andyc AT andyc.carenet DOT org            ZZZzz /,`.-'`'    -.  ;-;;,_
BJC Health System                       |,4-  ) )-,_. ,\ (  `'-'
St. Louis, Missouri                    '---''(_/--'  `-'\_)
Cat Pics: http://andyc.dyndns.org/animal.html

On Tue, 19 Mar 2002, Tony Jules wrote:

> I am trying to create a script to find out if the log reaches 80% and
> Expiration is running to cancel the expiration process. My question is how
> do I pass the process number as a parameter and cancel it. My script goes
> like this.
>
> select pct_utilized from log where pct_utilized > 80%
>      if (rc_ok) goto claim
> claim: select process, process_num as "Numbrers" from processes where
> process='Expiration'
>      if (rc_ok) cancel process "Numbers"
>
> The second if statement does not work because I can't pass "Numbers" as a
> parameter. What is the best way to do this?
>
> Thank you
>
>
>
> Tony Jules
> ITS / Olympus America Inc.
> 631-844-5887
> tony.jules AT olympus DOT com
>
<Prev in Thread] Current Thread [Next in Thread>