<sdp_diaglet platform="solaris" product="EB1211" set="A500EB1211_sol" title="Oracle E-Business Suite Release 12 (12.1.1) Preinstall (Solaris)" type="A">
<sdp_meta id="$Id: A500EB1211_sol.xml,v 1.11 2012/02/28 15:14:18 mschenke Exp $" type="version"/>
<sdp_meta author="JCR" change="Improve /etc/hosts Format check" date="20120223" type="history"/>
<sdp_content set="A500EB1211_sol" title="Oracle E-Business Suite Release 12 (12.1.1) Preinstall (Solaris)" type="check">
<sdp_group>

<sdp_rule id="A00100" mode="RECORD" name="OS Type">
<sdp_command type="RDA"><![CDATA[import $OS_ARC,$OS_BIT,$OS_NAM,$OS_VER
call setHcveResult(check(uc($OS_NAM),\
   'SUNOS',concat($OS_NAM,' ',uc($OS_ARC),' ',$OS_VER,' ',$OS_BIT,'-bit'),\
           'Uncertified OS'))
var $BOOK = 'Oracle Applications Installation Guide Using Rapid Install \
  Release 12.1 (12.1.1)'
var $NOTE = 'Knowledge Article 761568.1'
setHcveVariable('$BOOK','$NOTE')
]]></sdp_command>
<sdp_description><![CDATA[This rule retrieves the operating system (OS) name, architecture, version and bit of your system when you work on a Solaris system.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00200" mode="VERIFY" name="OS Certified?">
<sdp_command type="RDA"><![CDATA[import $OS_ARC,$OS_BIT,$OS_NAM,$OS_VER
call setHcveResult(cond(\
  not(${OS.solaris}),   'Inadequate OS',\
  expr('==',$OS_BIT,32),'Uncertified Solaris 32-bit',\
  check($OS_ARC,\
    'Intel',check($OS_VER,'2\.10','Certified',\
                                  'Uncertified Solaris x86 Version'),\
    'Sparc',check($OS_VER,'2\.8',        'Partly Certified',\
                          '2\.(9|10|11)','Certified',\
                                         'Uncertified Solaris SPARC Version'),\
    'Uncertified OS')))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for the correct version of Solaris for installing the application tier of an Oracle E-Business Suite Release 12 (12.1.1), possibly combined with a database tier install. Correct versions for the installation of the application tier and the database tier are Solaris 9 SPARC 64-bit, Solaris 10 SPARC 64-bit, and Solaris 10 x86 64-bit. A Solaris 8 SPARC 64-bit system supports the installation of the application tier only since that version of the Operating System does not support the installation of the 11g Release 1 version of the database.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Certified" result="PASSED"><![CDATA[No action is required.]]></sdp_action>
<sdp_action condition="==" minimum="Partly Certified" result="PASSED"><![CDATA[It is certified to install the application tier on Solaris 8 SPARC only but it is not supported to install the database tier.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[!!SHOWSTOPPER!!
You do not have Solaris SPARC 64-bit or Solaris x86 64-bit or a correct version of Solaris SPARC or Solaris x86 installed on your server. For the certified versions of Solaris SPARC and Solaris x86 see the ${NOTE} and My Oracle Support.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00210" mode="VERIFY" name="Got Maint Updates? ">
<sdp_dependencies>
<sdp_dependency condition="=~" id="A00100" minimum="^SunOS SPARC 2\.(8|9) 64-bit" result="SKIPPED" value="Not on Solaris 8 or 9 SPARC"><![CDATA[Maintenance updates must be checked on Solaris 8 SPARC 64-bit or Solaris 9 SPARC 64-bit systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
macro get_maintenance_update
{var $pat = '^\s+Solaris\s+\d+(\.\d+)?\s+Maintenance\s+Update\s(\d+)\s+applied'
 if grepFile('/etc/release',$pat,'if')
 {var ($lin) = last
  if match($lin,$pat,'if')
  {var (undef, $mu) = last
   return $mu
  }
 }
}
if !testFile('r','/etc/release')
 return setHcveResult('NoAccess')
var $MU_FND = get_maintenance_update()
var $MU_REQ = check($OS_VER,'2.8',7,8)
if !$MU_FND
 return setHcveResult('NoMaintUpd')
else
 call setHcveResult(cond(expr('>=',$MU_FND,$MU_REQ),'MaintUpdOk','MaintUpdLow'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the required Maintenance Update is installed.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="MaintUpdOk" result="PASSED"><![CDATA[The required Maintenance Update is installed. No action required.]]></sdp_action>
<sdp_action condition="==" minimum="NoAccess" result="FAILED"><![CDATA[Grant read permissions on ``/etc/release`` to the user who is logged in.]]></sdp_action>
<sdp_action condition="==" minimum="NoMaintUpd" result="FAILED"><![CDATA[No Maintenance Update was found. Install Maintenance Update 7 for Solaris 8 SPARC and Maintenance Update 8 for Solaris 9 SPARC.]]></sdp_action>
<sdp_action condition="==" minimum="MaintUpdLow" result="FAILED"><![CDATA[The Maintenance Update on this system is not high enough. Install Maintenance Update 7 for Solaris 8 SPARC and Maintenance Update 8 for Solaris 9 SPARC.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00220" mode="VERIFY" name="Got OS Packages? ">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00200" minimum="PASSED" result="SKIPPED" value="Not on certified Solaris system"><![CDATA[This rule applies for certified Solaris Operating Systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @pkg = ('arc','btool','hea','libm','libms','sprot','too','i1of','i1cs',\
            'i15cs','xwfnt')
if match($OS_VER,'^2\.(8|9)$')
 push(@pkg,'sprox')
if match($OS_VER,'^2\.(9|10|11)$')
 push(@pkg,'uiu8','ulcf','libC')
var @tbl = ()
call loadCommand('/usr/bin/pkginfo')
loop $pkg (split('\s',concat('SUNW',join(' SUNW',@pkg))))
{if not(grepLastFile($pkg,'f'))
  call push(@tbl,$pkg)
}
call setHcveResult(cond(\
  scalar(@tbl),join("\012",@tbl),'All required OS packages are installed'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that all required OS packages are installed.%BR%On Solaris 8 install the SUNWarc, SUNWbtool, SUNWhea, SUNWlibm, SUNWlibms, SUNWsprot, SUNWtoo, SUNWi1of, SUNWi1cs, SUNWi15cs, and SUNWsprox packages.%BR%On Solaris 9 install the SUNWarc, SUNWbtool, SUNWhea, SUNWlibm, SUNWlibms, SUNWsprot, SUNWtoo, SUNWi1of, SUNWi1cs, SUNWi15cs, SUNWxwfnt, SUNWsprox, SUNWuiu8, SUNWulcf, and SUNWlibC packages.%BR%On Solaris 10 install the SUNWarc, SUNWbtool, SUNWhea, SUNWlibm, SUNWlibms, SUNWsprot, SUNWtoo, SUNWi1of, SUNWi1cs, SUNWi15cs, SUNWxwfnt, SUNWuiu8, SUNWulcf, and SUNWlibC packages.%BR%On Solaris 11 install the SUNWarc, SUNWbtool, SUNWhea, SUNWlibm, SUNWlibms, SUNWsprot, SUNWtoo, SUNWi1of, SUNWi1cs, SUNWi15cs, SUNWxwfnt, SUNWuiu8, SUNWulcf, and SUNWlibC packages.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="All required OS packages are installed" result="PASSED"><![CDATA[The required OS patch bundle is installed. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[Some of the requires OS packages were not found. Install the missing packages.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00230" mode="VERIFY" name="Solaris 8 Patches?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00200" minimum="PASSED" result="SKIPPED" value="Not on certified Solaris system"><![CDATA[This rule applies for certified Solaris Operating Systems only.]]></sdp_dependency>
<sdp_dependency condition="=~" id="A00100" minimum="^SunOS SPARC 2.8 64-bit" result="SKIPPED" value="Not on Solaris 8 SPARC"><![CDATA[This rule applies for Solaris 8 SPARC 64-bit systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl = ()
macro check_patch
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {var ($flg,$err) = (true)
  var ($pch_num,$pch_lvl) = split('\-',$pch)
  if grepLastFile($pch_num,'f')
  {var %srt = ()
   if grepLastFile(concat('Patch: ',$pch_num,'\-'))
   {loop $key (last)
     var $srt{$key} = true
    var $pch_rev = field('\s+',1,keys(%srt,'KD'))
    next compare('ge',replace($pch_rev,'\-'),replace($pch,'\-'))
    var $err = concat('Patch [',$pch_rev,'] must be at level [',$pch,']')
   }
   loop $lin (grepLastFile(concat('Obsoletes:.*',$pch_num,'.*Requires:')))
   {var ($lvl) = match($lin,concat('.*Obsoletes:.*?',$pch_num,'\-(\d+)'))
    if compare('ge',$lvl,$pch_lvl)
    {var $flg = false
     break
    }
   }
   if $flg
    call push(@tbl,nvl($err,concat('Patch [',$pch_num,'] is not installed')))
  }
  else
   call push(@tbl,concat('Patch [',$pch_num,'] is not installed'))
 }
}
call loadCommand('/usr/bin/showrev -p')
call check_patch(\@tbl,'108434-17','108435-17','108528-29','108652-82',\
                       '108773-18','108921-21','108940-62','108987-13',\
                       '108989-02','108993-45','109147-28','109326-14',\
                       '110386-03','110615-11','111023-03','111111-04',\
                       '111308-04','111310-01','111317-05','111721-04',\
                       '112003-03','112138-01','112396-02','112438-03',\
                       '113648-03','115827-01','116602-01')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Adequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the required OS patches for the installation of the application tier of an E-Business Suite Release 12 (12.1.1) are installed on Solaris 8 SPARC 64-bit.%BR%The required OS patches for Solaris 8 SPARC 64-bit are 108434-17, 108435-17, 108528-29, 108652-82, 108773-18, 108921-21, 108940-62, 108987-13, 108989-02, 108993-45, 109147-28, 109326-14, 110386-03, 110615-11, 111023-03, 111111-04, 111308-04, 111310-01, 111317-05, 111721-04, 112003-03, 112138-01, 112396-02, 112438-03, 113648-03, 115827-01, and 116602-01.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[All required OS patches are adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches were not met or found. 
|*Return Value*|*Action*|
|Patch ... must be at level ...|The patch is installed but does not have a correct version. Install a correct version of the patch.|
|Patch ... is not installed|The patch was not found on the system. Install a correct version of the patch.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00240" mode="VERIFY" name="Solaris 9 Patches?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00200" minimum="PASSED" result="SKIPPED" value="Not on certified Solaris system"><![CDATA[This rule applies for certified Solaris Operating Systems only.]]></sdp_dependency>
<sdp_dependency condition="=~" id="A00100" minimum="^SunOS SPARC 2.9 64-bit" result="SKIPPED" value="Not on Solaris 9 SPARC"><![CDATA[This rule applies for Solaris 9 SPARC 64-bit systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl = ()
macro check_patch
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {var ($flg,$err) = (true)
  var ($pch_num,$pch_lvl) = split('\-',$pch)
  if grepLastFile($pch_num,'f')
  {var %srt = ()
   if grepLastFile(concat('Patch: ',$pch_num,'\-'))
   {loop $key (last)
     var $srt{$key} = true
    var $pch_rev = field('\s+',1,keys(%srt,'KD'))
    next compare('ge',replace($pch_rev,'\-'),replace($pch,'\-'))
    var $err = concat('Patch [',$pch_rev,'] must be at level [',$pch,']')
   }
   loop $lin (grepLastFile(concat('Obsoletes:.*',$pch_num,'.*Requires:')))
   {var ($lvl) = match($lin,concat('.*Obsoletes:.*?',$pch_num,'\-(\d+)'))
    if compare('ge',$lvl,$pch_lvl)
    {var $flg = false
     break
    }
   }
   if $flg
    call push(@tbl,nvl($err,concat('Patch [',$pch_num,'] is not installed')))
  }
  else
   call push(@tbl,concat('Patch [',$pch_num,'] is not installed'))
 }
}
call loadCommand('/usr/bin/showrev -p')
call check_patch(\@tbl,'111722-04','112233-11','112785-35','113096-03',\
                       '113471-08','115675-01')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Adequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the required OS patches for the installation of the application tier of an E-Business Suite Release 12 (12.1.1) are installed on Solaris 9 SPARC 64-bit.%BR%The required OS patches for Solaris 9 SPARC 64-bit are 111722-04, 112233-11, 112785-35, 113096-03, 113471-08, 115675-01.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[All required OS patches are adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches were not met or found. 
|*Return Value*|*Action*|
|Patch ... must be at level ...|The patch is installed but does not have a correct version. Install a correct version of the patch.|
|Patch ... is not installed|The patch was not found on the system. Install a correct version of the patch.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00250" mode="VERIFY" name="Solaris 10 Patches?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00200" minimum="PASSED" result="SKIPPED" value="Not on certified Solaris system"><![CDATA[This rule applies for certified Solaris Operating Systems only.]]></sdp_dependency>
<sdp_dependency condition="=~" id="A00100" minimum="^SunOS SPARC 2.10 64-bit" result="SKIPPED" value="Not on Solaris 10 SPARC"><![CDATA[This rule applies for Solaris 10 SPARC 64-bit systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl = ()
macro check_patch
{var (\@tbl,@pch) = @arg

 loop $pch (@pch)
 {var ($flg,$err) = (true)
  var ($pch_num,$pch_lvl) = split('\-',$pch)
  if grepLastFile($pch_num,'f')
  {var %srt = ()
   if grepLastFile(concat('Patch: ',$pch_num,'\-'))
   {loop $key (last)
     var $srt{$key} = true
    var $pch_rev = field('\s+',1,keys(%srt,'KD'))
    next compare('ge',replace($pch_rev,'\-'),replace($pch,'\-'))
    var $err = concat('Patch [',$pch_rev,'] must be at level [',$pch,']')
   }
   loop $lin (grepLastFile(concat('Obsoletes:.*',$pch_num,'.*Requires:')))
   {var ($lvl) = match($lin,concat('.*Obsoletes:.*?',$pch_num,'\-(\d+)'))
    if compare('ge',$lvl,$pch_lvl)
    {var $flg = false
     break
    }
   }
   if $flg
    call push(@tbl,nvl($err,concat('Patch [',$pch_num,'] is not installed')))
  }
  else
   call push(@tbl,concat('Patch [',$pch_num,'] is not installed'))
 }
}
call loadCommand('/usr/bin/showrev -p')
call check_patch(\@tbl,'120473-05','125100-04','127111-02','137111-04')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Adequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the required OS patches for the installation of the application tier of an E-Business Suite Release 12 (12.1.1) are installed on Solaris 10 SPARC 64-bit.%BR%The required OS patches for Solaris 10 SPARC 64-bit are 120473-05, 125100-04, 127111-02, and 137111-04.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[All required OS patches are adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches were not met or found. 
|*Return Value*|*Action*|
|Patch ... must be at level ...|The patch is installed but does not have a correct version. Install a correct version of the patch.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00370" mode="VERIFY" name="Got Software Tools?">
<sdp_command type="RDA"><![CDATA[var @tbl = ()
macro find_exe
{var (\@tbl,$exe,$ref) = @arg
 if findCommand($exe)
 {var $cmd = readLink(last,last)
  if !compare('eq',$cmd,$ref)
   call push(@tbl,concat(ucfirst($exe),'Elsewhere'))
 }
 else
  call push(@tbl,concat(ucfirst($exe),'NotFound'))
}
call find_exe(\@tbl,'ar','/usr/ccs/bin/ar')
call find_exe(\@tbl,'ld','/usr/ccs/bin/ld')
call find_exe(\@tbl,'make','/usr/ccs/bin/make')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'tools_found'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the required software tools for the installation of the installation of the application tier of an Oracle E-Business Suite Release 12 (12.1.1) exist.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="tools_found" result="PASSED"><![CDATA[All required software tools for the installation of the application tier of Oracle E-Business Suite Release 12 (12.1.1) were found. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required software tools for the the application tier of Oracle E-Business Suite Release 12 (12.1.1) installation were not found. Check your installation.
|*Return Value*|*Action*|
|ArNotFound|``ar`` is not found in PATH.|
|ArElsewhere|``ar`` is not in ``/usr/ccs/bin`` as required.|
|LdNotFound|``make`` is not found in PATH.|
|LdElsewhere|``make`` is not in ``/usr/ccs/bin`` as required.|
|MakeNotFound|``make`` is not found in PATH.|
|MakeElsewhere|``make`` is not in ``/usr/ccs/bin`` as required.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00400" mode="RECORD" name="IP Address">
<sdp_command type="RDA"><![CDATA[var ($hst) = command('hostname')
var $ip = field('\s+',1,grepCommand(concat('/usr/sbin/ping -a ',$hst),'.','f'))
call setHcveResult(substr($ip,1,expr('-',length($ip),2)))
]]></sdp_command>
<sdp_description><![CDATA[This rule gets the host IP address.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00410" mode="RECORD" name="Domain Name">
<sdp_command type="RDA"><![CDATA[var ($hst) = command('hostname')
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'))
if testFile('x','/usr/sbin/nslookup')
{if $nam
 {var $nsl = field(concat(quote($nam),'\.'),1,\
                  grepCommand(concat('/usr/sbin/nslookup ',$hst),'Name','f'))
 }
 else
 {var $nsl = field(concat(quote($hst),'\.'),1,\
                  grepCommand(concat('/usr/sbin/nslookup ',$hst),'Name','f'))
 }
}
call setHcveResult(cond($dom,$dom,\
                        $nis,$nis,\
                        $dns,$dns,\
                        $nsl,$nsl,\
                             'Not Configured'))
]]></sdp_command>
<sdp_description><![CDATA[The rule gets the host domain name.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00420" mode="VERIFY" name="DNS Lookup">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00400" minimum="PASSED|RECORD" result="FAILED" value="IP Address required"><![CDATA[This rule requires to know the IP address of the server.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[var $ip  = "%A00400%"
var $hst = field('\.',0,command('hostname'))
call setHcveResult(cond(\
  not(length($ip)),\
    'Cannot determine IP address',\
  not(testFile('x','/usr/sbin/nslookup')),\
    'Cannot access /usr/sbin/nslookup',\
  and(grepCommand(concat('/usr/sbin/nslookup ',$hst),quote($ip),'f'),\
      grepCommand(concat('/usr/sbin/nslookup ',$ip),quote($hst),'f')),\
    'Host correctly registered in DNS',\
    'Host not correctly registered in DNS'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks 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 result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Host not correctly registered in DNS|Register the host.domain in the DNS.|
|Cannot determine IP address|Fix any problem with the host IP address.|
|Cannot access /usr/sbin/nslookup|Grant execute permissions on ``/usr/sbin/nslookup`` to the current user.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00430" mode="VERIFY" name="/etc/hosts Format">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00410" minimum="PASSED|RECORD" result="FAILED" value="domain name required"><![CDATA[This rule requires to know the domain name of the server.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[
if !testFile('r','/etc/hosts')
 return setHcveResult('Cannot access /etc/hosts')
if !@tbl = grepFile('/etc/hosts',\
  concat('^([^\s\#]+\s+)+',quote(${RDA.HOST}),\
         '\s+([^\s\#]+\s+)*',quote(${RDA.NODE}),'(\s|\z|\#)'))
 return setHcveResult('no entry found')

# Test that line begins with IPv4 IP address
if grep(@tbl,'^(\d{1,3}\.){3}\d{1,3}\s','f')
 return setHcveResult('Adequate IPv4 entry')

# Tests that line begins with IPv6 IP address, first that all eight groups are populated, then situations where groups that are all zero are omitted (two colons together).
if grep(@tbl,'^([A-F\d]{1,4}(:[A-F\d]{1,4}){7}\s|\
                :(:[A-F\d]{1,4}){1,6}\s|\
                ([A-F\d]{1,4}:){1,5}(:[A-F\d]{1,4}){1,5}\s|\
                ([A-F\d]{1,4}:){1,6}:\s)','f')
 return setHcveResult('Adequate IPv6 entry')
return setHcveResult('no correct entry found')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``/etc/hosts`` file contains a line with ``ip_address fully_qualified_domainname short_hostname``.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="^Adequate" result="PASSED"><![CDATA[The ``/etc/hosts`` entry for the fully qualified domain name and host name is adequate.]]></sdp_action>
<sdp_action condition="==" minimum="Cannot access /etc/hosts" result="FAILED"><![CDATA[Grant read permissions on ``/etc/hosts`` to the current user.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The fully qualified host name and host name are not configured correctly. Ensure that there is an IP address entry for the fully qualified domain name with the host name as one of the aliases.
|*Return Value*|*Action"|
|no entry found|No entry with the fully qualified domain name followed by the host name was found.|
|no correct entry found|No entry beginning with an IP address with the fully qualified domain name followed by the host name was found.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00440" mode="VERIFY" name="Net Service Access?">
<sdp_command type="RDA"><![CDATA[var $NET='/var/tmp/.oracle'
call setHcveResult(cond(not(testDir('e',$NET)),'NonExist',\
                        not(testDir('d',$NET)),'NoDir',\
                        testDir('rwx',$NET),'PermOk','PermNotOk'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the user who is logged in can create the ``/var/tmp/.oracle`` directory or can create files in it. The directory is used by the Net Service Listeners.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="NonExist|PermOk" result="PASSED"><![CDATA[The user who is logged in can create the ``/var/tmp/.oracle`` directory or he can create files in the directory.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|NoDir|The ``/var/tmp/.oracle`` is not a directory. Remove the ``.oracle`` entry in ``/tmp``.|
|PermNotOk|The user who is logged in cannot create files in the ``/var/tmp/.oracle`` directory. Grant read, write, and execute permissions on this directory to the user who is logged in.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00450" mode="VERIFY" name="Port 6000">
<sdp_command type="RDA"><![CDATA[
if grepCommand('netstat -an','[\.:]6000\s','f')
 return setHcveResult('Occupied')
return setHcveResult('Free')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that port 6000 is free. The 6000 port is often used by the graphics console login process on an Unix server and can conflict with the OPMN (Oracle Process Manager and Notification) listen port from EBS, which is set to 6000 by default by RapidWiz.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="Free" result="PASSED"><![CDATA[Port 6000 is free. No action is required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Port 6000 is taken. Either check which process is using the port and stop the process or enter a port different from 6000 as the OPMN listen port in RapidWiz.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00500" mode="VERIFY" name="Kernel Params OK?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00200" minimum="PASSED" result="SKIPPED" value="Not on certified Solaris system"><![CDATA[This rule applies for certified Solaris Operating Systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl = ()
var $NOEXEC_USER_STACK_REQD = 1
var $RLIM_FD_CUR_REQD = 65536
var $RLIM_FD_MAX_REQD = 65536
var $SEMMNI_REQD = 100
var $SEMMNS_REQD = 1024
var $SEMMSL_REQD = 256
var $SEMVMX_REQD = 32767
var $SHMMAX_REQD = 4294967295
var $SHMMIN_REQD = 1
var $SHMMNI_REQD = 100
var $SHMSEG_REQD = 10
if !loadCommand('/etc/sysdef')
 return setHcveResult('NoAccess')
var $NOEXEC_USER_STACK = field('\s+',0,grepLastFile('NOEXEC_USER_STACK','f'))
var $SEMMNI = field('\s+',0,grepLastFile('SEMMNI','f'))
var $SEMMNS = field('\s+',0,grepLastFile('SEMMNS','f'))
var $SEMMSL = field('\s+',0,grepLastFile('SEMMSL','f'))
var $SEMVMX = field('\s+',0,grepLastFile('SEMVMX','f'))
var $SHMMAX = field('\s+',0,grepLastFile('SHMMAX','f'))
var $SHMMIN = field('\s+',0,grepLastFile('SHMMIN','f'))
var $SHMMNI = field('\s+',0,grepLastFile('SHMMNI','f'))
var $SHMSEG = field('\s+',0,grepLastFile('SHMSEG','f'))

call loadFile('/etc/system')
if grepLastFile('^\s*set\s+[^\s\*\#]*\brlim_fd_cur\s*=\s*(\d+)','fi1')
 var ($RLIM_FD_CUR) = last
if grepLastFile('^\s*set\s+[^\s\*\#]*\brlim_fd_max\s*=\s*(\d+)','fi1')
 var ($RLIM_FD_MAX) = last
if !?$NOEXEC_USER_STACK
{if grepLastFile(\
  '^\s*set\s+[^\s\*\#]*\bNOEXEC_USER_STACK\s*=\s*(0x[A-F\d]+|\d+)','fi1')
 {var ($val) = last
  var $NOEXEC_USER_STACK = check($val,'^0',oct2int($val),$val)
 }
}

macro chk_min
{var (\@tbl,$nam,$ref,$val) = @arg
 if !defined($val)
 {call push(@tbl,concat($nam,'Undef'))
  return
 }
 if expr('<',$val,$ref)
  call push(@tbl,concat($nam,'TooSmall'))
}
if match($OS_VER,'^2\.(8|9)$')
{call chk_min(\@tbl,'NOEXEC_USER_STACK',$NOEXEC_USER_STACK_REQD,\
                                        $NOEXEC_USER_STACK)
 call chk_min(\@tbl,'RLIM_FD_MAX',$RLIM_FD_MAX_REQD,$RLIM_FD_MAX)
 call chk_min(\@tbl,'SEMMNI',$SEMMNI_REQD,$SEMMNI)
 call chk_min(\@tbl,'SEMMNS',$SEMMNS_REQD,$SEMMNS)
 call chk_min(\@tbl,'SEMMSL',$SEMMSL_REQD,$SEMMSL)
 call chk_min(\@tbl,'SEMVMX',$SEMVMX_REQD,$SEMVMX)
 if match($OS_VER,'^2\.8$')
 {call chk_min(\@tbl,'SHMMIN',$SHMMIN_REQD,$SHMMIN)
  call chk_min(\@tbl,'SHMSEG',$SHMSEG_REQD,$SHMSEG)
 }
 call chk_min(\@tbl,'SHMMAX',$SHMMAX_REQD,$SHMMAX)
 call chk_min(\@tbl,'SHMMNI',$SHMMNI_REQD,$SHMMNI)
}
elsif match($OS_VER,'^2\.(10|11)$')
{macro chk_param
 {var ($cmd,$prj) = @arg
  var ($lin) = grepCommand(concat($cmd,' -n ',$prj,' ',${RDA.PID}),\
                           '(basic|privileged|system)','if')
  if match($lin,'\b(\d+(\.\d*)?)(\w*)\b')
   var ($siz,undef,$typ) = (last)
  return check(uc($typ),'^KB?$',expr('*',$siz,1024),\
                        '^MB?$',expr('*',$siz,1048576),\
                        '^GB?$',expr('*',$siz,1073741824),\
                        '^TB?$',expr('*',$siz,1099511627776),\
                        '^PB?$',expr('*',$siz,1125899906842624),\
                        '^EB?$',expr('*',$siz,1152921504606846976),\
                                $siz)
 }
 var $cmd = findCommand('prctl')
 call chk_min(\@tbl,'NOEXEC_USER_STACK',$NOEXEC_USER_STACK_REQD,\
                                        $NOEXEC_USER_STACK)
 call chk_min(\@tbl,'RLIM_FD_MAX',$RLIM_FD_MAX_REQD,$RLIM_FD_MAX)
 if match($OS_VER,'^2\.11$')
 {call chk_min(\@tbl,'RLIM_FD_CUR',$RLIM_FD_CUR_REQD,$RLIM_FD_CUR)
  call chk_min(\@tbl,'SEMMNS',$SEMMNS_REQD,$SEMMNS)
  call chk_min(\@tbl,'SEMVMX',$SEMVMX_REQD,$SEMVMX)
 }
 call chk_min(\@tbl,'SEMMNI',$SEMMNI_REQD,\
                             chk_param($cmd,'project.max-sem-ids'))
 call chk_min(\@tbl,'SEMMSL',$SEMMSL_REQD,\
                             chk_param($cmd,'process.max-sem-nsems'))
 call chk_min(\@tbl,'SHMMAX',$SHMMAX_REQD,\
                             chk_param($cmd,'project.max-shm-memory'))
 call chk_min(\@tbl,'SHMMNI',$SHMMNI_REQD,\
                             chk_param($cmd,'project.max-shm-ids'))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'KernelOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the kernel parameters are set according to the Knowledge Article 761568.1.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="KernelOK" result="PASSED" syntax="wiki"><![CDATA[The kernel parameters are set according to ${NOTE}. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The kernel parameters are not set according to the ${NOTE}. If they have been set in the ``/etc/system`` file, then you may have to add the following to set the parameters at boot time:%BR%
``forceload: sys/semsys%BR%``
``forceload: sys/shmsys%BR%``
When you make the changes in the ``/etc/system`` file, save the file and reboot to take effect.%BR%
In Solaris 10, you are not required to make changes to the ``/etc/system`` file to implement the System V IPC. Solaris 10 uses the resource control facility for its implementation.
|*Return Value*|*Action*|
|NOEXEC_USER_STACKTooSmall|Increase the kernel parameter NOEXEC_USER_STACK to 1.|
|NOEXEC_USER_STACKUndef|NOEXEC_USER_STACK is not defined and must be set to 1.|
|RLIM_FD_CURTooSmall|Increase the kernel parameter RLIM_FD_CUR to 65536.|
|RLIM_FD_CURUndef|RLIM_FD_CUR is not defined and must be set to 65536.|
|RLIM_FD_MAXTooSmall|Increase the kernel parameter RLIM_FD_MAX to 65536.|
|RLIM_FD_MAXUndef|RLIM_FD_MAX is not defined and must be set to 65536.|
|SEMMNITooSmall|Increase the kernel parameter SEMMNI to 100.|
|SEMMNIUndef|SEMMNI is not defined and must be set to 100.|
|SEMMNSTooSmall|Increase the kernel parameter SEMMNS to at least 1024.|
|SEMMNSUndef|SEMMNS is not defined and must be set to 1024.|
|SEMMSLTooSmall|Increase the kernel parameter SEMMSL to at least 256.|
|SEMMSLUndef|SEMMSL is not defined and must be set to 256.|
|SEMVMXTooSmall|Increase the kernel parameter SEMVMX to 32767.|
|SEMVMXUndef|SEMVMX is not defined and must be set to 32767.|
|SHMMAXTooSmall|Increase the kernel parameter SHMMAX to 4294967295.|
|SHMMAXUndef|SHMMAX is not defined and must be set to 4294967295.|
|SHMMINTooSmall|Increase the kernel parameter SHMMIN to at least 1.|
|SHMMINUndef|SHMMIN is not defined and must be set to 1 or more.|
|SHMMNITooSmall|Increase the kernel parameter SHMMNI to at least 100.|
|SHMMNIUndef|SHMMNI is not defined and must be set to 100 or more.|
|SHMSEGTooSmall|Increase the kernel parameter SHMSEG to at least 10.|
|SHMSEGUndef|SHMSEG is not defined and must be set to 10 or more.|
|NoAccess|You do not have access to ``/etc/sysdef``.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00510" mode="VERIFY" name="Open File Limit?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00200" minimum="PASSED" result="SKIPPED" value="Not on certified Solaris system"><![CDATA[This rule applies for certified Solaris Operating Systems only.]]></sdp_dependency>
<sdp_dependency condition="=~" id="A00100" minimum="^SunOS SPARC 2.(8|9) 64-bit" result="SKIPPED" value="Not on Solaris 8 or 9 SPARC"><![CDATA[This rule applies for Solaris 8 SPARC 64-bit or Solaris 9 SPARC 64-bit systems only.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_VER
var ($lmt) = command('ulimit "-Hn"')
if !defined($lmt)
 return setHcveResult('Not found')
call setHcveResult(\
 cond(or(compare('eq',$lmt,'unlimited'),expr('>=',$lmt,65536)),\
      'Adequate',\
      'File descriptors hard limit is less than 65536'))]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the limit of file descriptors is set to 65536 or higher. For more information about configuring this parameter, see Knowledge Article 761568.1. This setting does not apply to Solaris 10.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[No action required]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[Set ``rlim_fd_max=65536`` or higher. ``ulimit -Hn`` must return value of ``65536`` or higher.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00520" mode="VERIFY" name="ulimits OK?">
<sdp_command type="RDA"><![CDATA[var @tbl =()
macro get_ulimit_unl
{var (\@tbl,$nam) = @arg
 var $lmt = field('\s+',1,grepLastFile(concat('^',$nam,'\('),'if'))
 if !defined($lmt)
  call push(@tbl,concat($nam,'NotDefined'))
 elsif compare('ne',$lmt,'unlimited')
  call push(@tbl,concat($nam,'TooSmall'))
}
macro get_ulimit_val
{var (\@tbl,$nam,$ref) = @arg
 var $lmt = field('\s+',1,grepLastFile(concat('^',$nam,'\('),'if'))
 if !length($lmt)
  call push(@tbl,concat($nam,'NotDefined'))
 elsif and(compare('ne',$lmt,'unlimited'),expr('<',$lmt,$ref))
  call push(@tbl,concat($nam,'TooSmall'))
}
call loadCommand('/usr/bin/ulimit -a')
call get_ulimit_unl(\@tbl,'Coredump')
call get_ulimit_unl(\@tbl,'Data')
call get_ulimit_unl(\@tbl,'File')
call get_ulimit_val(\@tbl,'NoFiles',65536)
call get_ulimit_unl(\@tbl,'Stack')
call get_ulimit_unl(\@tbl,'Time')
call get_ulimit_unl(\@tbl,'Vmemory')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'ulimitOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the ``ulimit`` settings are adequate for installing Oracle Database 11g.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="ulimitOK" result="PASSED"><![CDATA[The ``ulimit`` settings are adequate for installing the application tier of an Oracle E-Business Suite Release 12 (12.1.1). No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Review the ``ulimit`` settings and check the recommended values from the ${NOTE} before installing the software.
|*Return Value*|*Action*|
|TimeNotDefined|ulimit(TIME) is not defined.|
|TimeTooSmall|Increase the ulimit(TIME) to unlimited.|
|FileNotDefined|ulimit(FILE) is not defined.|
|FileTooSmall|Increase the ulimit(FILE) to unlimited.|
|DataNotDefined|ulimit(DATA) is not defined.|
|DataTooSmall|Increase the ulimit(DATA) to unlimited.|
|StackNotDefined|ulimit(STACK) is not defined.|
|StackTooSmall|Increase the ulimit(STACK) unlimited.|
|NoFilesNotDefined|ulimit(NOFILES) is not defined.|
|NoFilesTooSmall|Increase the ulimit(NOFILES) to a minimum of 65536.|
|VmemoryNotDefined|ulimit(VMEMORY) is not defined.|
|VmemoryTooSmall|Increase the ulimit(VMEMORY) unlimited.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00600" mode="RECORD" name="ApplTierDirectory">
<sdp_command type="PROMPT" default="" variable="$APP_TIER_DIR"><![CDATA[Planned application tier installation directory]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the planned directory of the application tier of the Oracle E-Business Suite Release 12 (12.1.1).]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00610" mode="VERIFY" name="A_T Valid?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00600" minimum="RECORD" result="SKIPPED" value="Unspecified A_T"><![CDATA[You did not specify the planned directory for the application tier.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $APP_TIER_DIR
call setHcveResult(cond(\
  not($APP_TIER_DIR),             'ATNotSpecified',\
  not(testDir('d',$APP_TIER_DIR)),'ATnotvalid',\
  not(testDir('l',$APP_TIER_DIR)),'ATexists',\
                                  'ATsymlink'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks the directory for the installation of the application tier (A_T) of the Oracle E-Business suite R12 (12.1.1).]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="ATexists" result="PASSED"><![CDATA[The application tier installation directory exists. No action required]]></sdp_action>
<sdp_action condition="==" minimum="ATNotSpecified" result="SKIPPED"><![CDATA[The application tier installation directory was not specified. No action required]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[ALERT:
You did not specify a valid application tier installation directory. Ensure that you provided the correct location or that this directory is created and then run this script again.
|*Return Value*|*Action*|
|ATnotvalid|Ensure that the application tier directory is a valid directory.|
|ATsymlink|Ensure that the specified application tier directory is not a symbolic link.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00620" mode="VERIFY" name="A_T Permissions OK?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00610" minimum="PASSED" result="SKIPPED" value="Unspecified A_T"><![CDATA[You did not specify a valid application tier home directory.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $APP_TIER_DIR
call setHcveResult(cond(\
  not(testDir('r',$APP_TIER_DIR)),'NoReadPerm',\
  not(testDir('w',$APP_TIER_DIR)),'NoWritePerm',\
  not(testDir('x',$APP_TIER_DIR)),'NoExecutePerm',\
                                  'CorrectPerms'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the user has the correct privileges to install the application tier (A_T) of the Oracle E-Business Suite Release 12 (12.1.1).]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="CorrectPerms" result="PASSED"><![CDATA[The permissions for the application tier directory are correct. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|NoReadPerm|The install user has no read permissions. Ensure that the install user has read, write, and execute permissions for the application tier home directory.|
|NoWritePerm|The install user has no write permissions. Ensure that the install user has read, write, and execute permissions for the application tier home directory.|
|NoExecutePerm|The install user has no execute permissions. Ensure that the install user has read, write, and execute permissions for the application tier home directory.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00630" mode="VERIFY" name="Disk Space">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00610" minimum="PASSED" result="SKIPPED" value="Unspecified A_T"><![CDATA[You did not specify a valid application tier directory.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $APP_TIER_DIR
var $dsk = get_df($APP_TIER_DIR)
call setHcveResult(cond(and(isNumber($dsk),expr('>=',$dsk,36700160)),\
                   'Available','NotAvailable'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks if there is sufficient disk space to install the application tier of the Oracle E-Business Suite Release 12 (12.1.1).]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Available" result="PASSED"><![CDATA[There is sufficient disk space to install the application tier of the Oracle E-Business Suite Release 12 (12.1.1) in the directory. No action is required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[There is insufficient disk space to install the application tier of the Oracle E-Business Suite Release 12 (12.1.1). You need at least 35 GB.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00640" mode="VERIFY" name="Space in tmp">
<sdp_command type="RDA"><![CDATA[var $tmp = nvl(getEnv('TMP'),getEnv('TMPDIR'),'/tmp')
call setHcveResult(cond(\
  not(testDir('d',$tmp)),          'Cannot access tmp directory',\
  expr('>=',get_df($tmp),1048576), 'Available',\
                                   'Need at least 1GB'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the system has enough temporary space. Initially Oracle Rapid Install (RI) checks the ``TMP`` and ``TMPDIR`` environment variables to locate the temporary directory. If these environment variables do not exist, then RI uses ``/tmp``. The minimum requirement is 1 GB.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Available" result="PASSED"><![CDATA[The system has enough temporary space.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1 GB|Increase the available temporary space to 1 GB or more. You can define ``TMP`` or ``TMPDIR`` to point to a directory with 1 GB available space.|
|Cannot access tmp directory|Grant read, write, and execute permissions on ``/tmp`` or directories in ``TMP`` or ``TMPDIR`` to the user who is logged in.|]]></sdp_action>
</sdp_actions>
</sdp_rule>
</sdp_group>
</sdp_content>
</sdp_diaglet>

