Automic Workload Automation

 View Only
  • 1.  Retrieving Queue used for a job

    Posted 29 days ago

    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 29 days ago

    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 24 days ago

    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 29 days ago
    Edited by Mike Halliday 25 days ago

    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 27 days ago

    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 27 days ago

    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 24 days ago

    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 24 days ago

    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