我正在寻找将一天中所有失败的作业(已解决和未解决)导出到文件(文本、csv、xml、..)中的可能性
趋势是,除非我通过放入电子表格手动进行检查,否则我将无法检查全天失败的所有已解决/强制确定的作业。
有人知道是否有这样的实用程序吗?我们目前在服务器上使用版本 7.0 中的 Control-M
我正在寻找将一天中所有失败的作业(已解决和未解决)导出到文件(文本、csv、xml、..)中的可能性
趋势是,除非我通过放入电子表格手动进行检查,否则我将无法检查全天失败的所有已解决/强制确定的作业。
有人知道是否有这样的实用程序吗?我们目前在服务器上使用版本 7.0 中的 Control-M
您可以安排一个作业这样做:- 在脚本下面运行并传递两个参数,%%PARM1 %%PARM2 您需要更新其中的两个文件:- 1. 您的环境的 NDP 时间,我已用作 0930 2 . Control-M 环境名称 3. 您在 mailx 最后一行的电子邮件 ID 和系统的文件路径。
***you can use mutt -a if mailx -a is not working in your system for sending email with attached file .
----------------------------------
now job :-
Job Type : Command
File Path : not reuired
C ommand : path/report.sh %%PARM1 %%PARM2
rest all as normal ,
but don't forget to define PARM1 and PRAM2 in auto edit variable
PARM1 = %%$PREV
PARM2 = %%$DATE
-------------------------
Script
***********************************
report.sh
------------------------------------------------
#!/bin/bash
env=< Control-M user name > # Use control-M name
ctmlog list $1 0930 $2 0930 | grep NOTOK > $1_failedjob.txt # update time to NDP time ,i used 0930
cut -d'|' -f2,3,4,5,8 $1_failedjob.txt | sed 's/|/,/g' > $1_failed.csv
awk 'BEGIN {print "DATE,TIME,JOBNAME\t,ORDERID\t,STATUS";}
{print $0;}
END { print "\tReport generated\n";}' $1_failed.csv
rm $1_failedjob.txt
echo " Last 24 Hour failed job list " | mailx -s "Failed Job list for $1" -a "absolute path of file $1_failed.csv" youremail@domain.com
exit 0`
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Apart from using this , you can always ask your ops team to send an report by exporting failed job for a particular time and date from Control-m EM GUI