如果作业的运行时间超过指定的时间,则自动生成电子邮件 [英] Autosys Email Generation if the job runs more than the time specified

查看:114
本文介绍了如果作业的运行时间超过指定的时间,则自动生成电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我的环境中需要autosys电子邮件通知。

Currenty I have requirement in my enviroment for the autosys email notifition.

要求:如果作业的运行时间超过指定的时间,它将触发一封电子邮件。

Requirement: If the job runs more than the specified time it should trigger an email.

我正在尝试使用max_run_alam,但是我没有成功。

What I am trying is using max_run_alam, but I am not successful.

我说我有一份工作要运行10分钟(请说时间为10.00)。我将max_run_alarm设置为3。我应该在10.03处收到一封电子邮件,可以在这里继续前进,看看为什么该作业比max_run_alarm运行得更多。如果我使用max_run_alarm,我可以在日志中看到触发该警报的信息,但是只要我有很多工作,我就不能整日监视日志以查看哪个工作正在花费。我的问题是我是以正确的方式使用max_run_alarm还是我丢失了其他东西,或者是否有完全不同的方式来生成电子邮件。

Lets say i have a job that runs for 10mins(lets say the time as 10.00). i set max_run_alarm as 3. i should get an email at 10.03 where i can goahead and see why the job is running more than the max_run_alarm. if i use max_run_alarm i am able to see in the logs triggering that alarm, but I cannot spend all day monitoring the logs to see which job is taking long as i have many jobs. my question is am i using max_run_alarm in the correct way or is there something else i am missing or is there entirely different way for the emails to generate.

pls建议。 / p>

pls advise.

推荐答案

我们正在使用autosys R11。我相信在较高版本的autosys中已经可以自动触发电子邮件,但是在我们的版本中,要在一定时间后发送自动电子邮件,我们会创建两个额外的autosys作业。一个autosys作业与您要监视的作业同时启动。该作业包含一个睡眠命令。 (在您的示例中,该命令将 sleep 180让作业运行3分钟直到完成)。第二个额外的工作是发送电子邮件,并且仅在成功完成睡眠工作之后开始。

We are using autosys R11 at work. I believe the triggering of emails is already automated in higher versions of autosys, but, in our version, to send automatic emails after a certain time, we create two extra autosys jobs. One autosys job starts at the same time as the job you want to "monitor". This job contains a 'sleep' command. (in your example, the command would be "sleep 180" for the job to run for 3 minutes until completion). The second extra job is the sending of the email and only starts after successful completion of the sleep-job.

为防止每次autosys盒启动时都发送邮件,您必须将您的第一份工作添加为BOX_SUCCESS条件。睡眠作业将运行到完成,但邮件作业从已激活状态变为不活动状态,因为自动系统框不再运行。

To prevent the mail from being send every time the autosys box starts, you have to add your first job as BOX_SUCCESS condition. The sleep-job will run to completion, but the mail-job went from the "ACTIVATED" state to the "INACTIVE" state because the autosys box isn't RUNNING anymore.

这篇关于如果作业的运行时间超过指定的时间,则自动生成电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆