Legacy HDS Forums

Script to install HDLM 5.8 on AIX

Discussion created by Legacy HDS Forums on Aug 24, 2006

Originally posted by: webfox



[font="Courier New"]
# Version: 1.0.0
# Date: 26 JUN 2006
# Author : Vinod Subramaniam
################################################################################
#
# Installs HDLM 5.8.
#
################################################################################
# Pragmas
################################################################################
use strict;
use Getopt::Long;
use Time::Local;
use Cwd;
use File::Basename;
use File::Spec;
use Math::BigFloat;

my $V_HDLMDISTPATH = "/distsys/hds/5.8/DLManager.bff";
my $V_XP = undef;
### Validate and test command line options
if (@ARGV<2) {
  printf("\nERROR - Incorrect number of arguments.\n");
  printf("\nUsage:\n  perl.exe  $0\t-ha [Y/N]\t  (HACMP or Non-HACMP)\n");
  die "\n";
} else {
  GetOptions ("ha=s" => \$V_XP) ;
  if (($V_XP eq "Y") || ($V_XP eq "N")){
  } else {
  printf("\nUsage:\n  perl.exe  $0\t-ha [Y/N]\t  (HACMP or Non-HACMP)\n");
  printf("$V_XP\n");
  die "\n";}
}
# VALIDATE MOUNT POINTS

if (!-e $V_HDLMDISTPATH) {
  die("Data directory does not exist - $V_HDLMDISTPATH \n Use mount hood:/distsys /distsys \n");
}

printf ("Installing HDLM 5.8\n");

my $rtccde10 = system ("./sanvgexport.ksh");

# STOP ALL HDLM AGENT SERVICES

if ( !-e "/usr/DynamicLinkManager/bin") {
} else {
my $rtncde = system ("stopsrc -s DLMManager");
my $rtncde1 = system ("installp -u DLManager.rte");
my $rtncde2 = system ("dlmrmdev -A");

}

if (!-e "/var/tmp/hdlm_license" ) {
my $rtncde3 = system ("cp hdlm_license /var/tmp" );
}
my $rtncde4 = system ( "installp -aXgd $V_HDLMDISTPATH all" );
my $rtncde5 = system ( "lslpp -L DLManager.rte");

if ($V_XP eq "N") {
my $rtccde10 = system ("./sanvgimport.ksh"); }
else {
my $rtncde17 = system ("/usr/DynamicLinkManager/bin/dlmodmset -x fcp -s");
my $rtccde11 = system ("./sanvgimporthacmp.ksh");}

my $LUCOUNT = `lsdev -C | grep -i hitachi | wc -l`;
my $KERNELBITS = `bootinfo -K`;
my $PBUFCALC = (( 4 + $LUCOUNT ) * $KERNELBITS * 2 ) + 2560;

my $PBUFACTUAL = `dlmodmset -o | grep pbuf | cut -d":" -f2 | tr -s " " ""`;

$PBUFACTUAL =~ s /\w//g;

if (  $PBUFCALC > 16384 ) {

      system ("dlmodmset -b $PBUFCALC");

}

my $rtncde6 = system ( "/usr/DynamicLinkManager/bin/dlmcfgmgr");
my $rtncde7 = system ( "lsdev -C | grep dlm");
my $rtncde8 = system ( "/usr/DynamicLinkManager/bin/dlnkmgr view -drv | grep -w dlmfdrv0");
my $rtncde9 = system ( "/usr/DynamicLinkManager/bin/dlnkmgr set -afb on -intvl 1 -s");
my $rtncde9 = system ( "/usr/DynamicLinkManager/bin/dlnkmgr set -pchk on -intvl 5 -s");
my $rtncde9 = system ( "/usr/DynamicLinkManager/bin/dlnkmgr set -lb on -lbtype exrr -s");
my $rtncde12 = system ( "/usr/DynamicLinkManager/bin/dlnkmgr view -sys > dlm.out");
my $rtncde13 = system ( "/usr/DynamicLinkManager/bin/dlnkmgr view -path >> dlm.out");
my $rtncde18 = system ( "/usr/DynamicLinkManager/bin/dlmodmset -o >> dlm.out");
my $rtncde14 = system ( "echo `hostname` > mailsubject");
my $rtncde15 = system ( "echo `date` >> mailsubject");
my $rtncde16 = system ( "echo \"HDLM 5.8 UPGRADE\" >> mailsubject");
my $rtc = system ( "cat mailsubject | tr -s \" \" \"\/\" | tr -s \"\n\" \"\/\" > sbjct ");
my $rtc1 = system ( "echo \"vinod.subramaniam\@nscorp.com\" > list");
my $rtncde17 = system ( " mail -s `cat sbjct` -c `cat list`<dlm.out ");[/font]

Outcomes