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
To create a report of failures for that paricular day
- rajesekhar
- Nouveau
- Posts: 72
- Joined: 07 Dec 2007 12:00
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
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
- rajesekhar
- Nouveau
- Posts: 72
- Joined: 07 Dec 2007 12:00
- philmalmaison
- Nouveau
- Posts: 1148
- Joined: 08 Jun 2007 12:00
- Location: Ile de France
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
#!/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