Automic Workload Automation

 View Only
Expand all | Collapse all

Get information of the job status success, fail, pending, ...

  • 1.  Get information of the job status success, fail, pending, ...

    Posted Jul 12, 2017 04:33 AM
    Hello,

    Can somebody tell me how do we can get the job status of automic UC4? I have the access to its database and I found this document:
    https://docs.automic.com/documentation/webhelp/english/ALL/components/AE/11.1/DB%20Schema/db/_structure/HTML/index.htm#ECC/ECC_General/ecc_login.htm%3FTocPath%3DAbout%2520the%2520Enterprise%2520Control%2520Center%7C_____2

    But I don't know exactly the table where the database stores the status of UC4 jobs.

    If it stores the job status in the database, how many status do we have, such as success, fail, pending, long running, ....

    Regards,
    Phat


  • 2.  Get information of the job status success, fail, pending, ...



  • 3.  Get information of the job status success, fail, pending, ...

    Posted Jul 12, 2017 08:04 AM
    Hi,

    I need to get the status of job in the UC4, then I can use Zabbix to monitor it. With your link above, no sql query. We need to use automic script.


  • 4.  Get information of the job status success, fail, pending, ...

    Posted Jul 12, 2017 08:35 AM
    Yes, with both script commands you will get the status of a Job.


  • 5.  Get information of the job status success, fail, pending, ...

    Posted Jul 12, 2017 11:47 PM
    Can we have the sql query to get the status of it?


  • 6.  RE: Get information of the job status success, fail, pending, ...

    Posted 26 days ago
    Is there any Automic script to get the alert notification of the jobs ending with not ok, failing, aborted?


  • 7.  RE: Get information of the job status success, fail, pending, ...

    Posted 26 days ago
    EH is for Current
    AH is for recent
    OH is for Old 

    I use several different ways to get the Status of a job. Here's an example of an easy way to do it. 

    One is to create a SQLI query.. then process the query with a job to send an email:

    Here's an example of a query named "VARA.SQLI.REPORTING_JOB_ABENDED" for currently "ended not ok" jobs. 

    select EH_NAME, EH_EndTime from EH where EH_Status = 1800
    and EH_name like '%JOBS%'
    Order by EH_EndTime

    See the below for a list of Status Codes, just change the Status from 1800 to what you are looking for from the list of status codes:
    System Return Codes of Executable Objects (automic.com)

    Second part 
    If you want to send an email -- Create a Job object, Prep Process the SQLI vara you created, Print Process the Columns you want to send in an email, and use Send_Mail to send it to an email address. 

    See below example in the Process tab of a JOB Object you would create: 

    :SET &NL# = UC_CRLF
    :SET &HND#=PREP_PROCESS_VAR(VARA.SQLI.REPORTING_JOB_ABENDED)
    :PROCESS &HND#
    ! get first column value of every line
    : SET &RES# = GET_PROCESS_LINE(&HND#, 2)
    ! get second column value of every line
    : SET &COL1# = GET_PROCESS_LINE(&HND#, 3)
    : SET &SCRIPTVAR# = "&SCRIPTVAR# &NL# &RES# &COL1# "
    :ENDPROCESS
    :CLOSE_PROCESS &HND#
    :PRINT &SCRIPTVAR#

    : SET &RET# = SEND_MAIL("XXXXXX@XXXXX.com", , "Abended Prod Jobs", "Abended Prod Jobs &SCRIPTVAR#")

    You can search the documentation on how to use all the above. 
    PREP_PROCESS_VAR (automic.com)
    SEND_MAIL (automic.com)
    SQLI VARA Objects (automic.com)

    Once you have begun creating and familiarizing yourself with SQLI Vara objects and jobs, you can search this community for specifics. There are a lot of good examples and advice here. 



  • 8.  RE: Get information of the job status success, fail, pending, ...

    Broadcom Employee
    Posted 25 days ago
    Just a clarification on the SQL tables:
    OH is Object Header and contains an entry for every Object in the system - this is the most important table in the database.
    EH is Executive Header and contains all the current executions (Activities)
    AH is Archive Header and contains the completed (Archived) executions.
    RH is Report Header and contains all the report header data - this is related to the AH table
    RT is Report Content and contains the output from the execution - this is related to the AH table

    DB Schema can be found here


  • 9.  RE: Get information of the job status success, fail, pending, ...

    Posted 12 days ago
    Hi Marilyn,

    As per your suggestion I run below SQL query,

    select SYSDATE as SYSTEMDATE, EH_NAME, EH_EndTime from UC4.EH where EH_Status = 1800
    and EH_name like '%JOBS%' Order by 1

    But I received the output of complete one-day executions of JOBS (including ended ok jobs).
    I need only the report of ended not ok jobs.

    How can I get it? Will you please help me to fetch the report of ended not ok Jobs?

    Regards,
    Ashmitha.


  • 10.  RE: Get information of the job status success, fail, pending, ...

    Posted 12 days ago
    Hi Ashmitha,

    You should also consider the deactivated jobs. If you want the list of failed jobs for the last 24 hours, you should also probably look in the AH table which contains the deactivated tasks.

    Also, you can try using EH_Otype='JOBS' or AH_Otype='JOBS' which will fetch only the Job type tasks.

    ------------------------------
    Bharath B.
    ------------------------------



  • 11.  RE: Get information of the job status success, fail, pending, ...

    Broadcom Employee
    Posted 12 days ago
    Edited by Markus Embacher 12 days ago
    Hi,
    as Mike pointed out selecting from EH will just return executions still visible in the Process Monitoring. If you would like to select all executions of a day then please query from AH table. Make sure you include the AH_Client in your query and also to limit the result based on a timestamp (AH_TimeStamp1 is the activation time).
    The documentation of the table can be found here:
    https://docs.automic.com/documentation/webhelp/english/AA/12.3/AE/12.3/DB%20Schema/db/_structure/HTML/AH.html
    https://docs.automic.com/documentation/webhelp/english/AA/21.0/AE/21.0/DB%20Schema/db/_structure/HTML/AH.html

    For ENDED_NOT_OK query AH_Status=1800
    For the full list refer to:
    https://docs.automic.com/documentation/WEBHELP/English/all/components/DOCU/21.0.4/Automic%20Automation%20Guides/Content/AWA/Executions/ReturnCodesExec.htm

    For monitoring you can also define an SLA object to send a trigger to your monitoring application anytime a job fails.

    Regards, Markus