Monitoring Job completion??

 9 Replies
 0 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
CindyW
Veteran Member Send Private Message
Posts: 169
Veteran Member
Has anyone written a script to do this? Our production environment has a few nightly job streams that, when they fail, can cause problems if no one notices the failure. I was wondering if there was some way to check for the completion of a particular job, and perhaps generate an email with the completed status.

We have purchased ProcessFlow, but will not be messing with if for some time as we are hoping to go live on the 9.0 apps this summer (we are still running 8.0.3 apps).

We are running MS SQL Server, LSF 9.0.0.6 environment.
Ragu Raghavan
Veteran Member Send Private Message
Posts: 477
Veteran Member
This is what did.

In a 4GL code, did a CALL "system" to the command

jqstatus -w
and directed the output to a file.

in the 4GL code, I read the file and check for speicfi job names to see if any are in waiting status and email somebody if job is waiting.
riegerj
Veteran Member Send Private Message
Posts: 44
Veteran Member
We also added in the r code (jqstatus -rw) to keep an eye on our jobs in waiting because of invalid pararmeters and such so we could keep a handle on it.
JimY
Veteran Member Send Private Message
Posts: 510
Veteran Member
Check out this link to a script in the Tips and Tricks section of this Web Site.

https://www.lawsonguru.co...-Needs-Recovery.aspx
CindyW
Veteran Member Send Private Message
Posts: 169
Veteran Member

Posted By JimY on 05/12/2010 07:18 PM
Check out this link to a script in the Tips and Tricks section of this Web Site.

https://www.lawsonguru.co...-Needs-Recovery.aspx




Thanks...I've figured out how to get the information and send it to a text file using the LID commands...that part is pretty simple. But the email generation is another trick. "Mail" is not a recognized command in our environemnt. I'm sure there's a way to do it...I'll have to ask around here I guess.
JimY
Veteran Member Send Private Message
Posts: 510
Veteran Member
We run on Unix and I set this to run in Cron so I am not sure if it will be much help.
[code] #!/usr/bin/ksh #----------------------------------------------------------------------- # Lawson Jobs in Needs Recovery or Invalid Parms Email Script #----------------------------------------------------------------------- # set lawson environment variables if ps -ef | grep -q [l]adb ; then . cv lawprod MAILADDR=jyoung1@hurleymc.com MAILTO=kburges1@hurleymc.com let x=-1 rngdbdump -n GEN queuedjob -f jobnumber jobname username actstartdate actstarttime -v status=34:35 | while read line do let x=$x+1 JOBNUMBER=`echo $line | cut -d ' ' -f 1` JOBNAME=`echo $line | cut -d ' ' -f 2` USERNAME=`echo $line | cut -d ' ' -f 3` STARTDATE=`echo $line | cut -d ' ' -f 4` STARTTIME=`echo $line | cut -d ' ' -f 5` JOBRECOV[$x]="Jobnumber: $JOBNUMBER Jobname: $JOBNAME Username: $USERNAME Start Date: $STARTDATE Start Time: $STARTTIME\n" done else JOBRECOV="" fi if [[ $JOBRECOV = "" ]]; then echo "No jobs in Needs Recovery or Invalid Parms" else (sleep 5 echo EHLO sleep 5 echo MAIL FROM: $MAILADDR sleep 5 echo RCPT TO: $MAILADDR sleep 5 echo RCPT TO: $MAILTO SLEEP 5 echo DATA sleep 5 echo From: $MAILADDR echo To: $MAILADDR echo To: $MAILTO echo subject: Jobs In Needs Recovery/Invalid Parms echo echo ${JOBRECOV[*]} echo sleep 5 echo . sleep 5 echo QUIT sleep 5) | telnet 00.00.00.00 {port number} fi [/code]

The first part checks to see if Lawson is up( I take it down at night for backups). Then it dumps the data from rngdbdump to the variable jobrecov. It then telnets to my mail server and sends and email. This is written in ksh so you would probably not be able to use it as is, but it might give you some ideas. Good luck.
rohitsurana
Basic Member Send Private Message
Posts: 6
Basic Member

I want to do the same for Landmark can you please guide me.

Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
How do you take it down at night for backups? I am looking for something similar
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
How do you take it down at night for backups? I am looking for something similar
Kwane McNeal
Veteran Member Send Private Message
Posts: 479
Veteran Member
This is an 8 year old thread. You’ll likely need to ask your question, including more specific requests.