从control-m enterprise导出所有失败的作业

时间:2016-01-25 19:24:24

标签: export-to-excel export-to-csv control-m

我正在寻找将一天中所有失败的工作(已解决和未解决)导出到文件(text,csv,xml,..)的可能性

趋势是,我无法检查全天失败的所有已解决/强制确定的工作,除非我通过放入电子表格手动完成。

有人知道是否有这样的实用程序吗?我们目前在服务器上使用版本7.0中的Control-M

1 个答案:

答案 0 :(得分:0)

你可以安排一份工作: -         通过传递两个参数%% 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