To create a report of failures for that paricular day

A lot of scripts ans example to extract information from Control-M tools.
Post Reply
User avatar
rajesekhar
Nouveau
Nouveau
Posts: 72
Joined: 07 Dec 2007 12:00

To create a report of failures for that paricular day

Post by rajesekhar » 21 May 2008 5:55

Hi,
At the end of day, I have to create a report of failures(logged in control-M) for that paricular day.
Is it possible to do that by using Control-M reporting facility?
I see that it is not much flexible.

Regards,
rajesekhar

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 22 May 2008 2:00

Look at sample4 of Reporting Facility.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 22 May 2008 9:23

Hi,
At the end of day, I produced some audit reports for day activity.
I use the <ctmlog> utility to archive the Control-M log every day.

ctmlog list 20080521 0000 20080521 2359 /tmp/20080521.log

In this flat-file i extract the activity like jobs Ko, killed,... based on the code status.

Values are:
5101 job STARTED
5103 job FORCED OK
5105 job SUBMITTED
5120 job EXECUTING
5133 job ENDED OK
5134 job ENDED NOTOK
5401 job HELD
5402 job FREED
5403 job DELETED
5404 job RERUN
5405 job CONFIRMED
5408 job UNDELETED
5409 job KILLED

If you want to extract only the KO jobs

ctmlog listmsg "5134" 2008mmdd hhmm 2008mmdd hhmm /tmp/your file

You can also use the <ctmpsm> utility for extract jobs KO

ctmpsm -LISTJOB NOTOK -SORT JOBNAME

Another way is to run SQL query to extract data from CMR_AJF

select jobname from cmr_ajf where state='8' and status='N' and odate='20080522';
where:
state=8 indicate job Post processed
status='N' indicate job NOT OK or NOT ENDED

Regards
Walty

User avatar
rajesekhar
Nouveau
Nouveau
Posts: 72
Joined: 07 Dec 2007 12:00

Post by rajesekhar » 22 May 2008 8:54

@gglau & Walty

With that, I could only get the job whose final status as "ENDED NOT OK"

But I want all the failed jobs(eventhough they were fixed and status changed to OK)

and btw, in the above SQL code, I had to give status like '%NOT%' its a varchar column, is it not the same for all of us?

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 26 May 2008 4:27

tu peux essayer un truc dans le genre :
#!/bin/ksh -x
# extraction des traitements par datacenter
# PhV. 04/03/2008
# Note : il est conseille de compiler les statistiques control-m server avant de lancer ce script
# (ctmjsa *) ou de le lancer juste après s il est deja programme sous controlm

datacenter=${1}
datej=`date '+%y%m%d'`
tmp="${HOME}/ctm/scripts_pv/tmp"
result="${HOME}/ctm/scripts_pv"

cd ${result}

FIC_TEMP="${tmp}/tmp_${datacenter}_${datej}.out"
FIC_CSV="${result}/traitements_${datacenter}_${datej}.csv"

# extraction SQL (jointure entre l'AJF et la RUNINF sur l'ORDERNO)

SQL -w999 <<EOF> ${FIC_TEMP}
select a.APPLIC,";",a.APPLGROUP,";",a.JOBNAME,";",a.MEMNAME,";",b.STARTRUN,";",b.ENDRUN,";",b.ELAPTIME,";",b.OSCOMPSTAT,";",b.NODEID
from CMR_AJF a,CMR_RUNINF b
where a.ORDERNO=b.ORDERNO
and
a.STATUS="N"
ORDER BY APPLIC
go
EOF

# Lecture et mise en forme (suppression des espaces)
echo "APPLI;GROUPE;JOBNAME;MEMNAME;STARTRUN;ENDRUN;ELAPTIME;CODE;HOSTID" > ${FIC_CSV}
cat ${FIC_TEMP} | sed 's/ //g' >> ${FIC_CSV}
rm ${FIC_TEMP}

# purge a 7 jours
find ${result}/traitements* -mtime +7 -exec rm {} \;


c'est plutot light et founi un .csv exploitation sous excel

regards
philmalmaison

User avatar
naiLS1
Nouveau
Nouveau
Posts: 1
Joined: 27 Jan 2008 12:00

Post by naiLS1 » 21 Nov 2008 4:58

I need to start producing a daily error report as well. My french is very rusty--can you explain in english what the above script is doing?

Post Reply