ESP Workload Automation

 View Only
  • 1.  File Monitoring

    Posted Sep 19, 2019 11:57 AM
    We have a requirement to look for let's say 10 files and if any of those 10 do not come in by a certain time then we need to send out a notification. The catch to this is the files have to have a create date of the current date. Looking for a good way in ESP to do this. Any ideas/suggestions?

    Thank you,
    Sharon

    ------------------------------
    Sharon Lancaster
    BB&T
    NC
    ------------------------------


  • 2.  RE: File Monitoring

    Posted Sep 19, 2019 12:44 PM
    ​Sharon,
    I hope I'm reading this correctly.  In ESP, we have done this by adding a self completing task that uses AJ commands to force the job and all the file dependencies complete.  This task has a time dependency.  Just remember that all AJ commands are executed in the order they are entered in the task definition, so I suggest you complete / bypass the job first followed by the file deps.

    Hope this helps!
    <JC>


  • 3.  RE: File Monitoring

    Posted Sep 19, 2019 02:24 PM
    Hey Jonathon,

    Thanks for the replies, understand the file trigger and e-mail part, I think the part I'm struggling with is to know if the file was created today as the filename will not have a date in it, basically would need to interrogate the create date of the file and not really sure how I can do that.

    Thank you,
    Sharon

    ------------------------------
    BB&T
    NC
    ------------------------------



  • 4.  RE: File Monitoring

    Broadcom Employee
    Posted Sep 19, 2019 02:39 PM
    If you use FILE_TRIGGER  with CREATE in ESP Proc, and have the event to be triggered at midnight daily, then the completion of FILE_TRIGGER should ONLY for files that are created today.

    Hope this helps,

    Lucy


  • 5.  RE: File Monitoring

    Broadcom Employee
    Posted Sep 19, 2019 03:23 PM
    Sorry, just realize that FILE_TRIGGER with CREATE will also complete when the file already exists.

    Wonder if you can use the FILE_TRIGGER with EXIST or NOEXIST together to exclude the condition.

    Or maybe use FILE_TRIGGER with CONTINUOUS, it will then only detect the existing file the first time, afterwards it will monitor newly created files.

    Lucy


  • 6.  RE: File Monitoring
    Best Answer

    Broadcom Employee
    Posted Sep 23, 2019 06:04 PM
    Hi Sharon, 
    Below is one way that I think this could be done.  The first job just checks to see if the file exists. If it exists an UPDATE file trigger job is used. If it does not exist then a CREATE file trigger job is used.  This appl would build at midnight. In the case below if the file hasn't been updated/created by 17.00 then it would trigger an alert and notify someone.  We may want to have one job that runs at 23.59 and completes the appl.....then it will start fresh the next day..... 

    APPL ABC

    FILE_TRIGGER TEST
    AGENT DPU01
    FILENAME /opt/data/aaaa.txt EXIST
    RUN ANY
    RELEASE ADD(UPDATE) COND(RC(0))
    RELEASE ADD(CREATE) COND(RC(1))
    ENDJOB

    FILE_TRIGGER UPDATE
    NOTIFY OVERDUE ALERT(LATE)
    AGENT DPU01
    FILENAME /opt/data/aaaa.txt UPDATE
    RUN ANY
    DUEOUT EXEC 17.00
    ENDJOB

    FILE_TRIGGER CREATE
    NOTIFY OVERDUE ALERT(LATE)
    AGENT DPU01
    ESPNOMSG AJ TEST COMPLETE APPL(%ESPAPPL..%ESPAPGEN)
    FILENAME /opt/data/aaaa.txt CREATE
    RUN ANY
    DUEOUT EXEC 17.00
    ENDJOB