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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tivoli Workload Scheduler

Status
Not open for further replies.

SapZepp

MIS
Apr 10, 2003
8
0
0
CA
Does anyone know how to get TWS to page you if a job fails ?

Thanks.
 
Hi
It is simple,please write a unix shell script by using mail command
and schedule it in TWS...That'what we have in place in our company..

sushveer
IBM certified specialist-p-series AIX5L System Administration
AIX/SOLARIS/WEBSPHERE-MQ/TIVOLI Administrator
 
Hi Sushveer,

Thanks for your reply. I don't know much unix at this point. Could you send me a sample of the script you are talking about ? I would most certainly appreciate it.

Thanks again,
Charlie
 
Hi sapzepp

Please run this unix-tws combo script on TWS master server.

#!/bin/ksh
#title of script:/tmp/tws_jobAbend_paging.ksh
/maestro/bin/conman "sj sappprd_100#cf@.billing_deliveries;stdlist">/tmp/tws.job.status

STAT=`cat /tmp/tws.job.status| grep "Exit Status"|grep 0|wc -l`
if [[ $STAT -eq 1 ]] then
mail -s &quot;tws job status&quot; pagenumber@abc.com </tmp/tws.job.status
else
exit 99
fi

#end of the script


Note:in above script,the sapprd_100 (tws cpu name),cf (schedule name) ,billing_deliveries(job name)

I wrote this script and using in prod environment...You can change the varibales to suit to your jobname/schedule/tws cpu...

That's it!


sushveer
IBM certified specialist-p-series AIX5L System Administration
AIX/SOLARIS/WEBSPHERE-MQ/TIVOLI Administrator
 
Thank You very much, I will give this a try.

Best Regards,
Charlie
 
Hi sap

I am sorry

please make amendment to the above script in the following piece only as follows:
if [[ $STAT -ne 1 ]] then
mail -s &quot;tws job $jobname failed&quot; pagenumber@abc.com </tmp/tws.job.status

fi


sushveer
IBM certified specialist-p-series AIX5L System Administration
AIX/SOLARIS/WEBSPHERE-MQ/TIVOLI Administrator
 
Hi
sapzepp

Here is the abstract of both scripts ...just copy it/paste it to your unix node and change varibales whereever necessary...

SCRIPT 1:
#!/bin/ksh
#title of script:/tmp/tws_jobAbend_paging.ksh
/maestro/bin/conman sj &quot;sappprd_100#cf@.billing_deliveries;stdlist&quot; <<EOJ >/tmp/tws.job.status
quit
EOJ

STAT=`cat /tmp/tws.job.status| grep &quot;Exit Status&quot;|grep 0|wc -l`
if [[ $STAT -ne 1 ]] then
mail -s &quot;tws job failed &quot; pagenumber@abc.com </tmp/tws.job.status
else
exit 99
fi



SCRIPT 2:
If you just want to be paged that &quot;the job in TWS is abended&quot;

You can use the following script for brevity
----------------------------------------
#!/bin/ksh
#script title :/path_to_dir/twsJob.abend-notify.ksh
/maestro/bin/conman &quot;sj @#@+state=abend&quot; << EOJ> /tmp/status.txt
quit
EOJ
cat /tmp/status.txt|grep -v sj |grep ABEND >/tmp/abend.txt
ABENDNUM=`cat /tmp/abend.txt|wc -l`
if [[ $ABENDNUM -ge 1 ]] then
mail -s &quot;tws job abend report&quot; pagenum-orusername@abc.com </tmp/abend.txt

fi


-----------------
Note : my first script gives the notification and the reason from failure(whatever in stlist says)
second script just notifies the abended job in tws

Both are tested and working fine in my shop.

That's it!


sushveer
IBM certified specialist-p-series AIX5L System Administration
AIX/SOLARIS/WEBSPHERE-MQ/TIVOLI Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top