PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03/16/2018 8:48 AM by  Kwane McNeal
Monitoring Job completion??
 9 Replies
Sort:
You are not authorized to post a reply.
Author Messages
CindyW
Private
Private
Veteran Member
(413 points)
Veteran Member
Posts:161


Send Message:

--
05/12/2010 11:22 AM
    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
    Private
    Private
    Veteran Member
    (887 points)
    Veteran Member
    Posts:309


    Send Message:

    --
    05/12/2010 11:41 AM
    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
    Private
    Private
    Veteran Member
    (128 points)
    Veteran Member
    Posts:44


    Send Message:

    --
    05/12/2010 12:00 PM
    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
    Private
    Private
    Veteran Member
    (1188 points)
    Veteran Member
    Posts:426


    Send Message:

    --
    05/12/2010 7:18 PM
    Check out this link to a script in the Tips and Tricks section of this Web Site.

    https://www.lawsonguru.com/Articles/View/tabid/346/ArticleId/494/Send-an-Email-for-Jobs-in-Needs-Recovery.aspx
    CindyW
    Private
    Private
    Veteran Member
    (413 points)
    Veteran Member
    Posts:161


    Send Message:

    --
    05/13/2010 8:56 AM

    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.com/Articles/View/tabid/346/ArticleId/494/Send-an-Email-for-Jobs-in-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
    Private
    Private
    Veteran Member
    (1188 points)
    Veteran Member
    Posts:426


    Send Message:

    --
    05/13/2010 12:19 PM
    We run on Unix and I set this to run in Cron so I am not sure if it will be much help.
    
    
    #!/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
    
    


    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
    Lawson Consultant
    Private
    Basic Member
    (16 points)
    Basic Member
    Posts:6


    Send Message:

    --
    02/14/2018 9:27 AM

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

    Chesca
    Programmer/analyst
    State
    Veteran Member
    (1032 points)
    Veteran Member
    Posts:484


    Send Message:

    --
    03/16/2018 8:32 AM
    How do you take it down at night for backups? I am looking for something similar
    Chesca
    Programmer/analyst
    State
    Veteran Member
    (1032 points)
    Veteran Member
    Posts:484


    Send Message:

    --
    03/16/2018 8:37 AM
    How do you take it down at night for backups? I am looking for something similar
    Kwane McNeal
    Private
    Private
    Veteran Member
    (1266 points)
    Veteran Member
    Posts:422


    Send Message:

    --
    03/16/2018 8:48 AM
    This is an 8 year old thread. You’ll likely need to ask your question, including more specific requests.
    You are not authorized to post a reply.