I have 2 jobs that check the New Day Processing.
First, put this on the command line -
VAR1=`ctmudchk -DAILY SYSTEM -ACTION LIST`; if [ -n "$VAR1" ]; then echo "$VAR1" | mailx -s "The following potential jobs were not ordered by New Day Processing"
fred.bloggs@hotmail.com ; else echo "Nothing found"; fi
Run this 10 minutes after the end of the New Day Processing and
fred.bloggs@hotmail.com will receive an email if the number of jobs ordered aren't as expected.
New Day Processing should also produce some messages that should appear in the log and you can check for these. My New Day Processing runs at 12 noon, so I rn this on the command line -
ctmlog list %%$ODATE 1158 %%$ODATE 1212 | $HOME/scripts/ctmlog_ok.pl
The ctmlog_ok.pl then is this, the 5 strings in the 'mustfind' are what you need to see if the New Day has worked ok -
#!/usr/bin/perl
my( @MUSTFIND ) = (
"NEW DAY PROCEDURE STARTED",
"CONTROL-M LOG CLEANUP STARTED",
"CLEANUP ENDED. DAYS=",
"DAILY SYSTEM STARTED",
"DAILY SYSTEM ENDED",
);
################################################
%mustfind = map { ($_,1) } @MUSTFIND;
my( $rin ) = q();
vec($rin,fileno(STDIN),1) = 1;
if ( select($rout=$rin, undef, undef, 2) ) {
my( $logline );
while ( $logline = <STDIN> ) {
my( $msgid,$desc ) = (split /\|/o,$logline)[1,7];
if ( $desc ) {
foreach my $mf ( @MUSTFIND ) {
if ( $desc=~/$mf/ ) {
$desc =~ s/\s+/ /go;
print "$msgid|$desc\n";
delete $mustfind{$mf};
}
}
}
}
} else {
die "No input found.\n";
}
if ( %mustfind ) {
foreach ( keys %mustfind ) {
print "Did not find - $_\n";
}
exit 1;
}
exit 0;