Batch access to "Waiting" job queue

 17 Replies
 0 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
en09714
New Member Send Private Message
Posts: 0
New Member
Do you know if there is any way that I can access the information in the "Waiting" job queue? I want to set up a batch program or script that can then notify individual users via e-mail that their jobs have gone into the "Waiting Recovery" status. I would appreciate any information that you have available. I have searched the Lawson Knowledge Base and spent time searching the net. Thank you.
John Henley
Send Private Message
Posts: 3351

My recommendation would be to use ProcessFlow. You can perform a DME query against the GEN/QUEUEDJOBS table to retrieve jobs in recovery, and send an email to appropriate people.  Put it in the ProcessFlow Scheduler.  Here's a screenshot: https://www.lawsonguru.co...G-JobsInRecovery.pdf

Thanks for using the LawsonGuru.com forums!
John
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
Depending of if you are Unix or Windows.. we have a Unix script developed that does just that. I'd be willing to share.
en09714
New Member Send Private Message
Posts: 0
New Member
Greg, I would very much appreciate yuour sharing of the script for reporting the jobs in recovery. It would save ....you know... re-inventing et. Thank you very much.
John Henley
Send Private Message
Posts: 3351

Greg,

Feel free to reply and attach here as a .zip file...

Thanks for using the LawsonGuru.com forums!
John
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
You will have to modify the script just a little bit, as $LAWDIR isn't always used and some of your programs may be in different locations, your PL is probably different that ours, environment name is probably different, etc.  but here is the script that we have developed
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member

You'll have to modify the script as I described above..  but here you go.

-Greg

 

Attachments
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
We've been using this script for a couple of years already, and it works really well. We have it scheduled from cron every 15 minutes.
en09714
New Member Send Private Message
Posts: 0
New Member
I appreciate all you have done to help. It appears that the script is setup Lawson 9.0 and we are still 8.1. However im looking at the script I did not the "grep" command which I had not thouught of before. No if I can figure out where to look for the jobs "Waiting Recovery" I should be able to move forward. Again, thanks for your efforts.
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
I'll see if I still have the previous one that worked with our pre-LSF9 system.
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member

Here is the pre-LSF9 version of the script... it pulls email addresses for recipients from their RD30 records... and if it cannot find an email address there, it simply sends it out to the admins... moellerg@genesishealth.com etc.

 

Attachments
en09714
New Member Send Private Message
Posts: 0
New Member
Greg,
Can you tell me the path to find "jqstatus". From the two scripts you have sent, I now know what I need to do however I cant seem to find "jqstatus". Again,I really appreciate the help to date. Thanks.
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
Wendell: jqstatus should be in ${GENDIR}/bin and if you've set your Lawson environment variables at the top of the script by replacing either lawprod or lsf9prod (depending on which script you are using) with your environment name (found in /etc/lawson.env) you shouldn't have to put the path in the script as long as you include ${GENDIR}/bin in the /etc/lawson.env files PATH variable.
mondrar
Advanced Member Send Private Message
Posts: 35
Advanced Member

I highly recommend the Lawson S3 Environment Monitor (LEM) for this purpose developed by David Schronce. I had several dozen scripts montoring every part of our environment, and LEM streamlined monitoring several enviroments and got rid of quite a few custom scripts. You can take a look at the program here: http://www.schronce.net/lawson/

./Richard

mondrar
Advanced Member Send Private Message
Posts: 35
Advanced Member

if you don't want to use LEM, here is a much easier script for this purpose:

TEMPDIR="/usr/local/bin/scripts";        export TEMPDIR
TEMPLOG="temp.log";                          export TEMPLOG

echo "***********************************************" > $TEMPDIR/$TEMPLOG

su - lawson -c "/lawson/gen/bin/rngdbdump -n GEN queuedjob -f jobname username -v status=34" >> $TEMPDIR/$
TEMPLOG
FLAG=`/usr/bin/cat $TEMPDIR/$TEMPLOG | /usr/bin/egrep -v 'YOU|uid'|wc -l`
if [[ ${FLAG} -gt 1 ]]
then
   mailx -s "Jobs In Recovery" email@address.com < $TEMPDIR/$TEMPLOG
else
   exit 0
fi
exit 0

rohitsurana
Basic Member Send Private Message
Posts: 6
Basic Member

Hi John,

 

I am not able to open this PDF. Can you please share it and if you have more details on it that would be great.

 

Thank You

 

John Henley
Send Private Message
Posts: 3351
https://www.lawsonguru.co...G-JobsInRecovery.pdf
Thanks for using the LawsonGuru.com forums!
John
rohitsurana
Basic Member Send Private Message
Posts: 6
Basic Member

Thank you John

 

Can you please let me know i can follow the same for landmark too?

 

Thank you