08-14-2015 06:13 AM - edited 03-01-2019 09:16 AM
tidal experts - I've been using tidal for last 6 months. We have a requirement to send e-mails when job completes normally on re-run. Can any one please advice? Thanks in advance!
scenario - when a job completes abnormally, some operator look into issue and may re-start the same job. If the job completes successfully on re-run, only then an e-mail alert should be sent to distribution.
08-14-2015 07:10 AM
Hi praveen,
There is no out of the box solution that will allow you send email notification on successful re-runs only. Because it would have to use Job Event: Job completed normally, but you can add details to the email action to include job variables: start and end times, and you may also add a counter variable to indicate how many times the job has run.
BR,
Derrick Au
08-14-2015 07:39 AM
Thank you Derrick and Tyler, both the solutions resolve the issue. But my tidal environment has too many jobs and job completion emails would flood the mailbox.
To be specific to my instances, I think passing on the "counter" variable (number of re-runs) to the script would be good idea as we could handle it in script.
I couldn't find counter variable in my 5.3.1 version. Can you please let me know the specific name and also how to get there? Thanks a lot!
08-14-2015 08:13 AM
Hi praveen,
There's quite a bit of work involved when scripting in a variable, value pair. It would be an external variable passed into a job group level, then passed to the job level. Then from job level you can use set a local Tidal variable to initialize value, and increment local Tidal variable by 1 for each subsequent runs.
Another way is to perform a SQL query on the Admiral database. The job reruns column (jobrun table, jobrun_reruns). If this number is >= 1 then send out an email notification. Either way requires a bit of programmatic effort.
BR,
Derrick Au
08-14-2015 07:20 AM
Agree with Derrick. What we've done when you want different job event behavior between runs, is to literally have 2 separate jobs defs, and name one (rerun) with the job event/email action for completed normally.
Since you have an operator interacting with your scenario, that makes it perfect for him to rerun the (rerun) job and not the original job that completed abnormally.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide