ESP Workload Automation

Expand all | Collapse all

creating problems ticksts once a job fails in ESP

  • 1.  creating problems ticksts once a job fails in ESP

    Posted May 18, 2010 08:51 AM
    Our operations staff manually create problems tickets in REMEDY on any job that fails in ESP. We are looking to see if there is a way to have ESP create those tickets automatically.


  • 2.  RE: creating problems ticksts once a job fails in ESP

    Posted May 19, 2010 10:36 AM
    We have a system that does exactly what you describe. The way it works is that when ESP detects the abend in a monitor event it submits a batch job that puts the abend information on an MQSERIES queue which was retrieved by an application that feeds it into an application that creates the problem ticket from the abend information. We used Remedy for years before we replaced that with iPortal and a couple of years ago replaced that with CA Service Desk. However the ESP portion of the infrastructure was the same in all the cases. What happens after ESP buts the abended information needed to create the ticket on the MQSERIES queue is magic as for as I am concerned.

    Michael E. Ellis


  • 3.  RE: creating problems ticksts once a job fails in ESP

    Posted Oct 15, 2010 11:22 AM
    Michael, I was wondering if you would be able to send me an example of how you have the monitor setup to trap the
    abended job information?

    Thanks
    Ed Duda
    Walgreens


  • 4.  RE: creating problems ticksts once a job fails in ESP

    Posted Oct 15, 2010 11:32 AM
    We also create special SYSLOG messages that OPS/MVS picks up and creates the Remedy ticket.

    First - all appls use NOTIFY event like this
    NOTIFY OVERDUE PREMEND ABEND FAIL EVENT(PRSCHED.NOTIFY)


    Notify event uses application APPLNTFY which looks like this
    APPLNTFY: ESPPROC
    XNAME = SUBSTR(1,3,!MNJOB)
    XPNT = SUBSTR(1,7,!MNPOINT)

    IF !MNCMPC EQ 'CCFAIL' THEN XEND = !MNHICMPC
    IF !MNCMPC NE 'CCFAIL' THEN XEND = !MNCMPC

    IF !XPNT EQ 'JOBEND' THEN -
    SE 'ESPOPS01 JOB !MNFULLNAME RUNNING IN !MNAPPL GENERATION -
    !MNAPPLGEN HAS FAILED CODE !XEND.' OPER(2)

    IF !MNCOND EQ 'OVERDUE' -
    AND !MNRC EQ '0' -
    AND !MNCMPC EQ '' THEN -
    SE 'ESPOPS02 JOB !MNFULLNAME RUNNING IN !MNAPPL GENERATION -
    !MNAPPLGEN IS NOW OVERDUE AT !ESPATIME.' OPER(2)

    additonal checks for Late starting, delays, suberrors, etc.

    The ESPOPS* messages are unique to our shop and that is whay OPS/MVS picks up on to create the tickets in Remedy.

    --
    Edited to add
    When I saved this an emoticon appears. Not sure why.
    Our symbolic introducer is !, just for clarification.


  • 5.  RE: creating problems ticksts once a job fails in ESP

    Posted Oct 18, 2010 05:38 PM
    What I do is have an event invoked by a NOTIFY that invokes a ESP procedure that extracts various monitor variables about the failed job and puts them into a string that is passed via MQSERIES (a java messaging service) into a problem and incident tool. The problem and incident tool we use is CA Service Desk but before that we used iPortal and before that we used Remedy. The CA Service Desk documentation suggests that you can also input a problem via email but I have never tried that as it would have required changing the process.


    Below is an example of a monitor event invoked as a result of a NOTIFY

    -IPT- BROWSE DX.D952.ESP.PROCLIB(SERVICE) - 01.00 Line 00000000 Col 001 080
    Command ===> Scroll ===> PAGE
    ********************************* Top of Data **********************************
    SERVICE: ESPPROC

    /***********************************************************/
    /* ESP PROC EXECUTED ON CNTR2 */
    /* BY ESP EVENT DX950GRP.DSALRT */
    /***********************************************************/

    IF %MNNXN = 'ESP_CNTR' THEN EXIT

    INVOKE 'DX.D952.ESP.PROCLIB(CAPTURE)'
    /***************************************************************/
    /** LOGIC FOR OVERDUE - FAILURES IN THE FUTURE **/
    /***************************************************************/
    IF %MNPOINT = 'OVERDUE' THEN +
    DO
    COMPCODE = 'OVERDUE '
    ENDDO
    ELSE +
    DO
    COMPCODE = '%MNMXCMPC'
    ENDDO
    STR1=' %MNAPPL(8)%MNJOB(8)%MNJOBNO(F5)%COMPCODE(8)'
    STR2='%TIME(5)%DATE(7)%STEPNAME(8)%PROGNAME(8)%CENTER(8)'
    STR ='%STR1%STR2'

    JCLLIB 'DX.D952.ESP.CNTL'
    JOB DXEXAMIN
    MEMBER SERVICE
    RUN NOW
    ENDJOB

    EXIT
    ******************************** Bottom of Data ********************************

    Notice that the CAPTURE routine tries to discern the name of the MVS jobstep and program name that has abended and would be a much shorter routine if one did not desire to do this

    -IPT- BROWSE DX.D952.ESP.PROCLIB(CAPTURE) - 01.07 Line 0000 Nesting level 2
    Command ===> Scroll ===> PAGE
    ********************************* Top of Data **********************************
    CAPTURE: ESPPROC
    INTEGER JOBNO
    STEPNAME = ' '
    PROGNAME = ' '
    /* */
    /* STEPNAME AND PROGRAM NAME WILL NOT BE VALID FOR ALL ERRORS */
    /* THEREFORE WE INITIALIZE THEM TO NULL STRINGS INITIALLY */
    /* */
    REXXON
    X = TRAPOUT('LINE.')
    ADDRESS ESP "ESP LJ " CLANGVAR('%MNJOBNO')
    X = TRAPOUT('OFF')
    Y = CLANGVAR('%MNMXCMPC')
    IF Y = 'CCFAIL' THEN +
    DO
    Y = CLANGVAR('%MNHICMPC')
    END
    /* */
    /* IN THE CASE OF A CCFAIL CONDITION YOU HAVE TO USE THE */
    /* HIGHEST RETURN CODE FROM A STEP IN THE JOB INSTEAD */
    /* */
    IF Y = 'JCLERROR' OR Y = 'SYSERROR' OR Y = 'RUNNING' THEN +
    DO
    EXIT
    END
    /* */
    /* STEPNAME AND PROGRAM NAME HAVE NO MEANING IN THE CASE OF */
    /* JOBS THAT GET COMPLETION CODES OF RUNNING AND SYSERROR */
    /* AND THERE IS NO OBVIOUS WAY TO FIND OUT WHAT THE ERRONEOUS */
    /* STEP IS IN THE CASE OF A JCLERROR CONDITION */
    /* */
    DO I=6 TO LINE.0
    N = WORDS(LINE.I)
    IF N = 0 THEN ITERATE
    U = SUBWORD(LINE.I,N)
    IF U = Y THEN
    DO
    IF N = 10 THEN M = 2
    IF N = 11 THEN M = 3
    /* THE STEPNAME IS NORMALLY IN WORD 2 BUT IF THERE */
    /* IS A PROCSTEP NAME IT WILL BE IN WORD 3. */
    /* IT IS VERY RARE FOR THERE TO BE A PROCSTEP NAME. */
    D = WORD(LINE.I,1)
    "STEPNAME ='"D"'"
    E = WORD(LINE.I,M)
    "PROGNAME ='"E"'"
    F = WORD(LINE.I,N)
    "CONDCODE ='"F"'"
    LEAVE
    END
    ELSE
    ITERATE
    END
    REXXOFF
    /*
    /* ALL THE VARIABLES ARE CONVERTED TO STRING VARIABLES
    /* EXCEPT JOBNUMBER WHICH IS PADDED WITH ZEROS ON THE LEFT
    /*
    IF %MNNETID = '' THEN NETID = ' '; ELSE NETID = '%MNNETID'
    IF %MNAPPL = '' THEN APPL = ' '; ELSE APPL = '%MNAPPL'
    JOBNO = %MNJOBNO /* ONLY INTEGER VARIABLE IN DISPLAY */
    JOBNAME = '%MNJOB'
    COMPCODE = '%MNMXCMPC'
    IF %MNMXCMPC = 'CCFAIL' THEN COMPCODE = '%MNHICMPC'
    CENTER = 'CENTER2 '
    TIME = '%ESPAHH..%ESPAMN'
    DATE = '%ESPADD%ESPAMMM%ESPAYY'
    STR1='%NETID(8)%APPL(8)%JOBNAME(8)%JOBNO(F5)'
    STR2='%COMPCODE(8)%TIME(5)%DATE(7)%STEPNAME(8)%PROGNAME(8)%CENTER(8)'
    STR ='%STR1%STR2'
    /* ECHO 'STRING IS %STR' */
    ******************************** Bottom of Data ********************************

    The string (STR) is feed into a batch job that puts the abend information on an MQSERIES queue to be picked up and turned into an inicident in CA Service Desk.

    //DXEXAMN2 JOB (90948P,34SW,AHD000,B00000,34339),WINSTON,
    // MSGLEVEL=1,NOTIFY=&SYSUID,PRTY=14,MSGCLASS=T,TIME=1
    //*EXEC CNTR3
    //*MAIN ORG=LOCAL,USER=CH34339,CLASS=DLI30
    //* STRING BEGINS IN COLUMN FOUR ON THE NEXT CARD
    //* %STR
    //STEP01 EXEC PGM=ESPTOMQ
    //STEPLIB DD DISP=SHR,DSN=DX.D952.JOBLIB
    // DD DISP=SHR,DSN=DXX.MQ39.SCSQAUTH
    // DD DISP=SHR,DSN=DXX.MQ30.SCSQAUTH
    //SYSUDUMP DD SYSOUT=(,)
    //SYSABOUT DD SYSOUT=(,)
    //SYSOUT DD SYSOUT=(,)
    //DSNTRACE DD SYSOUT=(,)
    //SYSTSPRT DD SYSOUT=(,)
    //* SYSIN SHOULD BE QM-NAME
    //* MQOD-OBJECTNAME
    //* MQOD-OBJECTQMGRNAME
    //********************************************************************
    //SYSIN DD DSN=DX.D952.ESP.CNTL(MQPARMS),DISP=SHR
    //ESPEXCP DD DSN=DX.D952.ESP.EXCEPTN,DISP=OLD
    //ESPHIST DD *
    %STR
    /*
    //


  • 6.  RE: creating problems ticksts once a job fails in ESP

    Posted May 21, 2010 09:06 AM
    We put a message on syslog that OPS-MVS picks up and ships out to the SMTP server, there we have a service that opens a ticket in USD.


  • 7.  Re: creating problems ticksts once a job fails in ESP

    Posted Oct 03, 2016 03:12 PM

    This is a long shot, since its 6 years old, but how are you putting the message on SYSLOG, we have had nothing in place for automated ticketing since we have had ESP (10 years) and I am looking to do something similar to this



  • 8.  Re: creating problems ticksts once a job fails in ESP

    Posted Oct 03, 2016 03:46 PM

    Hey Sir,

    System commands can be issued by the VS command. See the "Command Reference" manual for more information on this.  Something simple like a Send command will end up in the system log.  Depending on what methods the ticketing tool gets information from determines the best method to get the information to it. The OPS-MVS to SMTP server is only one method.  In some cases it may be batch jobs running or batch jobs running on a UNIX box.

     

    To outline the basic process.

    1. The Application has a NOTIFICATION statement in it.

    NOTIFY FAILURE ALERT(FAIL)

     

    1. The ALERT is DEFINED to initiate an EVENT

    OPER ALERTDEF ADD ID(FAIL) EVENT(POWDO03.DPFAIL)

     

    1. The EVENT is defined and either issues the commands or builds an application that runs jobs.
    2. Monitor variables(MN variables ) can be used to capture many things including the jobname, application name, application generation, failure code and many others.

     

     

    Let me know if you have any questions.

     

     

     



  • 9.  Re: creating problems ticksts once a job fails in ESP

    Posted Oct 04, 2016 10:07 AM

    Thanks! So I successfully got the message into the SYSLOG which I will be able to get the ticket cut for it now.

    But

    What can I do about resubmits? I wouldn't want another message if it was a resubmit.



  • 10.  Re: creating problems ticksts once a job fails in ESP

    Posted Oct 04, 2016 10:20 AM


    From the Advanced User Guide

    MNSUB#
    Contains the submission count for a job.

     

    We code the following;

    IF %MNSUB# GT 1 THEN EXIT  



  • 11.  Re: creating problems ticksts once a job fails in ESP

    Posted Oct 04, 2016 10:35 AM

    Awesome, thank you so much!



  • 12.  Re: creating problems ticksts once a job fails in ESP

    Posted Oct 05, 2016 06:17 PM

    Is it possible to trap the value of MNSUB# ?

    Need to check how many times the job was submitted.

     

    Thanks

    Siva



  • 13.  Re: creating problems ticksts once a job fails in ESP

    Posted Apr 26, 2017 01:12 PM

    Is there a limitation on how much can be sent to the syslog?
    I have noticed that some of the longer messages are being cut off