#!/bin/ksh
subject="BPA 9.0.00 Status Summary Console=`uname -n` Date=`date +%D`"
/data1/perform/BCO_BPAStatusCounter.pl /usr/adm/best1_9.0.00/local/manager/status/GeneralManagerLite/BCO_BPAWebReport/BCO_BPAStatusCount.csv | mutt -s "$subject" dseliver@bmc.com -a /usr/adm/best1_9.0.00/local/manager/status/GeneralManagerLite/BCO_BPAWebReport/BCO_BPAStatusCount.csv -a /usr/adm/best1_9.0.00/local/manager/status/GeneralManagerLite/BCO_BPANodeTimeline.csv -a /usr/adm/best1_9.0.00/local/manager/status/GeneralManagerLite/BCO_BPAWebReport/localhost/BCO_BPANodeListStatusCount.cs

Script to detect errors from yesterday

#!/usr/adm/best1_default/bgs/bin/perl
# This script will parses the BCO_BPAStatus.csv file generated by web page generation and prints
# out the summary to the output
$num_args = $#ARGV + 1;
if ($num_args != 1) {
  print "Error:This script will parses the BCO_BPAStatusCount.csv file generated by web page generation\n";
  print "You must specify the BCO_BPAStatusCount.csv file\n";
  exit;
}
my $gmFile=$ARGV[0];
if (!open(F1,$gmFile))
{
 die "Unable to open BCO_BPAStatusCount.csv file =$gmFile";
}

my $header=undef;
my $yestearday=undef;
my $today=undef;
# get the results from yestearday and today
while(<F1>)
{
  chomp;
  if (!defined($header))
  {
    $header=$_;
        next;
  }
  if (!defined($today))
  {
    # first time through
    $yesterday=$_;
  }
  else
  {
   # all other time
   $yesterday=$today;
  }
  $today=$_;
}
close(F1);
#print "Header=$header\n";
#print "yeasteday=$yesterday\n";
#print "today=$today\n";
my @h=split(/,/,$header);
my @y=split(/,/,$yesterday);
my @t=split(/,/,$today);
# print the statistics
my $count=0;
print "Configuration and change since yesterday\n\n";
foreach(@h)
{
  printf("%s = ",$_);

  if ($count == 0)
  {
    # date only no calculations
        print "$t[0] : $y[0]" ;
  }
  else
  {
    # total and differences from yeasterday
        my $diff=$t[$count]-$y[$count];
        printf("%d : %d :  change %d ",$t[$count],$y[$count],$diff);
  }
  print "\n\n";
  $count++
}
# print the details about the storage where the report resides
print "----------------------Details--------------------------------------\n\n";
print "File system disk space usage for location of status file = $gmFile\n\n";
my $df=`df -k $gmFile`;
print "$df\n";
