2016-01-25 114 views
0

我在尋找一種可能性,每天都以失敗告終的工作(解決,而不是)導出到文件(文本,CSV,XML,..)導出所有失敗的作業

趨勢是的,我將無法檢查所有一整天都失敗的解決/強制確定作業,除非我通過放置在電子表格中手動執行。

有誰知道是否有這樣的工具?目前,我們正在使用Control-M 7.0版本服務器

回答

0

。您可以安排作業做到: - 以下腳本命令行運行 與傳遞兩個參數,%% PARM1 %% PARM2 你需要更新兩個 - 1.您的環境的NDP時間,我用作0930 2. Control-M環境名稱 3.根據您的系統,您的電子郵件ID位於最後一行mailx和文件路徑中。

***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" [email protected] 

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