AutoSys Workload Automation

Expand all | Collapse all

Text File Reading and Monitoring Jobs (OMTF) Monitor mode wait/now

  • 1.  Text File Reading and Monitoring Jobs (OMTF) Monitor mode wait/now

    Posted Jan 16, 2017 04:08 AM

    Hi,

     

    I am testing how OMTF jobs work and I am running jobs defined by following fil

     


    /* ----------------- seu_text_file_reading_b ----------------- */

    insert_job: seu_text_file_reading_b   job_type: BOX
    owner: autosys@hpwaatst
    permission:
    date_conditions: 0
    alarm_if_fail: 1


     /* ----------------- seu_text_file_reading_wait_omtf ----------------- */

     insert_job: seu_text_file_reading_wait_omtf   job_type: OMTF
     box_name: seu_text_file_reading_b
     machine: seu_mach
     owner: autosys@hpwaatst
     permission:
     date_conditions: 0
     alarm_if_fail: 1
     encoding: US-ASCII
     text_file_name: "/home/autosys/text_file_reading.txt"
     text_file_mode: Line
     text_file_filter_exists: 1
     monitor_mode: WAIT
     text_file_filter: error


     /* ----------------- seu_text_file_reading_now_omtf ----------------- */

     insert_job: seu_text_file_reading_now_omtf   job_type: OMTF
     box_name: seu_text_file_reading_b
     machine: seu_mach
     owner: autosys@hpwaatst
     permission:
     date_conditions: 0
     alarm_if_fail: 1
     encoding: US-ASCII
     text_file_name: "/home/autosys/text_file_reading.txt"
     text_file_mode: Line
     text_file_filter_exists: 1
     monitor_mode: NOW
     text_file_filter: error

     

    file has the key word before I run the jobs

    cat "/home/autosys/seur/text_file_reading.txt"
    hola
    error
    adios

     

    I would expect both jobs to run ok but seu_text_file_reading_now_omtf  ends ok but seu_text_file_reading_wait_omtf  keeps running

     

    Why is this happening?

    Does monitor mode check for a new entry with the word error?

     

    thanks

    José

     

    PS

    In fact I tested and in case a new match is done the wait job finished, but I thought it would check first for any occurrence. I misunderstood how monitor woks



  • 2.  Re: Text File Reading and Monitoring Jobs (OMTF) Monitor mode wait/now

    Posted Jan 16, 2017 03:37 PM

    If the lower_boundary is not specified in the OMTF job and the monitor_mode is WAIT, then the job should read the file from line 0 (top) till the end of the file (upper_boundary shouldn't be specified for WAIT mode). So, in your case, the WAIT job should have completed. I just tried this on my test instance running AE 11.3.6 SP5 + System agent 11.3, Service Pack 6, Maintenance Level 0, Build 946, and it worked as expected.

     

    ~> autorep -J seu_text_file_reading_wait_omtf -q


    /* ----------------- seu_text_file_reading_wait_omtf ----------------- */

     

    insert_job: seu_text_file_reading_wait_omtf   job_type: OMTF
    machine: localhost
    owner: autosys
    permission:
    date_conditions: 0
    alarm_if_fail: 0
    encoding: US-ASCII
    text_file_name: "/home/autosys/text_file_reading.txt"
    text_file_mode: Line
    text_file_filter_exists: 1
    monitor_mode: WAIT
    text_file_filter: error

     

    ~> cat -v "/home/autosys/text_file_reading.txt"
    hello
    error
    exit

     

    [01/17/2017 01:39:00]      ----------------------------------------
    [01/17/2017 01:39:20]      CAUAJM_I_40245 EVENT: STARTJOB         JOB: seu_text_file_reading_wait_omtf
    [01/17/2017 01:39:20]      CAUAJM_I_40245 EVENT: CHANGE_STATUS    STATUS: STARTING        JOB: seu_text_file_reading_wait_omtf MACHINE: test_serv.ca.com
    [01/17/2017 01:39:20]      CAUAJM_I_10082 [test_serv.ca.com connected for seu_text_file_reading_wait_omtf 111.1541.1]
    [01/17/2017 01:39:21]      CAUAJM_I_40245 EVENT: CHANGE_STATUS    STATUS: RUNNING         JOB: seu_text_file_reading_wait_omtf MACHINE: test_serv.ca.com
    [01/17/2017 01:39:21]      CAUAJM_I_40245 EVENT: CHANGE_STATUS    STATUS: SUCCESS         JOB: seu_text_file_reading_wait_omtf MACHINE: test_serv.ca.com EXITCODE:  0
    [01/17/2017 01:39:21]      <Line 2:error>
    [01/17/2017 01:40:00]      ----------------------------------------

     

    Can you please check if there are any non-ASCII/Control characters in your text file with the "cat -v" command? The normal cat command does not print control characters.

     

    Thanks,

    Chandru