Automic Workload Automation

 View Only
  • 1.  Retrieving Queue used for a job

    Posted Sep 11, 2024 01:30 PM

    I am in the process of improving/setting up a CALL that sends information to ServiceNow regarding aborts. The goal is to have ServiceNow assign incident tickets based on the queue the job used.  I have yet to find a way to get the queue value either in a CALL that triggers if the job returns END_NOT_OK, or through an SLO.  Any ideas or am I going at this in the wrong manner?  Similarly, if I have post processing script to parse out "caused by." I can get that value, but not without it as a post processing script.  Ideally, I would not have to add post processing to thousands on objects. Better still would be if errors for situations like, FAULT_OTHER would also populate.



  • 2.  RE: Retrieving Queue used for a job

    Posted Sep 12, 2024 04:08 AM

    Tough question. My first thought was: "Why not simply use GET_STATISTIC_DETAIL?". But the function does not provide the queue. So I fear if you really need it, you will have to dig deeper using a SEC_SQLi. Otherwise a good use case to propose an extension of this function.



    ------------------------------
    Juergen Lechner
    Managing Consultant
    setis GmbH
    Germany
    ------------------------------



  • 3.  RE: Retrieving Queue used for a job

    Posted Sep 16, 2024 02:25 PM

    This was a great idea.  I pass &uc_slm_service_runid# to a VARA, removed the leading zeros, and then have two SQLI VARA that query for AH_Queue and AH_HostDst.  I've tried using the PREP_PROCESS_REPORT but that only seems to work as a post processing action.




  • 4.  RE: Retrieving Queue used for a job

    Broadcom Employee
    Posted Sep 12, 2024 04:21 AM
    Edited by Mike Halliday Sep 15, 2024 09:53 PM

    You could use GET_ATT in your Post Process to get the queue attribute and pass this to a CALL or JOBP etc.  You would put this in some logic to get the failure status first. 

    :SET &QUEUE# = GET_ATT (QUEUE)

    :SET &ACTOBJ# = ACTIVATE_UC_OBJECT("YOUR_OBJECT_TO_RUN",,,,, PASS_VALUES)

    Alternatively you could use :PUT_READ_BUFFER and :READ in the called object to retrieve the variable value.

    **Edit.  I just noticed that I completely glossed over not wanting to use post processing!  If you do end up with a post processing script, I recommend using an include file.




  • 5.  RE: Retrieving Queue used for a job

    Posted Sep 13, 2024 10:39 AM

    The key to getting Fault_other to satisfy the SLO and send an email thru a CALL object for Fault_other is to have the End Status checked for ANY_OK, then in the Action check on Violation, and add your Call Object. 

    Your email sends with the message - Fault Other - Start Impossible. 




  • 6.  RE: Retrieving Queue used for a job

    Posted Sep 13, 2024 11:21 AM

    To list the QUEUE, 

    In the Notification tab of the CALL OBJECT: 

    for the Body of the email: 

    add Job ran in QUEUE: &$QUEUE#

    To add it the Subject of the email:

    Add in the Process Tab of the Call object, QUEUE: &$QUEUE# 

    Here's an example of the Subject line

    Here's an example of the Email Body




  • 7.  RE: Retrieving Queue used for a job

    Posted Sep 16, 2024 11:27 AM

    Perhaps I am missing something.  I have something similar but get some inconsistent results.

    My notification subject

    Job:  &uc_slm_service_name#

    RunID:&uc_slm_service_runid#

    Time:  &uc_slm_service_time#

    Return Code:  &slm_violation#

    Queue:   &$QUEUE#

    My notification process: 

    :read &uc_slm_slo_name#,,
    :read &uc_slm_service_name#,,
    :read &uc_slm_service_status#,,
    :read &uc_slm_service_runid#,,
    :read &uc_slm_service_time#,,

    :  read &uc_slm_violation_msg_number#,,
    :  read &uc_slm_violation_msg_insert#,,
    :  set &slm_violation# = get_msg_txt(&uc_slm_violation_msg_number#,&uc_slm_violation_msg_insert#)

    :set &system# = GET_UC_SYSTEM_NAME()
    :set &client# = SYS_ACT_CLIENT()
    :set &lang# = SYS_USER_LANGUAGE()

    :SET &RC# = GET_STATISTIC_DETAIL(&uc_slm_service_runid#,RETURN_CODE)
    :PRINT &RC#
    :SET &STAT# = GET_STATISTIC_DETAIL(&uc_slm_service_runid#,STATUS)
    :PRINT &STAT#

    :set &slm_statustext# = get_msg_txt(&uc_slm_service_status#,'')
    :set &slm_statustext# = "&slm_statustext# (&uc_slm_service_status#)"
    :SET &LAST_ERR_INS# = GET_STATISTIC_DETAIL(&uc_slm_service_runid#,LAST_ERR_INS)
    :SET &LAST_ERR_NR# = GET_STATISTIC_DETAIL(&uc_slm_service_runid#,LAST_ERR_NR)
    :SET &ERR_MESSAGE# = GET_MSG_TXT(&LAST_ERR_NR#,&LAST_ERR_INS#)


    :if &lang# = 'E'
    :  put_att SUBJECT = "Job Failure Notification, &uc_slm_service_name#, RunID: &uc_slm_service_runid#, Client: &$client# QUEUE: &$QUEUE#"

    My email results:

    Subject:  Job Failure Notification, JOBS.TESTFAILUREJOB, RunID: 0001421970, Client: 0001 QUEUE: CLIENT_QUEUE

    Job:  JOBS.TESTFAILUREJOB

    RunID:0001421970

    Time:  2024-09-16 10:16:32

    Return Code:  U00045079 The status 'FAULT_OTHER - Start impossible. Other error.' does not match the expected status 'ANY_OK'.

    Queue:   CLIENT_QUEUE

    The queue is the queue the CALL executes and not the queue the job executes.

    I also cannot get the agent value.

    All the other information is correct, although it would be ideal to get the cause shown in the messages/details.

    U02001009 Agent cannot find file 'D:\Program files\notrealjob.exe'.
    U00011000 'JOBS.TESTFAILUREJOB' (RunID: '0001421970') could not be started on 'MACESS'. See next message.




  • 8.  RE: Retrieving Queue used for a job

    Broadcom Employee
    Posted Sep 17, 2024 02:58 AM

    Hi,

    &$QUEUE# returns the queue the current task (=Notification object) is running in, not the parent object which triggered the alarm.

    You can use a SQLI_SEC VARA to retrieve the QUEUE:

    In your script you can access the VARA by using

    :SET &QUEUE#=GET_VAR(VARA.SEC_SQLI.GET_QUEUE)

    Regards, Markus




  • 9.  RE: Retrieving Queue used for a job

    Posted Oct 15, 2024 02:55 PM

    If I am pulling the workflow ID and the job ID from AH, AH_ParentAct and AH_Idnr, what table would I pull the job status messages? For example this is from a FAULT_OTHER:  U02000065 The job file 'C:\Automic\AE_21\Agents\Windows\temp\JAADPVPT.TXT.BAT' could not be created. Error code '112', error description: 'There is not enough space on the disk.'.




  • 10.  RE: Retrieving Queue used for a job

    Posted Oct 17, 2024 10:35 AM

    Pulling RT_Content to get failed messages in the REP report.  Pulling AH_MsgInsert to get messages for jobs that fail to start.  Where is the value AH_MsgNr resolving to populate the error message?  example, 2001009 gives the message "Agent cannot find file"