#!/usr/local/bin/perl
# 
# $Header: crsdiag.pl.sbs 11-apr-2007.12:17:51 ilam Exp $
#
# crsdiag.pl
# 
# Copyright (c) 2007, Oracle. All rights reserved.  
#
#    NAME
#      crsdiag.pl - <one-line expansion of the name>
#
#    DESCRIPTION
#      <short description of component this file declares/defines>
#
#    NOTES
#      <other useful comments, qualifications, etc.>
#
#    MODIFIED   (MM/DD/YY)
#    ilam        04/11/07 - Fix hard-coded CRS location
#    rajayar     04/05/07 - Creation
# 

print "Production Copyright 2004, 2007, Oracle.  All rights reserved\n";
print "Cluster Ready Services (CRS) diagnostic collection tool wrapper script\n";

$ORA_CRS_HOME="%ORA_CRS_HOME%/has";

if ($ORA_CRS_HOME =~ 'ORA_CRS_HOME')
{
  print "CRS home is not present in this environment. Skipping CRS diagnostics collection. \n"; 
  exit;
}

$ORACLE_HOME="%ORACLE_HOME%";

system("${ORACLE_HOME}/perl/bin/perl ${ORA_CRS_HOME}/bin/diagcollection.pl --collect --crshome ${ORA_CRS_HOME} @ARGV");

exit;

