<sdp_diaglet product="BI1111" set="A397BI1111_gen" title="Oracle Business Intelligence Enterprise Edition 11.1.1 Preinstall (Generic)" type="A">
<sdp_meta id="$Id: A397BI1111_gen.xml,v 1.2 2012/08/08 14:50:15 mschenke Exp $"/>
<sdp_meta author="JCR" change="Fix Dependencies, improve rule results" date="20120807" type="history"/>
<sdp_content set="A397BI1111_gen" title="Oracle Business Intelligence Enterprise Edition 11.1.1 Preinstall (Generic)" type="check">

<sdp_facts>

<sdp_fact id="F00001">
<sdp_description><![CDATA[This fact collection gets required information for AIX operating system parameters.]]></sdp_description>
<sdp_parameters>
<sdp_parameter name="BI.OS.AIX"/>
</sdp_parameters>
<sdp_command type="RDA"><![CDATA[
var $hsh = {}
var (undef,$tl,$sp) = split('-',command('oslevel -s'))
var $hsh->{'TLSP'} = concat(replace($tl,'^0+'),'.',replace($sp,'^0+'))
var $hsh->{'IZ85268'} = \
  cond(grepCommand('/usr/sbin/instfix -ik IZ85826','no','if'),false,true)
call setHcveParameter('BI.OS.AIX',$hsh)
]]></sdp_command>
</sdp_fact>

<sdp_fact id="F00003">
<sdp_description><![CDATA[This fact collection gets required information for Linux operating system parameters.]]></sdp_description>
<sdp_parameters>
<sdp_parameter name="BI.OS.LINUX"/>
</sdp_parameters>
<sdp_command type="RDA"><![CDATA[import $OS_NAM,$OS_TYP
var $hsh = {}
if compare('eq',$OS_TYP,'Oracle',true)
{if match($OS_NAM,'Update\s*(\d+)',true)
  var ($hsh->{'OL','UL'}) = last
 elsif match($OS_NAM,'release\s*\d+\.(\d+)',true)
  var ($hsh->{'OL','UL'}) = last
}
elsif compare('eq',$OS_TYP,'Red Hat')
{if match($OS_NAM,'Update\s*(\d+)',true)
  var ($hsh->{'RH','UL'}) = last
 elsif match($OS_NAM,'release\s*\d+\.(\d+)',true)
  var ($hsh->{'RH','UL'}) = last
}
elsif compare('eq',$OS_TYP,'SuSe')
{var ($lin) = grepFile('/etc/SuSE-release','^PATCHLEVEL','if')
 var $hsh->{'SUSE','SP'} = value($lin)
}
call setHcveParameter('BI.OS.LINUX',$hsh)
]]></sdp_command>
</sdp_fact>

<sdp_fact id="F00004">
<sdp_description><![CDATA[This fact collection gets required information for Solaris operating system parameters.]]></sdp_description>
<sdp_parameters>
<sdp_parameter name="BI.OS.SOL"/>
</sdp_parameters>
<sdp_command type="RDA"><![CDATA[var ($lin) = grepFile('/etc/release','Solaris','if')
var $val = field('\D',0,field('_u',1,$lin))
call setHcveParameter('BI.OS.SOL.UL',$val)
]]></sdp_command>
</sdp_fact>

<sdp_fact id="F00010">
<sdp_description><![CDATA[This fact collection gets required processor information.]]></sdp_description>
<sdp_parameters>
<sdp_parameter name="BI.PROCESSOR"/>
</sdp_parameters>
<sdp_command type="RDA"><![CDATA[import $OS_ARC,$OS_PLT
var $hsh = {}

# Determine processor type
var $prc = $OS_ARC
if compare('eq',$OS_PLT,'AIX')
{var ($cpu) = field('_',1,\
                    grepCommand('/usr/sbin/prtconf','Processor Type','if'))
 if !match($cpu,'^POWER')
  var $prc = 'not POWER'
 else
  var $prc = concat('POWER',field('\D',0,substr($cpu,5)))
}
var ($hsh->{'TYPE'}) = $prc

# Determine processor speed in GHz
if compare('eq',$OS_PLT,'AIX')
{var ($str) = command('pmcycles')
 var $unt = field('\s+',-1,$str)
 var $spd = field('\s+',-2,$str)
 var $spd = check($unt,\
   '^K',expr('/',$spd,1000000),\
   '^M',expr('/',$spd,1000),\
   '^G',$spd,\
   'undetermined')
}
elsif compare('eq',$OS_PLT,'HP-UX')
{if !testFile('x','/stand/vmunix')
  var $msg = 'Cannot access [/stand/vmunix]'
 if !testFile('x','/dev/mem')
  var $msg = concat($msg,'|Cannot access [/dev/kmem]')
 if $msg
  var $spd = $msg
 else
 {var $tmp = createTemp('processor')
  call writeTemp('processor','itick_per_tick/D')
  call closeTemp('processor')
  var ($spd) = reverse(command(\
    concat('adb -k /stand/vmunix /dev/kmem <',quote($tmp,'x'))))
  call unlinkTemp('processor')
  var $spd = expr('/',field('\s+',1,$spd),1000000)
 }
}
elsif compare('eq',$OS_PLT,'Linux')
{if !testFile('r','/proc/cpuinfo')
  var $spd = 'Cannot access [/proc/cpuinfo]'
 else
 {var @cpu = grepFile('/proc/cpuinfo','.')
  var $spd = field('\s+:\s+',1,grep(@cpu,'cpu MHz','f'))
  var $spd = expr('/',$spd,1000)
 }
}
elsif compare('eq',$OS_PLT,'Sun')
{if !testFile('x','/usr/sbin/psrinfo')
  var $spd = 'Cannot access [/usr/sbin/psrinfo]'
 else
 {var ($lin) = grepCommand('/usr/sbin/psrinfo -v','processor operates at','f')
  var $spd = field('\s+',5,$lin)
  var $spd = expr('/',$spd,1000)
 }
}
elsif compare('eq',$OS_PLT,'Windows')
{var $reg = 'HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0'
 var $spd = hex2dec(getRegValue($reg,'~MHz'))
 var $spd = expr('/',$spd,1000)
}
var ($hsh->{'SPEED'}) = $spd
call setHcveParameter('BI.PROCESSOR',$hsh)
]]></sdp_command>
</sdp_fact>

</sdp_facts>


<sdp_group>

<sdp_rule id="A00010" mode="RECORD" name="OS Platform">
<sdp_command type="RDA"><![CDATA[import $OS_PLT
call setHcveVariable('$BOOK')
var $BOOK = 'Oracle Fusion Middleware System Requirements and Specifications \
             11g Release 1 (11.1.1)'
call setHcveResult($OS_PLT)
]]></sdp_command>
<sdp_description><![CDATA[This rule displays the operating system platform.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00020" mode="RECORD" name="OS Name">
<sdp_command type="RDA"><![CDATA[import $OS_NAM
call setHcveResult($OS_NAM)
]]></sdp_command>
<sdp_description><![CDATA[This rule displays the operating system name.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00030" mode="RECORD" name="OS Version">
<sdp_command type="RDA"><![CDATA[import $OS_VER
call setHcveResult($OS_VER)
]]></sdp_command>
<sdp_description><![CDATA[This rule displays the operating system version.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00040" mode="RECORD" name="OS Bit">
<sdp_command type="RDA"><![CDATA[import $OS_BIT
call setHcveResult($OS_BIT)
]]></sdp_command>
<sdp_description><![CDATA[This rule displays the operating system bit structure.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00100" mode="RECORD" name="BI Version">
<sdp_command type="PROMPT" default="11.1.1.6" variable="$OBIEE_VERSION"><![CDATA[OBIEE Version]]></sdp_command>
<sdp_description><![CDATA[This rule prompts for the Oracle Business Intelligence Enterprise Edition version to be installed.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00101" mode="VERIFY" name="BI Version OK?">
<sdp_command type="RDA"><![CDATA[import $OBIEE_VERSION
if match($OBIEE_VERSION,'^11\.1\.1\.[356]\.*')
 return setHcveResult('OK')
call setHcveResult('unexpected')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the Oracle Business Intelligence version entered is an expected version.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="OK" result="PASSED"><![CDATA[The entered version is an expected version.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The entry for Oracle Business Intelligence version is unexpected. The expected entries are ``11.1.1.5`` or ``11.1.1.6``.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00200" mode="VERIFY" name="OS Certified?">
<sdp_command type="RDA"><![CDATA[
import $OS_PLT,$OS_NAM,$OS_VER,$OS_BIT,$OS_ARC,$OS_TYP,$OS_LVL
if compare('eq',$OS_PLT,'AIX')
{if !expr('==',$OS_BIT,64)
  return setHcveResult('not64BitAIX')
 var @ver = split('\.',$OS_VER)
 var $ver = concat($ver[0],'.',$ver[1])
 if compare('eq',$ver,'6.1')
 {if !match(getHcveFact('BI.PROCESSOR.TYPE'),'POWER',true)
   return setHcveResult('notAixPower')
  var ($tl,$sp) = split('\.',getHcveFact('BI.OS.AIX.TLSP'))
  if !match($tl,'(2|4|6)')
   return setHcveResult('Unacceptable61TL')
  if expr('==',$tl,2)
   return setHcveResult(cond(expr('>=',$sp,5),\
     cond(getHcveFact('BI.OS.AIX.IZ85268'),   'Acceptable','NeedIZ85268'),\
                                                           'MinSP5'))
  if expr('==',$tl,4)
   return setHcveResult(cond(expr('>=',$sp,9),'Acceptable','MinSP9'))
  if expr('==',$tl,6)
   return setHcveResult(cond(expr('>=',$sp,5),'Acceptable','MinSP5'))
  return setHcveResult('AIXTL')
 }
 if compare('EQ',$ver,'7.1')
  return setHcveResult('Acceptable')
 return setHcveResult('UnacceptableAIX')
}
elsif compare('eq',$OS_PLT,'HP-UX')
 if !expr('==',$OS_BIT,64)
  return setHcveResult('not64bitHPUX')
 if !compare('eq',$OS_VER,'11.31')
  return setHcveResult('UnacceptableHPUX')
 if !match($OS_ARC,'itanium',true)
  return setHcveResult('HPUXnotItanium')
 return setHcveResult('Acceptable')
}
elsif compare('eq',$OS_PLT,'Linux')
{if match($OS_TYP,'oracle',true)
 {if or(match($OS_NAM,'october',true),match($OS_NAM,'release 4\.\d+$',true))
   return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.LINUX.OEL.UL'),7),\
     'Acceptable','MinUL7'))
  if or(match($OS_NAM,'carthage',true),match($OS_NAM,'release 5\.\d+$',true))
   return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.LINUX.OEL.UL'),3),\
     'Acceptable','MinUL3'))
  if match($OS_NAM,'release 6\.\d+$',true)
   return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.LINUX.OEL.UL'),1),\
     'Acceptable','MinUL1'))
  return setHcveResult('UnacceptableOracle')
 }
 elsif match($OS_TYP,'red hat',true)
 {if match($OS_NAM,'nahant',true)
   return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.LINUX.RH.UL'),7),\
     'Acceptable','MinUL7'))
  if match($OS_NAM,'tikanga',true)
   return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.LINUX.RH.UL'),3),\
     'Acceptable','MinUL3'))
  if match($OS_NAM,'santiago',true)
   return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.LINUX.OEL.UL'),1),\
     'Acceptable','MinUL1'))
  return setHcveResult('UnacceptableRedHat')
 }
 elsif match($OS_TYP,'suse',true)
 {if match($OS_NAM,'SLES-10',true)
   return setHcveResult(cond(expr('>=',getHcveFacat('BI.OS.LINUX.SUSE.SP'),1),\
     'Acceptable','MinSP1'))
  if match($OS_NAM,'SLES-11',true)
   return setHcveResult('Acceptable')
  return setHcveResult('UnacceptableSLES')
 }
 else
  return('UnacceptableLinux')
}
elsif compare('eq',$OS_PLT,'Sun')
{if !expr('==',$OS_BIT,64)
  return setHcveResult('not64bitSolaris')
 var $ver = field('\.',1,$OS_VER)
 if !or(match($OS_ARC,'sparc',true),match($OS_ARC,'intel',true))
  return setHcveResult('UnacceptableArcSol')
 if expr('==',$ver,10)
  return setHcveResult(cond(expr('>=',getHcveFact('BI.OS.SOL.UL'),8),\
    'Acceptable','MinUL8'))
 if expr('==',$ver,11)
  return setHcveResult('Acceptable')
 return setHcveResult('UnacceptableSolaris')
}
elsif compare('eq',$OS_PLT,'Windows')
{if and(match($OS_NAM,'2003'),not(match($OS_NAM,'R\d+')))
  return setHcveResult(cond(expr('>=',field('\s+',2,$OS_LVL),2),\
    'Acceptable','MinSP2'))
 if and(match($OS_NAM,'2003'),match($OS_NAM,'R\d+'))
  return setHcveResult('Acceptable')
 if and(match($OS_NAM,'2008'),not(match($OS_NAM,'R\d+')))
  return setHcveResult(cond(expr('>=',field('\s+',2,$OS_LVL),1),\
    'Acceptable','MinSP1'))
 if and(match($OS_NAM,'2008'),match($OS_NAM,'R\d+'))
  return setHcveResult(cond(expr('==',$OS_BIT,64),\
    'Acceptable','not64bitWin2008R2'))
 if match($OS_NAM,'windows 7',true)
  return setHcveResult(cond(expr('==',$OS_BIT,64),\
    'Acceptable','not64bitWin7'))
 return setHcveResult('UnacceptableWindows')
}
call setHcveResult('OtherOS')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the operating system is certified for Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Acceptable" result="PASSED"><![CDATA[The operating system is supported with Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is an issue with the operating system.
|*Result Value*|*Action*|
|AIXTL|Oracle Business Intelligence Enterprise Edition 11.1.1 is not certified with the TL level of your AIX operating system. Refer to ${'BOOK} for certified operating systems.|
|HPUXnotItanium|Only HP-UX operating systems on Itanium-based machines are certified with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|MinSP1|Update your operating system to at least Service Pack 1.|
|MinSP2|Update your operating system to at least Service Pack 2.|
|MinSP5|Update your operating system to at least Service Pack 5.|
|MinSP9|Update your operating system to at least Service Pack 9.|
|MinUL1|Update your operating system to at least Update Level 1.|
|MinUL3|Update your operating system to at least Update Level 3.|
|MinUL7|Update your operating system to at least Update Level 7.|
|MinUL8|Update your operating system to at least Update Level 8.|
|NeedIZ85268|Install iFix patch IZ85268.|
|not64bitAIX|Only 64-bit AIX operating systems are supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|not64bitHPUX|Only 64-bit HP-UX operating systems are supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|not64bitSolaris|Only 64-bit Solaris operating systems are supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|not64bitWin2008R2|Only 64-bit Windows 2008 R2 operating systems are support with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|not64bitWin7|Only 64-bit Windows 7 operating systems are supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|notAixPower|Only AIX on POWER systems is supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|Unacceptable61TL|Your AIX Technology Level is not supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Upgrade to a supported Technology Level. Refer to ${'BOOK} for certified operating systems.|
|UnacceptableAIX|Your AIX version is unacceptable. Refer to ${'BOOK} for certified operating systems.|
|UnacceptableArcSol|Only Solaris on Intel or SPARC systems is supported with Oracle Business Intelligence Enterprise Edition 11.1.1. Refer to ${'BOOK} for certified operating systems.|
|UnacceptableHPUX|Your HP-UX version is unacceptable. Refer to ${'BOOK} for certified operating systems.|
|UnacceptableSLES|Your SuSE version is unacceptable. Refer to ${'BOOK} for certified operating systems.|
|UnacceptableSolaris|Your Solaris version is unacceptable. Refer to ${'BOOK} for certified operating systems.|
|UnacceptableWindows|Your Windows version is unacceptable. Refer to ${'BOOK} for certified operating systems.|
|OtherOS|Your operating system is not covered by this rule set. Ensure that you are using a certified operating system. Refer to ${'BOOK} for certified operating systems.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00300" mode="RECORD" name="Install Location">
<sdp_command type="RDA"><![CDATA[import $OBIEE_VERSION
call setHcveVariable('$OBIEE_HOME')
var $OBIEE_HOME = undef
if ?nvl(getEnv('WL_HOME'),getEnv('ORACLE_HOME'))
{var @dir = splitDir(last)
 call pop(@dir)
 var $OBIEE_HOME = catDir(@dir,$OBIEE_VERSION,'Oracle_BI1')
}
else
 var $OBIEE_HOME = catDir(cond(isUnix(),'','C:'),'app',${RDA.MACHINE},\
   'product',$OBIEE_VERSION,'Oracle_BI1')
]]></sdp_command>
<sdp_command default="$OBIEE_HOME" type="PROMPT" variable="$OBIEE_HOME"><![CDATA[Planned Business Intelligence installation location]]></sdp_command>
<sdp_description><![CDATA[This rule prompts for the location in which Oracle Business Intelligence Enterprise Edition is to be installed.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00301" mode="VERIFY" name="Install Location Valid?">
<sdp_command type="RDA"><![CDATA[import $OBIEE_HOME
call setHcveResult(cond(testDir('e',$OBIEE_HOME),'Valid','Invalid'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the installation location for Oracle Business Intelligence Enterprise Edition exists.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Valid" result="PASSED"><![CDATA[The installation location exists.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The selected installation location was not found. The installation location must be an existing location.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00350" mode="VERIFY" name="No Prior Install?">
<sdp_dependencies>
<sdp_dependency id="A00301" condition="IS" minimum="PASSED" result="SKIPPED" value="Install location not valid"><![CDATA[The installation location must be valid.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OBIEE_HOME
if or(testDir('e',catDir($OBIEE_HOME,'Oracle_BI')),\
      testDir('e',catDir($OBIEE_HOME,'instances','instance4','bifoundation')))
 return setHcveResult('PriorInstall')
call setHcveResult('InstallLocationClean')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the installation location does not have superficial evidence of a prior installation.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="InstallLocationClean" result="PASSED"><![CDATA[The installation location does not have obvious evidence of a prior Business Intelligence installation.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The selected installation location has evidence of a prior Business Intelligence installation. Prior installations must be completely removed before making a new installation.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00400" mode="VERIFY" name="User Privileges?">
<sdp_command type="RDA"><![CDATA[import $OBIEE_HOME,$OS_PLT
macro check_priv
{var $flg = true
 loop $lin (grepCommand(concat('net user ',${RDA.LOGIN}),\
                        '(^(Global|Local) Group Memberships|^\s+\S)'))
 {if $flg
  {next !match($lin,'^Local')
   var $flg = false
  }
  if match($lin,'\bAdministrators\b')
   return true
  break match($lin,'^Global')
 }
 return false
}
var @tbl = ()
if !testDir('r',$OBIEE_HOME)
 call push(@tbl,'notRead')
if !testDir('w',$OBIEE_HOME)
 call push(@tbl,'notWrite')
if !testDir('x',$OBIEE_HOME)
 call push(@tbl,'notExecute')
if !compare('eq',$OS_PLT,'Windows')
{var $usr = ${RDA.USER}
 if and(compare('eq',$OS_PLT,'Linux'),compare('eq',$usr,'root'))
  call push(@tbl,'root')
 if !testFile('r','/etc/passwd')
  call push(@tbl,'Cannot read /etc/passwd')
 else
 {var $cmd = cond(compare('eq',$OS_PLT,'Sun'),'/usr/xpg4/bin/id -nu',\
                                              '/usr/bin/id -nu')
  if !grepFile('/etc/passwd',concat('^',first(command($cmd)),':'),'f')
   call push(@tbl,'notInPasswd')
 }
 if !testFile('r','/etc/group')
  call push(@tbl,'Cannot read /etc/group')
 else
 {var $cmd = cond(compare('eq',$OS_PLT,'Sun'),'/usr/xpg4/bin/id -ng',\
                                              '/usr/bin/id -ng')
  if !grepFile('/etc/group',concat('^',first(command($cmd)),':'),'f')
   call push(@tbl,'notInGroup')
 }
}
elsif !check_priv()
 call push(@tbl,'notAdministrator')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Adequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks if the user has the privileges needed to install the products.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[The user has the privileges needed to install the products.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Issues were found with the user and their privileges:
|*Return Value*|*Action*|
|notRead|The user must have read permissions to the install location.|
|notWrite|The user must have write permissions to the install location.|
|notExecute|The user must have execute permissions to the install location.|
|root|The installing user should not be ``root``.|
|notAdministrator|The user must have ``Administrator`` privileges for installation.|
|Cannot read /etc/passwd|The user could not read the ``/etc/passwd`` file to verify they are listed.|
|notInPasswd|The ``/etc/passwd`` file does not contain the user. Add the user to the ``/etc/passwd`` file.|
|Cannot read /etc/group|The user could not read the ``/etc/group`` file to verity that the group is listed.|
|notInGroup|The ``/etc/group`` file does not contain the group. Add the group to the ``/etc/group`` file.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00500" mode="RECORD" name="Available Disk Space (GiB)">
<sdp_dependencies>
<sdp_dependency id="A00301" condition="IS" minimum="PASSED" result="SKIPPED" value="Installation location not valid"><![CDATA[The installation location must be valid.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OBIEE_HOME
call setHcveVariable('$OBIEE_DISK')
var $OBIEE_DISK = expr('/',get_df($OBIEE_HOME),1048576)
call setHcveResult($OBIEE_DISK)
]]></sdp_command>
<sdp_description><![CDATA[This rule determines the amount of available disk space in the installation location.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00501" mode="VERIFY" name="Disk Space OK?">
<sdp_dependencies>
<sdp_dependency id="A00301" condition="IS" minimum="PASSED" result="SKIPPED" value="Installation location not valid"><![CDATA[The installation location must be valid.]]></sdp_dependency>
<sdp_dependency id="A00500" condition="N" result="SKIPPED" value="Disk space not determined"><![CDATA[The amount of available disk space must be known.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OBIEE_DISK
call setHcveResult(cond(expr('>=',$OBIEE_DISK,20),'Adequate','Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that there is adequate disk space available in the installation location.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED" syntax="wiki"><![CDATA[There is adequate available disk space in ${`OBIEE_HOME} to install Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is not enough available disk space in ${`OBIEE_HOME} to install Oracle Business Intelligence Enterprise Edition 11.1.1. There must be at least 20 GiB available.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00510" mode="RECORD" name="Temp Space (MiB)">
<sdp_command type="RDA"><![CDATA[import $OS_PLT
call setHcveVariable('$TEMP_SPACE','$TEMP_LOC')
var $TEMP_SPACE = 0
if match($OS_PLT,'AIX|HP-UX|Linux|Sun')
{var $TEMP_SPACE = get_df('/tmp')
 var $TEMP_LOC = '/tmp'
}
loop $nam ('TMP','TMPDIR')
{var $val = 0
 if $dir = getEnv($nam,undef)
 {var $val = get_df($dir)
  if expr('>',$val,$TEMP_SPACE)
  {var $TEMP_SPACE = $val
   var $TEMP_LOC = $nam
  }
 }
}
var $TEMP_SPACE = expr('/',$TEMP_SPACE,1024)
call setHcveResult($TEMP_SPACE)
]]></sdp_command>
<sdp_description><![CDATA[This rule determines the amount of temporary space available in the temporary location with the most available space.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00511" mode="VERIFY" name="Temp Space OK?">
<sdp_dependencies>
<sdp_dependency id="A00510" condition="N" result="SKIPPED" value="Temp space not determined"><![CDATA[The amount of temp space must be known.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $TEMP_SPACE,$TEMP_LOC
call setHcveResult(cond(expr('>=',$TEMP_SPACE,950),'Adequate','Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that there is adequate temporary space available.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED" syntax="wiki"><![CDATA[There is adequate temporary space in ${`TEMP_LOC} to install Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is not enough available temporary space to install Oracle Business Intelligence Enterprise Edition 11.1.1. There must be at least 950 MiB available.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00520" mode="RECORD" name="Swap Space (GiB)">
<sdp_command type="RDA"><![CDATA[import $OS_PLT
call setHcveVariable('$SWP_SPACE','@SYS')
if compare('eq',$OS_PLT,'AIX')
{if !testFile('x','/usr/sbin/lsps')
  return setHcveResult('ALERT- SWAP space cannot be determined')
 var ($swp) = grepCommand('/usr/sbin/lsps -s','\s*(\d+)MB','f1')
}
elsif compare('eq',$OS_PLT,'HP-UX')
{if !testFile('x','/usr/sbin/swapinfo')
  return setHcveResult('ALERT- SWAP space cannot be determined')
 var ($swp) = command('/usr/sbin/swapinfo -qm')
}
elsif compare('eq',$OS_PLT,'Linux')
{if !testFile('x','/usr/bin/free')
  return setHcveResult('ALERT - SWAP space cannot be determined')
 var $swp = field('\s+',1,grepCommand('/usr/bin/free -mt','Swap','f'))
}
elsif compare('eq',$OS_PLT,'Sun')
{if !testFile('x','/etc/swap')
  return setHcveResult('ALERT - SWAP space cannot be determined')
 var ($cmd) = grepCommand('/etc/swap -s','^total:','f')
 var $swp = field('\s+',0,replace(field('\s+',10,$cmd),'k',' k '))
 var $swp = expr('/',$swp,1024)
}
elsif compare('eq',$OS_PLT,'Windows')
{if !findCommand('systeminfo')
  return setHcveResult('Cannot access systeminfo')
 var @SYS = command(last)
 var $swp = undef
 if !@SYS
  return setHcveResult('Cannot access systeminfo')
 if !field(':',2,grep(@SYS,'(Virtual Memory|Page File): Max Size:','f'))
  return setHcveResult('Cannot determine Virtual Memory')
 if !match(last,'\s*(.*?)\s*([KGM]B)$')
  return setHcveResult('Cannot determine Virtual Memory')
 var ($swp,$unt) = (last)
 var $swp = replace($swp,'\D','',true)
 if compare('eq',$unt,'KB')
  var $swp = expr('/',$swp,1024)
 elsif compare('eq',$unt,'GB')
  var $swp = expr('*',$swp,1024)
}
else
 return setHcveResult('OtherOS')
var $SWP_SPACE = expr('/',$swp,1024)
call setHcveResult(cond(isNumber($swp),$SWP_SPACE,'SWAPNotSet'))
]]></sdp_command>
<sdp_description><![CDATA[This rule determines the amount of swap space.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00521" mode="VERIFY" name="Swap OK?">
<sdp_dependencies>
<sdp_dependency id="A00520" condition="N" result="SKIPPED" value="Swap space not determined"><![CDATA[The amount of swap space must be known.]]></sdp_dependency>
<sdp_dependency id="A00520" contition="==" minimum="0" result="SKIPPED" value="Swap space not determined"><![CDATA[The amount of swap space must be known.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $SWP_SPACE
call setHcveResult(cond(expr('>=',$SWP_SPACE,3),'Adequate','Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that there is adequate swap space.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED" syntax="wiki"><![CDATA[There is adequate swap space to install Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is not enough swap space to install Oracle Business Intelligence Enterprise Edition 11.1.1. There must be at least 3 GiB.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00600" mode="RECORD" name="Physical Memory (RAM) (GiB)">
<sdp_command type="RDA"><![CDATA[import $OS_PLT,@SYS
call setHcveVariable('$MEM')
if compare('eq',$OS_PLT,'AIX')
{var ($mem) = match(grepCommand(\
   "/usr/sbin/lsattr -HE -l sys0 -a realmem",'\s+\d+\s+','f'),'\s+(\d+)\s+')
 var $MEM = expr('/',$mem,1048576)
}
elsif compare('eq',$OS_PLT,'HP-UX')
{if grepCommand('/usr/contrib/bin/machinfo','Memory\s*[=:]\s*(\d+)\s*MB','f1')
  var $MEM = expr('/',last,1024)
 else
 {var $mem = nvl(\
    field('\s+',6,grepFile('/var/adm/syslog/syslog.log','Physical','f')),\
    field('\s+',6,grepFile('/var/adm/syslog/OLDsyslog.log','Physical','f')),\
    field('\s+',1,grepCommand('/usr/sbin/dmesg','Physical:','f')),\
    cond(getSetting('NO_CSTM'),0,\
       expr('*',1024,match(grepCommand(\
         "/usr/bin/echo 'selall;info;wait;infolog;view;done' | /usr/sbin/cstm",\
         'Total Configured Memory','f'),'\:\s+(\d+)\s+MB'))),\
    0)
  var $MEM = expr('/',$mem,1048576)
 }
}
elsif compare('eq',$OS_PLT,'Linux')
{var $MEM = nvl(\
   field('\s+',1,grepCommand('/usr/bin/free -m','Mem','f')),\
   0)
 var $MEM = expr('/',$MEM,1024)
}
elsif compare('eq',$OS_PLT,'Sunos')
{var $MEM = nvl(\
   field('\s+',2,grepCommand('/usr/sbin/prtconf','Memory','f')),\
   0)
 var $MEM = expr('/',$MEM,1024)
}
elsif compare('eq',$OS_PLT,'Windows')
{if !@SYS
  return setHcveResult('Cannot access systeminfo')
 if !field(':',1,grep(@SYS,'Total Physical Memory:','f'))
  return setHcveResult('Cannot determine Physical Memory')
 if !match(last,'\s*(.*?)\s*([KGM]B)$')
  return setHcveResult('Cannot determine Physical Memory')
 var ($MEM,$unt) = (last)
 var $MEM = replace($MEM,'\D',true)
 if compare('eq',$unt,'KB')
  var $MEM = expr('/',$MEM,1048576)
 elsif compare('eq',$unt,'MB')
  var $MEM = expr('/',$MEM,1024)
}
else
 return setHcveResult('OtherOS')
call setHcveResult($MEM)
]]></sdp_command>
<sdp_description><![CDATA[This rule determines the amount of physical memory on the machine.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00601" mode="VERIFY" name="Physical Memory OK?">
<sdp_dependencies>
<sdp_dependency id="A00600" condition="N" result="SKIPPED" value="Physical memory not determined"><![CDATA[The amount of physical memory must be known.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $MEM
call setHcveResult(cond(expr('>=',$MEM,2),'Adequate','Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that there is adequate physical memory.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED" syntax="wiki"><![CDATA[There is adequate physical memory to install Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is not enough physical memory to install Oracle Business Intelligence Enterprise Edition 11.1.1. There must be at least 2 GiB.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00700" mode="VERIFY" name="Processor Speed OK?">
<sdp_command type="RDA"><![CDATA[
call setHcveVariable('$PROC_SPD')
var $PROC_SPD = getHcveFact('BI.PROCESSOR.SPEED')
if !isNumber($PROC_SPD)
 return setHcveResult($PROC_SPD)
call setHcveResult(cond(expr('>=',$PROC_SPD,1.5),'Adequate','Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the processor speed is adequate for Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED" syntax="wiki"><![CDATA[The processor speed is adequate for Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
<sdp_action condition="==" minimum="Inadequate" result="FAILED" syntax="wiki"><![CDATA[The processor speed of ${`PROC_SPD} is inadequate for Oracle Business Intelligence Enterprise Edition 11.1.1. The processor(s) must operate at 1.5 GHz or higher.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The processor speed was not determined. Ensure that the processor speed is at least 1.5 GHz.
|*Return Value*|*Action*|
|Cannot access...|The user has insufficient privileges to access the needed information.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00800" mode="VERIFY" name="Ports Available?">
<sdp_command type="RDA"><![CDATA[
var (@prt,@req,@tbl,%tbl) = ()
loop $prt (grepCommand('netstat -an','[\.:](\d+)\s.*(LISTEN|ESTABLISHED)','1'))
 var $tbl{$prt} = 1
loop $req ('1423','5300','6700','6701','6702','7001','9700','9701','9703',\
           '9704','9705','9706','9707','9708','9710','9804','9810')
{if exists($tbl{$req})
  call push(@tbl,$req)
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'noConflicts'))
]]></sdp_command>
<sdp_description><![CDATA[This rule determines if the default ports for Oracle Business Intelligence Enterprise Edition 11.1.1 are in use.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="noConflicts" result="PASSED"><![CDATA[The default ports for Oracle Business Intelligence Enterprise Edition 11.1.1 are not in use.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[There is an overlap of active ports and ports typically used by Oracle Business Intelligence Enterprise Edition 11.1.1.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00900" mode="RECORD" name="WLS Installation">
<sdp_command type="PROMPT" default="N" variable="$WL_INSTALL"><![CDATA[Is WebLogic Server being installed with Business Intelligence (Y/N)?]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user if WebLogic Server is being installed with OBIEE.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00901" mode="RECORD" name="WLS Home">
<sdp_dependencies>
<sdp_dependency id="A00900" condition="=~" minimum="N|n" result="SKIPPED" value="Part of installation"><![CDATA[The WLS home will be set as part of the installation.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OBIEE_HOME
call setHcveVariable('$WL_HOME')
if !?$WL_HOME = getEnv('WL_HOME')
{var @dir = splitDir($OBIEE_HOME)
 call pop(@dir)
 var $WL_HOME = catDir(@dir,'wlserver_10.3')
}
]]></sdp_command>
<sdp_command type="PROMPT" default="$WL_HOME" variable="$WL_HOME"><![CDATA[WebLogic Server home]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the location in which Oracle WebLogic Server is installed.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00902" mode="VERIFY" name="WLS Valid?">
<sdp_dependencies>
<sdp_dependency id="A00900" condition="=~" minimum="N|n" result="SKIPPED" value="Part of installation"><![CDATA[The WLS home will be set as part of the installation.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $WL_HOME
call setHcveResult(cond(testFile('e',catFile($WL_HOME,'.product.properties')),'Valid','notValid'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the Oracle WebLogic Server home is valid.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Valid" result="PASSED"><![CDATA[The Oracle WebLogic Server home is valid.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[Oracle WebLogic Server is not installed in the WebLogic Server home location provided.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00903" mode="RECORD" name="WLS Version">
<sdp_dependencies>
<sdp_dependency id="A00900" condition="=~" minimum="N|n" result="SKIPPED" value="Part of installation"><![CDATA[The version of WLS will be compatible with and dependent upon the version of OBIEE.]]></sdp_dependency>
<sdp_dependency id="A00902" condition="IS" minimum="PASSED" result="SKIPPED" value="WLS home not valid"><![CDATA[The WLS home location must contain an installation of WLS.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $WL_HOME
call setHcveVariable('$WLS_VERSION','$JAVA_HOME')
var $WLS_VERSION = value(grepFile(catFile($WL_HOME,'.product.properties'),\
                                  'WLS_PRODUCT_VERSION','if'))
var $JAVA_HOME = value(grepFile(catFile($WL_HOME,'.product.properties'),\
                                  'JAVA_HOME','if'))
var $JAVA_HOME = replace($JAVA_HOME,'\\:',':')
var $JAVA_HOME = replace($JAVA_HOME,'\\\\','\',true)
call setHcveResult($WLS_VERSION)
]]></sdp_command>
<sdp_description><![CDATA[This rule determines the version of Oracle WebLogic Server that is installed. It also finds Java home.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00904" mode="VERIFY" name="WLS OK?">
<sdp_dependencies>
<sdp_dependency id="A00101" condition="IS" minimum="PASSED" result="SKIPPED" value="BI version must be expected"><![CDATA[The BI version specified must be an expected version.]]></sdp_dependency>
<sdp_dependency id="A00900" condition="=~" minimum="N|n" result="SKIPPED" value="Part of installation"><![CDATA[The version of WLS will be compatible with and dependent upon the version of OBIEE.]]></sdp_dependency>
<sdp_dependency id="A00902" condition="IS" minimum="PASSED" result="SKIPPED" value="WLS home not valid"><![CDATA[The WLS home location must contain an installation of WLS.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OBIEE_VERSION,$WLS_VERSION,$BOOK
var %ver = (3 => '10.3.3',\
            5 => '10.3.5',\
            6 => '10.3.6')
var $ver = field('\.',3,$OBIEE_VERSION)
call setHcveResult(cond(compare('SAME',$WLS_VERSION,$ver{$ver}),'Adequate',\
                                                                'Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the version of Oracle WebLogic Server installed is supported with the version of Oracle Business Intelligence Enterprise Edition to be installed.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[The Oracle WebLogic Server version installed is correct for the Oracle Business Intelligence Enterprise Edition version being installed.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The Oracle WebLogic Server version installed is not supported for the Oracle Business Intelligence Enterprise Edition version being installed. Refer to ${'BOOK} for the correct relationship of Oracle WebLogic Server to Oracle Business Intelligence.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00911" mode="VERIFY" name="JDK Adequate?">
<sdp_dependencies>
<sdp_dependency id="A00900" condition="=~" minimum="N|n" result="SKIPPED" value="Part of installation"><![CDATA[The JDK will be installed with WLS, which is being installed with OBIEE.]]></sdp_dependency>
<sdp_dependency id="A00902" condition="IS" minimum="PASSED" result="SKIPPED" value="WLS home not valid"><![CDATA[The WLS home location must contain an installation of WLS.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $JAVA_HOME
if !testDir('d',$JAVA_HOME)
 return setHcveResult('JDK home is missing')
var $SDK_BIN = catDir($JAVA_HOME,'bin')
if !testDir('d',$SDK_BIN)
 return setHcveResult('JDK bin directory is missing')
if !grepDir($SDK_BIN,${AS.EXE:'javac'})
 return setHcveResult('JDK compiler is missing')
var ($lin) = command(concat(catCommand($SDK_BIN,'java'),' -fullversion 2>&1'))
if !match($lin,'ap64')
 return setHcveResult('JDK is not 64-bit')
var ($rev) = match($lin,'\050SR(\d+)\b')
var $ver = field('\s+',2,\
 command(concat(catCommand($SDK_BIN,'java'),' -version 2>&1')))
var $ver = trim(replace($ver,'[\-\_]','.',true),'"')
if !match($ver,'^\d+')
 return setHcveResult(concat('[',$ver,'] not verified'))
elsif and(match($ver,'^1.6.0'),expr('>=',$rev,24))
 call setHcveResult('Adequate')
else
 call setHcveResult('Not adequate')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the installed JDK version is Java 6 64-bit SR24 or later.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[The correct JDK version is installed.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is an issue with the JDK installation.
|*Return Value*|*Action*|
|JDK is not 64-bit|Install Java 6 64-bit SR24 or later.|
|Not adequate|Install Java 6 64-bit SR24 or later.|
|JDK bin directory is missing|Install full JDK package.|
|JDK compiler is missing|Install full JDK package.|
|... not verified|Cannot verify the version. Make sure Java 6 64-bit SR24 or later is installed.|
|JDK home is missing|Provide the correct location for JDK home.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00915" mode="VERIFY" name="_JAVA_OPTIONS?">
<sdp_command type="RDA"><![CDATA[
call setHcveResult(getEnv('_JAVA_OPTIONS','NotSet'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that _JAVA_OPTIONS is not set.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="NotSet" result="PASSED"><![CDATA[``_JAVA_OPTIONS`` is not set. No action needed.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The environment variable ``_JAVA_OPTIONS`` is set. Contact your system administrator, as this should not exist for Oracle Business Intelligence Enterprise Edition to be installed.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A01000" mode="RECORD" name="IP Addresses">
<sdp_command type="RDA"><![CDATA[import $OS_PLT
call setHcveVariable('@IP','$IP','$HST')
var @IP = ()
if compare('eq',$OS_PLT,'AIX')
{var ($HST) = command('hostname')
 var @lst = grepCommand(concat('/usr/sbin/ping -c 1 ',$HST),'.')
 var $IP = replace(field('\s+',3,grep(@lst,'\d+:','f')),':')
}
elsif compare('eq',$OS_PLT,'HP-UX')
{var ($HST) = command('hostname')
 var $IP = field('\s+',3,\
   grepCommand(concat('/usr/sbin/ping ',$HST,' -n 1'),'\s(\d+\.\d+\.)+','f'))
 var $IP = replace($IP,':')
}
if compare('eq',$OS_PLT,'Linux')
{var $HST = field('\.',0,command('hostname'))
 var ($lin) = grepFile('/etc/hosts',\
 concat('^[^#]+\s\<?',quote($HST),'\>?($|\.|\s)'),'f')
 var $IP = field('\s+',0,$lin)
}
elsif compare('eq',$OS_PLT,'Sun')
{var ($HST) = command('hostname')
 var $IP = field('\s+',1,grepCommand(concat('/usr/sbin/ping -a ',$HST),'.','f'))
 var $IP = substr($ip,1,expr('-',length($IP),2))
}
elsif compare('eq',$OS_PLT,'Windows')
{loop $lin (grepCommand('ipconfig','IP(v4)? Address.*:\s*(\S+)','i2'))
  call push(@IP,$lin)
 if field('\.',0,command('hostname'))
  var $HST = last
 else
  var $HST = 'notDetermined'
}
else
 return setHcveResult('OtherOS')
call setHcveResult(cond(scalar(@IP),join("\012",@IP),$IP))
]]></sdp_command>
<sdp_description><![CDATA[Obtains the IP address(es) associated to the machine.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A01010" mode="RECORD" name="Domain Name">
<sdp_command type="RDA"><![CDATA[import $HST,$IP,@IP,$OS_PLT
call setHcveVariable('$DOM')
if !match($OS_PLT,'AIX|HP-UX|Linux|Sun|Windows',true)
 return setHcveResult('OtherOS')
if compare('eq',$OS_PLT,'Windows')
{if grepCommand('ipconfig /all','DNS Suffix.*:\s*\S','fi')
  var $DOM = field(':\s*',1,last)
 else
  var $DOM = 'notDetermined'
}
else
{var ($nam,$dom) = split('\.',$HST,2)
 if testFile('x','/bin/domainname')
  var ($nis) = command('/bin/domainname')
 if testFile('r','/etc/resolv.conf')
  var $dns = field('\s+',1,grepFile('/etc/resolv.conf','domain'))
 var $fil = check($OS_PLT,'AIX',  '/usr/bin/nslookup',\
                          'HP-UX','/bin/nslookup',\
                          'Linux','/usr/bin/nslookup',\
                          'Sun',  '/usr/sbin/nslooup')
 if testFile('x',$fil)
 {if $nam
   var $nsl = field(concat(quote($nam),'\.'),1,\
                    grepCommand(concat($fil,' ',$HST),'Name','f'))
  else
   var $nsl = field(concat(quote($HST),'\.'),1,\
                    grepCommand(concat('/usr/bin/nslookup ',$HST),'Name','f'))
 }
 if $IP
 {if !$nam
   var $ipn = trim(field(concat($HST,'\.'),1,\
            grepCommand(concat($fil,' -sil ',$IP),'Name','f')),'.')
 }
 var $DOM = cond($dom,$dom,\
                 and(length($nis),compare('ne',$nis,'(none)')),$nis,\
                 $dns,$dns,\
                 $nsl,$nsl,\
                 $ipn,$ipn,\
                 'NotFound')
}
call setHcveResult($DOM)
]]></sdp_command>
<sdp_description><![CDATA[This rule obtains the domain name.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A01020" mode="VERIFY" name="DNS Lookup?">
<sdp_command type="RDA"><![CDATA[import $IP,@IP,$HST,$DOM,$OS_PLT
if match($OS_PLT,'AIX|HP-UX|Linux|Sun')
{var $fil = check($OS_PLT,'AIX',  '/usr/bin/nslookup',\
                          'HP-UX','/bin/nslookup',\
                          'Linux','/usr/bin/nslookup',\
                          'Sun',  '/usr/sbin/nslookup')
 return setHcveResult(cond(\
   not(length($ip)),\
     'Cannot determine IP address',\
   not(testFile('x',$fil)),\
     concat('Cannot access ',$fil),\
   and(grepCommand(concat($fil,' ',$HST),concat('\b',quote($IP),'\b'),'f'),\
       grepCommand(concat($fil,' ',$IP),concat('\b',quote($HST),'\b'),'f')),\
     'Host correctly registered in DNS',\
   'DNS lookup failure'))
}
if compare('eq',$OS_PLT,'Windows')
{var $cmd = findCommand('nslookup.exe')
 if !?$cmd
  return setHcveResult('nslookup.exe not found')
 var $HST = cond(defined($DOM),concat($HST,'.',$DOM),$HST)
 var ($ref,@ref) = (quote($HST))
 loop $ip (@IP)
 {if grepCommand(concat($cmd,' ',$ip),$ref,'f')
   call push(@ref,quote($ip))
 }
 if !@ref
  call push(@tbl,'Address failure')
 elsif !grepCommand(concat($cmd,' ',$HST),join('|',@ref),'f')
  call push(@tbl,'host.domain failure')
 return setHcveResult(cond(@tbl,join("\012",@tbl),\
                           'Host correctly registered in DNS'))
}
return setHcveResult('OtherOS')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the host is registered correctly in the DNS.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Host correctly registered in DNS" result="PASSED"><![CDATA[The host is registered correctly in the DNS.]]></sdp_action>
<sdp_action condition="==" minimum="OtherOS" result="FAILED"><![CDATA[The operating system was not recognized as being AIX, HP-UX, Linux, Solaris, or Windows. You must be on a certified operating system.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Address failure|The DNS server failed to resolve the IP address or the result is not linked to the host name.|
|Cannot access /bin/nslookup|Grant execute permissions on ``/bin/nslookup`` to the current user.|
|Cannot access /usr/bin/nslookup|Grant execute permissions on ``/usr/bin/nslookup`` to the current user.|
|Cannot access /usr/sbin/nslookup|Grant execute permissions on ``/usr/sbin/nslookup`` to the current user.|
|Cannot determine IP address|Fix any problem with the host IP address.|
|DNS lookup failure|Verify the DNS lookup mechanism and the host registration in the DNS.|
|host.domain failure|The DNS server failed to resolve the host.domain or the result is not linked to a local IP address.|
|nslookup.exe not found|Could not find nslookup.exe on this machine.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A01100" mode="RECORD" name="DB Type">
<sdp_command type="RDA"><![CDATA[
call setHcveVariable('$DB_TYP')
# Select the type of database
var ($cnt,%rsp,@all,@itm) = (0)
loop $rec (\
  ['Ora10gR2','Oracle 10gR2'],\
  ['Ora11gR1','Oracle 11gR1'],\
  ['Ora11gR2','Oracle 11gR2'],\
  ['DB2','IBM DB2'],\
  ['SQLServ05','Microsoft SQL Server 2005'],\
  ['SQLServ08','Microsoft SQL Server 2008 R2'],\
  ['Other','Other'])
{call push(@itm,incr($cnt),$rec->[1])
 call push(@all,$rsp{$cnt} = $rsp{$abr} = $rec->[0])
}
call setTempSetting('HCVE_INFO','choice')
call setTempSetting('HCVE_INFO_BEF',\
  'Select the type of database you are using for OBIEE:')
call setTempSetting('HCVE_INFO_ITM',join('|',@itm))
call setTempSetting('HCVE_INFO_RSP',join('|',%rsp))
call setTempSetting('HCVE_DEFAULT','Ora11gR2')
call requestSetting('HCVEinfo')
call setHcveResult($DB_TYP = getSetting('HCVE_SELECT'))
# Indicate general type of database
if match($DB_TYP,'^Ora')
 call setHcveParameter('BI.DB.ORACLE',true)
if match($DB_TYP,'^SQLServ')
 call setHcveParameter('BI.DB.MICROSOFT',true)
if match($DB_TYP,'^DB2')
 call setHcveParameter('BI.DB.IBM',true)
if match($DB_TYP,'Other')
 call setHcveParameter('BI.DB.OTHER',true)
]]></sdp_command>
<sdp_command type="GROUP" exec="BI.DB.ORACLE">ORA</sdp_command>
<sdp_description><![CDATA[This rule prompts for the type of database being used for Oracle Business Intelligence Enterprise Edition.]]></sdp_description>
</sdp_rule>

</sdp_group>


<sdp_group id="ORA" exec="0" name="Oracle DB Data Collection">

<sdp_rule id="A01200" mode="RECORD" name="DB Home">
<sdp_command type="PROMPT" default="${ENV.ORACLE_HOME}" variable="$DB_HOM"><![CDATA[Where is the database or database client installed?]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the installation location of the Oracle database or database client.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A01210" mode="RECORD" name="DB Instance Identifier">
<sdp_command type="PROMPT" default="${ENV.ORACLE_SID}" variable="$DB_SID"><![CDATA[What is the database instance identifier?]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the instance identifier to access the database.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A01220" mode="RECORD" name="DB User Name">
<sdp_command type="PROMPT" default="oracle" variable="$DB_USR"><![CDATA[What user name is used to access the datbase (for instance, BIPLATFORM user)?]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the user name to access the database.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A01230" mode="VERIFY" name="Database Access?">
<sdp_command type="RDA"><![CDATA[import $DB_HOM,$DB_SID,$DB_USR
var $env = setEnv('ORACLE_HOME',$DB_HOM)
call setSqlLogin($DB_USR,undef,$DB_SID)
if testSql()
 call setHcveResult(concat('Connection error: [',getSqlMessage(),']'))
else
{set $sql
 {SELECT 'Version=' || version
 " FROM v$instance;
 "SELECT 'User=' || username
 " FROM dba_users;
 "SELECT 'Free|' || tablespace_name || '|' || free || '|'
 " FROM (SELECT tablespace_name, SUM(bytes) free
 "        FROM dba_free_space
 "        GROUP BY tablespace_name);
 }
 call setHcveResult(cond(loadSql(bindSql($sql)),'OK',\
                         concat('Load error: [',getSqlMessage(),']')))
}
call setEnv('ORACLE_HOME',$env)
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies ability to connect to the database.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="OK" result="PASSED"><![CDATA[The database was successfully accessed.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[An issue was encountered in accessing the database.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A01240" mode="RECORD" name="DB Information">
<sdp_dependencies>
<sdp_dependency id="A01230" condition="IS" minimum="PASSED" result="SKIPPED" value="DB access must be successful"><![CDATA[Requires that the DB access has been successful.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[
call setHcveVariable('@DB_TSP','%DB_BIS','%DB_MDS','$DB_VER')
var @sch = ()
var $DB_VER = value(grepLastSql('^Version=','f'))

loop $lin (grepLastSql('^User='))
{var $usr = value($lin)
 if match($usr,'^(.*)_DB_BIS$')
  var $DB_BIS{last} = true
 elsif match($usr,'^(.*)_MDS$')
  var $DB_MDS{last} = true
 else
  next
 call push(@sch,$usr)
}

var @DB_TSP = ()
loop $lin (grepLastSql('^Free\|'))
{var (undef,$nam,$siz) = split('\|',$lin,4)
 if expr('>=',$siz,524288000)
  call push(@DB_TSP,$nam)
}
call setHcveResult(join("\012",'Database version:',$DB_VER,'BI schemas:',@sch,\
  '500MiB tablespaces:',@DB_TSP))
]]></sdp_command>
<sdp_description><![CDATA[This rule extracts the desired information from the SQL executed during DB access check.]]></sdp_description>
</sdp_rule>

</sdp_group>

<sdp_group id="FIN" exec="1" name="Finish Up">

<sdp_rule id="A02000" mode="VERIFY" name="Database Version?">
<sdp_command type="RDA"><![CDATA[import $DB_TYP,$DB_VER
if match($DB_TYP,'^Ora')
{if !match(getHcveResult('A01230'),'OK')
  return setHcveResult('skip')
}
return setHcveResult(check($DB_TYP,\
  'Ora10gR2',cond(and(match($DB_VER,'^10\.2\.0\.'),\
                      compare('ge',$DB_VER,'10.2.0.4')),'Adequate',\
                                                        'Inadequate'),\
  'Ora11gR1',cond(and(match($DB_VER,'^11\.1\.0\.'),\
                      compare('ge',$DB_VER,'11.1.0.7')),'Adequate',\
                                                        'Inadequate'),\
  'Ora11gR2',cond(and(match($DB_VER,'^11\.2\.0\.'),\
                      compare('ge',$DB_VER,'11.2.0.1')),'Adequate',\
                                                        'Inadequate'),\
  'SQLServ05',                                          'notChecked',\
  'SQLServ08',                                          'notChecked',\
  'DB2',                                                'notChecked',\
  'Inadequate'))
call setHcveResult('Inadequate')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the database version is acceptable.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="skip" result="SKIPPED"><![CDATA[HCVE failed to extract database information from the database.]]></sdp_action>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[The database version is adequate for Oracle Business Intelligence Enterprise Edition.]]></sdp_action>
<sdp_action condition="==" minimum="notChecked" result="SKIPPED"><![CDATA[The database version is only checked if the database is Oracle. You must verify that the version of the database is adequate for other types of databases.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The database version is inadequate for Oracle Business Intelligence Enterprise Edition 11.1.1. Use Oracle 11.2.0.4+, 11.1.0.7+, or 11.2.0.1+; Microsoft SQL Server 2005 or 2008 R2; or IBM DB2 9.7+.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A02010" mode="VERIFY" name="OBIEE Schemas?">
<sdp_dependencies>
<sdp_dependency id="A01100" condition="=~" minimum="^Ora" value="Schemas only checked for Oracle databases"><![CDATA[Requires that the database must be Oracle.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $DB_TYP,%DB_BIS,%DB_MDS
if match($DB_TYP,'^Ora')
{if !match(getHcveResult('A01230'),'OK')
  return setHcveResult('skip')
}
loop $nam (keys(%DB_BIS))
{if exists($DB_MDS{$nam})
  return setHcveResult('Adequate')
}
call setHcveResult('Inadequate')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the schemas required for Oracle Business Intelligence Enterprise Edition are established in the database.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="skip" result="SKIPPED"><![CDATA[DB access must be successful]]></sdp_action>
<sdp_action condition="==" minimum="Adquate" result="PASSED"><![CDATA[Your database contains the BIPLATFORM and MDS schemas necessary for Oracle Business Intelligence Enterprise Edition.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[Your database does not contain the BIPLATFORM and MDS schemas required for Oracle Business Intelligence Enterprise Edition.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A02020" mode="VERIFY" name="Scheduler Space?">
<sdp_dependencies>
<sdp_dependency id="A01100" condition="=~" minimum="^Ora" result="SKIPPED" value="Schemas only checked for Oracle databases"><![CDATA[Requires that the database must be Oracle.]]></sdp_dependency>
<sdp_dependency id="A01230" condition="IS" minimum="PASSED" result="SKIPPED" value="HCVE did not retrieve information from database"><![CDATA[Requires database information from the database.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import @DB_TSP
call setHcveVariable('$BI_ADEQUATE')
if defined($DB_TSP[0])
 var $BI_ADEQUATE = $DB_TSP[0]
call setHcveResult(cond(defined($BI_ADEQUATE),'Adequate','Inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that there is adequate tablespace for ``Scheduler``.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[Your database contains at least 500 MiB of free tablespace in ${`BI_ADEQUATE} into which you can install tables if installing ``Scheduler``.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[Your database does not contain at least 500 MiB of free tablespace, which is required if you want to install ``Scheduler``.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A02100" mode="VERIFY" name="DHCP Loopback?">
<sdp_dependencies>
<sdp_dependency id="A00010" condition="=~" minimum="Linux|Windows" result="SKIPPED" value="Only applies to Linux or Windows"><![CDATA[This rule only applies to Linux or Windows operating sytems.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_PLT,$HST,$DOM
var $hst = field('\.',0,$HST)
if compare('eq',$OS_PLT,'Linux')
{var @lin = grepFile('/etc/hosts','^127.0.0.1')
 return setHcveResult(cond(and(\
   grep(@lin,concat('^localhost.',$DOM,' localhost')),\
   grep(@lin,concat('^',$hst,'.',$DOM,' ',$hst))),\
   'set','notSet'))
}
elsif compare('eq',$OS_PLT,'Windows')
 return setHcveResult(cond(grepFile(catFile(concat(\
   getEnv('SYSTEMDRIVE'),':'),'Windows','System32','drivers','etc','hosts'),\
     '^10\.10\.10\.10\s+',$hst,'\.',$DOM,'\s+',$hst)),'set','notSet')
call setHcveResult('OtherOS')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that DHCP loopback is set.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="set" result="PASSED"><![CDATA[You have a loopback adapter set up for use with DHCP.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[You must set up a loopback adapter to run Oracle Business Intelligence with DHPC.]]></sdp_action>
</sdp_actions>
</sdp_rule>

</sdp_group>

</sdp_content>
</sdp_diaglet>
