0

I'm looking for a possibility to export all failed jobs (resolved and not) of a day into a file (text, csv, xml,..)

Tendency is, I will not be able to check all resolved/forced-ok jobs which failed all throughout the day unless I do it manually by placing in a spreadsheet.

Does anybody know if there is such an utility? We're currently using Control-M in Version 7.0 on Server

awesome
  • 1
  • 2

1 Answers1

0

You can schedule a job do so :- run below script as command line with passing two argument , %%PARM1 %%PARM2 you need to update two filed in it :- 1. NDP time of your Environment , I have used as 0930 2. Control-M environment name 3. your email ID in last line of mailx and file path as per your system .

***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 
Chandramani
  • 343
  • 1
  • 2
  • 9