<!-- $Id: A300AS1012_hp.xml,v 1.11 2008/02/26 18:18:35 mschenke Exp $ -->
<!-- ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/hcve/A300AS1012_hp.xml,v 1.11 2008/02/26 18:18:35 mschenke Exp $ -->
<!--  Change History: 20080226  KRA  Report permission problems --> 
<hcve name="Oracle Application Server 10g R2 (10.1.2) PreInstall (HP-UX)" type="A" product="AS1012" platform="hpux">
<rule condition="==" id="1" maximum="N" minimum="64-bit" mode="VERIFY" name="Processor Type" repeat="1" command_type="RDA">
<command><![CDATA[import $OS_BIT
call setHcveResult(cond(\
  not(testFile('x','/bin/getconf')), 'Cannot access /bin/getconf',\
  expr('==',$OS_BIT,64),             '64-bit',\
                                     'Not a 64-bit processor'))
]]></command>
<description><![CDATA[This rule checks for the processor type. The processor must be 64-bit.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The processor must be 64-bit.
|*Return Value*|*Action*|
|Not a 64-bit processor|Use a certified processor type.|
|Cannot access /bin/getconf|Grant execute permission on /bin/getconf to the current user.|]]></action>
<action type="positive"><![CDATA[The processor is certified.]]></action>
</rule>
<rule condition="==" id="2" maximum="N" minimum="The minimum requirement for the processor speed has been met." mode="VERIFY" name="Processor Speed" repeat="1" command_type="RDA">
<command><![CDATA[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
 return setHcveResult($msg)
var $tmp = createTemp('processor')
call writeTemp('processor','itick_per_tick/D')
call closeTemp('processor')
var ($mhz) = reverse(command(\
  concat('adb -k /stand/vmunix /dev/kmem <',quote($tmp,'x'))))
call unlinkTemp('processor')
call setHcveResult(cond(\
  expr('>=',expr('/',field('\s+',1,$mhz),10000),450),\
    'The minimum requirement for the processor speed has been met.',\
    concat('Processor speed [',$mhz,'MHZ] does not meet minimum requirement')))
]]></command>
<description><![CDATA[This rule checks for the processor speed. The minimum requirement is 450 MHz or faster.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Processor speed ... does not meet minimum requirement|Use a processor with a speed of 450 MHz or faster.|
|Cannot access ...|Grant permission or run as root user|]]></action>
<action type="positive"><![CDATA[The minimum requirement for the processor speed is met.]]></action>
</rule>
<rule condition="==" id="3" maximum="N" mode="RECORD" name="Memory in MB" repeat="1" command_type="RDA">
<command><![CDATA[var $MEM = undef
call setHcveVariable('$MEM')
if !testFile('x','/usr/sbin/dmesg')
 return setHcveResult('Cannot access /usr/sbin/dmesg')
call loadCommand('/usr/sbin/dmesg')
if !grepLastFile('Physical:','f')
 return setHcveResult('Cannot read from /usr/sbin/dmesg')
var $MEM = expr('/',field('\s+',1,grepLastFile('Physical:','f')),1000)
call setHcveResult($MEM)
]]></command>
<description><![CDATA[This rule retrieves the available physical memory in MB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|
|Cannot read from /usr/sbin/dmesg|Make sure /usr/sbin/dmesg returns system information.|]]></action>
<action type="positive"><![CDATA[NA]]></action>
</rule>
<rule condition="==" id="4" maximum="N" minimum="Available" mode="VERIFY" name="Memory for MDR and IM" repeat="1" command_type="RDA">
<command><![CDATA[import $MEM
call setHcveResult(cond(\
  not(defined($MEM)),   'Cannot access /usr/sbin/dmesg',\
  expr('>=',$MEM,1000), 'Available',\
                        'Need at least 1 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough memory to install the Metadata Repository and Oracle Identity Management install type. The minimum requirement is 1GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1 GB|Increase the memory to 1 GB or more to install the Metadata Repository and Oracle Identity Management install type.|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough memory to install the Metadata Repository and Oracle Identity Management install type.]]></action>
</rule>
<rule condition="==" id="5" maximum="N" minimum="Available" mode="VERIFY" name="Memory for IM Only" repeat="1" command_type="RDA">
<command><![CDATA[import $MEM
call setHcveResult(cond(\
  not(defined($MEM)),   'Cannot access /usr/sbin/dmesg',\
  expr('>=',$MEM,1000), 'Available',\
                        'Need at least 1 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough memory to install the Oracle Identity Management only install type. The minimum requirement is 1 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1 GB|Increase the memory to 1 GB or more to install the Oracle Identity Management only install type.|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough memory to install the Oracle Identity Management only install type.]]></action>
</rule>
<rule condition="==" id="6" maximum="N" minimum="Available" mode="VERIFY" name="Memory for MDR Only" repeat="1" command_type="RDA">
<command><![CDATA[import $MEM
call setHcveResult(cond(\
  not(defined($MEM)),   'Cannot access /usr/sbin/dmesg',\
  expr('>=',$MEM,1000), 'Available',\
                        'Need at least 1 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough memory to install the Metadata Repository only install type. The minimum requirement is 1 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1 GB|Increase the memory to 1 GB or more to install the Metadata Repository only install type.|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough memory to install the Metadata Repository only install type.]]></action>
</rule>
<rule condition="==" id="7" maximum="N" minimum="Available" mode="VERIFY" name="Memory for J2EE" repeat="1" command_type="RDA">
<command><![CDATA[import $MEM
call setHcveResult(cond(\
  not(defined($MEM)),  'Cannot access /usr/sbin/dmesg',\
  expr('>=',$MEM,512), 'Available',\
                       'Need at least 512 MB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough memory to install the J2EE and Web Cache install type. The minimum requirement is 512 MB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 512 MB|Increase the memory to 512 MB or more to install the J2EE and Web Cache install type.|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough memory to install the J2EE and Web Cache install type.]]></action>
</rule>
<rule condition="==" id="8" maximum="N" minimum="Available" mode="VERIFY" name="Memory for Portal" repeat="1" command_type="RDA">
<command><![CDATA[import $MEM
call setHcveResult(cond(\
  not(defined($MEM)),   'Cannot access /usr/sbin/dmesg',\
  expr('>=',$MEM,1000), 'Available',\
                        'Need at least 1 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough memory to install the Portal and Wireless install type. The minimum requirement is 1 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1 GB|Increase the memory to 1 GB or more to install the Portal and Wireless install type.|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough memory to install the Portal and Wireless install type.]]></action>
</rule>
<rule condition="==" id="9" maximum="N" minimum="Available" mode="VERIFY" name="Memory for Dev Kit" repeat="1" command_type="RDA">
<command><![CDATA[import $MEM
call setHcveResult(cond(\
  not(defined($MEM)),  'Cannot access /usr/sbin/dmesg',\
  expr('>=',$MEM,256), 'Available',\
                       'Need at least 256 MB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough memory to install OracleAS Developer Kit. The minimum requirement is 256 MB, but Oracle recommends 512 MB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 256 MB|Increase the memory to 256 MB or more to install OracleAS Developer Kit.|
|Cannot access /usr/sbin/dmesg|Grant execute permission on /usr/sbin/dmesg to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough memory to install OracleAS Developer Kit]]></action>
</rule>
<rule condition="==" id="10" maximum="N" mode="RECORD" name="Space" repeat="1" command_type="RDA">
<command><![CDATA[var $ORACLE_HOME = getEnv('ORACLE_HOME')
var $DF = cond(\
  not($ORACLE_HOME),              'ORACLE_HOME is not set',\
  not(testDir('d',$ORACLE_HOME)), 'Cannot access ORACLE_HOME',\
                                  get_df($ORACLE_HOME))
call setHcveVariable('$DF')
call setHcveResult(cond(isNumber($DF),concat(expr('/',$DF,1000),' MB'),$DF))
]]></command>
<description><![CDATA[The rule retrieves the available disk space.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|ORACLE_HOME is not set|Set ORACLE_HOME environment variable.|
|Cannot access ORACLE_HOME|Set ORACLE_HOME to a valid directory.|]]></action>
<action type="positive"><![CDATA[NA]]></action>
</rule>
<rule condition="==" id="11" maximum="N" minimum="Available" mode="VERIFY" name="Space for Infra" repeat="1" command_type="RDA">
<command><![CDATA[import $DF
call setHcveResult(cond(\
  not(isNumber($DF)),     $DF,\
  expr('>=',$DF,5100000), 'Available',\
                          'Need at least 5.1 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough disk space to install the Infrastructure install type. The minimum requirement is 5.1 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 5.1 GB|Increase the available space to 5.1 GB or more to install the Infrastructure install type.|
|ORACLE_HOME is not set|Set the ORACLE_HOME environment variable.|
|Cannot access ORACLE_HOME|Set ORACLE_HOME to a valid directory.|]]></action>
<action type="positive"><![CDATA[The machine has enough disk space to install the Infrastructure install type.]]></action>
</rule>
<rule condition="==" id="12" maximum="N" minimum="Available" mode="VERIFY" name="Space for J2EE" repeat="1" command_type="RDA">
<command><![CDATA[import $DF
call setHcveResult(cond(\
  not(isNumber($DF)),     $DF,\
  expr('>=',$DF,1400000), 'Available',\
                          'Need at least 1.4 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough disk space to install the J2EE and Web Cache install type. The minimum requirement is 1.4 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1.4 GB|Increase the available space to 1.4 GB or more to install the J2EE and Web Cache install type.|
|ORACLE_HOME is not set|Set the ORACLE_HOME environment variable.|
|Cannot access ORACLE_HOME|Set ORACLE_HOME to a valid directory.|]]></action>
<action type="positive"><![CDATA[The machine has enough disk space to install the J2EE and Web Cache install type.]]></action>
</rule>
<rule condition="==" id="13" maximum="N" minimum="Available" mode="VERIFY" name="Space for Portal" repeat="1" command_type="RDA">
<command><![CDATA[import $DF
call setHcveResult(cond(\
  not(isNumber($DF)),     $DF,\
  expr('>=',$DF,3300000), 'Available',\
                          'Need at least 3.3 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough disk space to install the Portal and Wireless install type. The minimum requirement is 3.3 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 3.3 GB|Increase the available space to 3.3 GB or more to install the Portal and Wireless install type.|
|ORACLE_HOME is not set|Set the ORACLE_HOME environment variable.|
|Cannot access ORACLE_HOME|Set ORACLE_HOME to a valid directory.|]]></action>
<action type="positive"><![CDATA[The machine has enough disk space to install the Portal and Wireless install type.]]></action>
</rule>
<rule condition="==" id="14" maximum="N" minimum="Available" mode="VERIFY" name="Space for Dev Kit" repeat="1" command_type="RDA">
<command><![CDATA[import $DF
call setHcveResult(cond(\
  not(isNumber($DF)),     $DF,\
  expr('>=',$DF,1400000), 'Available',\
                          'Need at least 1.4 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough disk space to install the Developer Kit install type. The minimum requirement is 1.4 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1.4 GB|Increase the available space to 1.4 GB or more to install the Developer Kit install type.|
|ORACLE_HOME is not set|Set the ORACLE_HOME environment variable.|
|Cannot access ORACLE_HOME|Set ORACLE_HOME to a valid directory.|]]></action>
<action type="positive"><![CDATA[The machine has enough disk space to install the Developer Kit install type.]]></action>
</rule>
<rule condition="==" id="15" maximum="N" minimum="Available" mode="VERIFY" name="Space in tmp" repeat="1" command_type="RDA">
<command><![CDATA[var $TMP = nvl(getEnv('TMP'),getEnv('TMPDIR'),'/tmp')
call setHcveResult(cond(\
  not(testDir('d',$TMP)),         'Cannot access tmp directory',\
  expr('>=',get_df($TMP),400000), 'Available',\
                                  'Need at least 400 MB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough tmp space. Oracle Universal Installer (OUI) initially checks the TMP and TMPDIR environment variables to locate the temporary directory. If these environment variables do not exist, then OUI uses /tmp. The minimum requirement is 400 MB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 400 MB|Increase the available tmp space to 400 MB or more. You can define TMP or TMPDIR to point to a directory with 150 MB of available space.|
|Cannot access tmp directory|Grant read and write permission on /tmp or directories in TMP or TMPDIR to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough tmp space.]]></action>
</rule>
<rule condition="==" id="16" maximum="N" minimum="Available" mode="VERIFY" name="Swap space" repeat="1" command_type="RDA">
<command><![CDATA[if !testFile('x','/usr/sbin/swapinfo')
 return setHcveResult('Cannot access /usr/sbin/swapinfo')
var ($swp) = command('/usr/sbin/swapinfo -q')
call setHcveResult(cond(expr('>=',$swp,1500000), 'Available',\
                                                 'Need at least 1.5 GB'))
]]></command>
<description><![CDATA[This rule checks if the machine has enough swap space. The minimum requirement is 1.5 GB.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 1.5 GB|Increase the swap space to 1.5 GB or more.|
|Cannot access /usr/sbin/swapinfo|Grant execute permission on /usr/sbin/swapinfo to the current user.|]]></action>
<action type="positive"><![CDATA[The machine has enough swap space.]]></action>
</rule>
<rule condition="==" id="17" maximum="N" minimum="Adequate" mode="VERIFY" name="Monitor colors" repeat="1" command_type="RDA">
<command><![CDATA[call loadCommand('/usr/X11R6/bin/xdpyinfo 2>&1')
var @dpt = grepLastFile('depths')
call setHcveResult(cond(\
  grep(@dpt,'8','f'),              'Adequate',\
  not(defined(getEnv('DISPLAY'))), 'DISPLAY is not set',\
  grepLastFile('unable','f'),      'Cannot open DISPLAY',\
                                   'Need at least 256 colors'))
]]></command>
<description><![CDATA[This rule checks if the monitor has a minimum of 256 colors.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Need at least 256 colors|Use a display with 256 colors.|
|DISPLAY is not set|Set the DISPLAY environment variable to a valid display.|
|Cannot open DISPLAY|Set the DISPLAY environment variable to a correct display.|]]></action>
<action type="positive"><![CDATA[The monitor has enough colors.]]></action>
</rule>
<rule condition="==" id="18" maximum="N" minimum="Certified" mode="VERIFY" name="Operating System" repeat="1" command_type="RDA">
<command><![CDATA[import $OS_VER,$OS_BIT
call setHcveResult(cond(\
  not(match($OS_VER,'^(11\.11|11\.23)$')), 'Not Certified OS',\
  expr('==',$OS_BIT,64),                   'Certified',\
                                           'Need 64-bit OS'))
]]></command>
<description><![CDATA[This rule checks if the operating system is certified. The following operating systems are certified for Oracle Application Server 10g: HP-UX 11i (11.11 or 11.23) PA-RISC or later.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Not Certified OS|You must use one of the listed certified operating systems.|
|Need 64-bit OS|You must use a 64-bit OS.|]]></action>
<action type="positive"><![CDATA[You are using a certified operating system.]]></action>
</rule>
<rule condition="=~" id="19" minimum="Installed|Skipped" mode="VERIFY" name="Quality Pack" repeat="1" command_type="RDA">
<command><![CDATA[import $OS_VER
if !match($OS_VER,'^11\.11$')
 return setHcveResult('Skipped')
if !testFile('x','/usr/sbin/swlist')
 return setHcveResult('Cannot access /usr/sbin/swlist')
var $ver = field('\s+',1,grepCommand('/usr/sbin/swlist','GOLDBASE11i','f'))
var $ver = replace($ver,'^[^\.]*\.')
call setHcveResult(cond(compare('valid',$ver,'11.11.306.4'),\
                        'Installed',\
                        'June 2003 Quality Pack or later is not installed'))
]]></command>
<description><![CDATA[This rule checks if the June 2003 Quality Pack GoldQPK11i or later is installed for HP-UX 11i (11.11) PA-RISC. (For 11.11 check for GOLDBASE11i only. No checks for 11.23)]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Cannot access /usr/sbin/swlist|Grant execute permission on /usr/sbin/swlist tothe current user.|
|June 2003 Quality Pack or later is not installed|Install June 2003 Quality Pack or later|]]></action>
<action type="positive"><![CDATA[The required Quality Pack is installed.]]></action>
</rule>
<rule condition="==" id="20" maximum="N" minimum="All patches exist" mode="VERIFY" name="Patches" repeat="1" command_type="RDA">
<command><![CDATA[import $OS_VER
if !match($OS_VER,'^(11\.11|11\.23)$')
 return setHcveResult('Not Certified OS')
macro chk_patch
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {if !grepLastFile($pch,'f')
   var @tbl = (@tbl,$pch)
 }
}
if match($OS_VER,'^11\.11$')
{var @lst = grepCommand('/usr/sbin/swlist -l product C-ANSI-C','^#','v')
 if grep(@lst,'ANSI C Compiler','f')
  var @pch = ('PHSS_26792','PHSS_26793')
 if !loadCommand('/usr/sbin/swlist -l fileset')
  return setHcveResult('NoAccess')
 call chk_patch(\@tbl,'PHKL_29198','PHSS_28871','PHSS_28880','PHCO_29960',\
                      'PHKL_25842','PHKL_25993','PHKL_25994','PHKL_25995',\
                      'PHKL_26468','PHKL_28489','PHNE_29887',@pch)
}
call setHcveResult(cond(\
  scalar(@tbl),concat('Patches [',join(' ',@tbl),'] are missing'),\
               'All patches exist'))
]]></command>
<description><![CDATA[This rule checks if the necessary operating system patches (or later) are installed. The required patches are for HP-UX 11i (11.11) PA-RISC or later are: PHKL_29198 PHSS_28871 PHSS_28880 PHCO_29960 PHKL_25842 PHKL_25993 PHKL_25994 PHKL_25995 PHKL_26468 PHKL_28489 PHNE_29887 PHSS_26792 PHSS_26793.
Patches are not checked for 11.23]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Not Certified OS|You must use one of the listed certified operating systems.|
|NoAccess|You do not have access to /usr/sbin/swlist|
|Patches ... are missing|Install the listed missing patches.|]]></action>
<action type="positive"><![CDATA[All operating system patches are installed.]]></action>
</rule>
<rule condition="=~" id="21" maximum="N" minimum="Motif package exists|Motif links exist" mode="VERIFY" name="Motif Package" repeat="1" command_type="RDA">
<command><![CDATA[import $OS_VER
if !match($OS_VER,'^(11\.11|11\.23)$')
 return setHcveResult('Not Certified OS')
macro check_lib
{var (\@tbl,$cmd,$pat) = @arg
 import $exe
 if !grepCommand(concat($exe,$cmd),$pat,'f')
  var @tbl = (@tbl,$cmd)
}
var $exe = concat(findCommand('ls'),' -l /usr/lib/')
call check_lib(\@tbl,'libX11.sl','libX11.3')
call check_lib(\@tbl,'libXIE.sl','libXIE.2')
call check_lib(\@tbl,'libXext.sl','libXext.3')
call check_lib(\@tbl,'libXhp11.sl','libXhp11.3')
call check_lib(\@tbl,'libXi.sl','libXi.3')
call check_lib(\@tbl,'libXm.sl','libXm.4')
call check_lib(\@tbl,'libXp.sl','libXp.2')
call check_lib(\@tbl,'libXt.sl','libXt.3')
call check_lib(\@tbl,'libXtst.sl','libXtst.2')
call setHcveResult(cond(\
  scalar(@tbl),concat('Missing Motif links [',join(' ',@tbl),']'),\
               'Motif links exist'))
]]></command>
<description><![CDATA[This rule checks if the Motif 2.1 Development Environment Motif 2.1 Development Environment (X11MotifDevKit.MOTIF21-PRG) B.11.11.01 for HP-UX 11i (11.11) PA-RISC or later is installed. This package is not required if the following symbolic links exist:
libX11.sl -> llibX11.3,
libXIE.sl -> libXIE.2,
libXext.sl -> libXext.3,
libXhp11.sl -> libXhp11.3,
libXi.sl -> libXi.3,
libXm.sl -> libXm.4,
libXp.sl -> libXp.2,
libXt.sl -> libXt.3 and
libXtst.sl -> libXtst.2]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Not Certified OS|You must use one of the listed certified operating systems.|
|Missing Motif links ...|Create the listed missing links or install the Motif 2.1 Development Environment package listed above.|]]></action>
<action type="positive"><![CDATA[The Motif package exists or all Motif links exist.]]></action>
</rule>
<rule condition="==" id="22" minimum="Host name is less than 255 characters" mode="VERIFY" name="Host Name Length" repeat="1" command_type="RDA">
<command><![CDATA[var $hst = uname('n')
call setHcveResult(cond(\
  expr('>',length($hst),255),'Host name is greater than 255 characters',\
                             'Host name is less than 255 characters'))
]]></command>
<description><![CDATA[Ensure that your fully qualified host name is not longer than 255 characters]]></description>
<action type="negative"><![CDATA[Modify your fully qualified host name to less than 255 characters.]]></action>
<action type="positive"><![CDATA[The host name is less than 255 characters. No action required.]]></action>
</rule>
<rule condition="==" id="23" maximum="N" minimum="All Set" mode="VERIFY" name="Kernel Parameters" repeat="1" command_type="RDA">
<command><![CDATA[import $OS_VER
if !match($OS_VER,'^(11\.11|11\.23)$')
 return setHcveResult('Not Certified OS')
call loadFile('/stand/system')
macro hx2dec
{var ($hex) = @arg
 var %tbl = ('0',0,'1',1,'2',2,'3',3,'4',4,'5',5,'6',6,'7',7,'8',8,'9',9,\
             'A',10,'B',11,'C',12,'D',13,'E',14,'F',15)
 var $res = 0
 loop $chr (split('',uc($hex)))
  var $res = expr('+',expr('*',$res,16),$tbl{$chr})
}
loop $par ('ksi_alloc_max=16384|(nproc*8)',\
           'max_thread_proc=3000',\
           'maxdsiz=2063835136',\
           'maxdsiz_64bit=2147483648',\
           'maxfiles=2048',\
           'maxfiles_lim=65536',\
           'maxssiz=134217728',\
           'maxssiz_64bit=1073741824',\
           'maxswapchunks=16384',\
           'maxuprc=1843|((nproc*9)/10)',\
           'maxusers=512',\
           'msgmap=4098|(2+msgmni)',\
           'msgmni=4096',\
           'msgseg=32767',\
           'msgtql=4096',\
           'ncallout=6000',\
           'ncsize=22528|((8*nproc+2048)+vx_ncsize)',\
           'nfile=3000',\
           'nflocks=4096',\
           'ninode=18432|(8*nproc+2048)',\
           'nkthread=6000',\
           'nproc=2048',\
           'semmap=4098|(semmni+2)',\
           'semmni=4096',\
           'semmns=8192|(semmni*2)',\
           'semmnu=2044|(nproc-4)',\
           'semvmx=32767',\
           'shmmni=512',\
           'shmseg=32',\
           'tcp_conn_request_max=2048',\
           'vps_ceiling=64')
{var ($nam,$val) = split('=',$par,2)
 var ($val,$exp) = split('\|',$val,2)
 var $cur = field('\s+',1,grepLastFile(concat('^',$nam),'f'))
 if !length($cur)
  var @tbl = (@tbl,$nam)
 else
 {if match($cur,'^0X',true)
   var $cur = hx2dec($cur)
  if match($cur,'^[0-9]*$')
  {if expr('<',expr('/',$cur,$val),1)
    var @tbl = (@tbl,$nam)
  }
  else
  {var $exp = replace($exp,'\*','x')
   var $cur = replace($cur,'\*','x')
   if !match($exp,quote($cur),true)
    var @tbl = (@tbl,$nam)
  }
 }
}
call setHcveResult(cond(\
  scalar(@tbl),concat('Parameters [',join(' ',@tbl),'] not set properly'),\
               'All Set'))
]]></command>
<description><![CDATA[This rule checks if the kernel parameters are set either to the formula or to values greater than or equal to the recommended values. The recommended formula/values are as follows:
ksi_alloc_max=(nproc*8)|16384,
max_thread_proc=3000,
maxdsiz=2063835136,
maxdsiz_64bit=2147483648,
maxfiles=2048,
maxfiles_lim=65536,
maxssiz=134217728,
maxssiz_64bit=1073741824,
maxswapchunks=16384,
maxuprc=((nproc*9)/10)|1843,
maxusers=512,
msgmap=(2+msgmni)|4098,
msgmni=4096,
msgseg=32767,
msgtql=4096,
ncallout=6000,
ncsize=((8*nproc+2048)+vx_ncsize)|22528,
nfile=3000,
nflocks=4096,
ninode=(8*nproc+2048)|18432,
nkthread=6000,
nproc=2048,
semmap=(semmni+2)|4098,
semmni=4096,
semmns=(semmni*2)|8192,
semmnu=(nproc-4)|2044,
semvmx=32767,
shmmax=Physical Memory,
shmmni=512,
shmseg=32,
tcp_conn_request_max=2048 and
vps_ceiling=64]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Not Certified OS|You must use one of the listed certified operating systems.|
|Parameters ... not set correctly|Set the value of the kernel parameters listed to the correct value of the formula.|
|maxfiles_lim|Set maxfiles_lim according to following:%BR%Installing WebCache - 65536 or higher%BR%Not installing WebCache - 2048 or higher|]]></action>
<action type="positive"><![CDATA[All kernel parameters are set correctly.]]></action>
</rule>
<rule condition="=~" id="24" maximum="N" minimum="TNS Listener 10.1.0.2 or later is running|Free" mode="VERIFY" name="Port 1521" repeat="1" command_type="RDA">
<command><![CDATA[var @lst = grepCommand('/bin/netstat -an','LISTEN')
if !grep(@lst,'1521','f')
 return setHcveResult('Free')
call cond(\
 testFile('x','/usr/sbin/lsof'),assign($prc,\
   grepCommand('/usr/sbin/lsof -i TCP:1521','LIST','f')),\
 testFile('x','/usr/bin/lsof'),assign($prc,\
   grepCommand('/usr/bin/lsof -i TCP:1521','LIST','f')),\
 testFile('x','/usr/local/bin/lsof'),assign($prc,\
   grepCommand('/usr/local/bin/lsof -i TCP:1521','LIST','f')))
if !length($prc)
 return setHcveResult('Cannot access lsof')
macro chk_tns
{var ($prc) = @arg
 var @cmd = grepCommand('ps -ef',field('\s+',1,$prc))
 var @ver = command(replace(field(\
    '\s+',8,grep(@cmd,'tnslsnr','f')),'tnslsnr','lsnrctl version'))
 var $ver = field('\s+',4,grep(@ver,'LSNRCTL','f'))
 return cond(compare('older',$ver,'10.1.0.2.0'),\
             concat('TNS Listener version [',$ver,'] is running'),\
             'TNS Listener 10.1.0.2 or later is running')
}
call setHcveResult(cond(not(match(field('\s+',0,$prc),'tnslsnr',true)),\
                        'Port is used by non-oracle program',\
                        chk_tns($prc)))
]]></command>
<description><![CDATA[This rule checks if port 1521 is free. If an Oracle listener version 10.1.0.2 or later uses port 1521, then the existing database and the Oracle Application Server 10g Metadata Repository will use the existing listener. The installer performs this configuration automatically. If an Oracle listener version earlier than 10.1.0.2 uses port 1521, then the existing listener must be stopped. After the installation is complete, you can configure the new 10.1.0.2 listener to listen to the existing (pre 10.1.0.2) databases. If non Oracle programs use port 1521, then this program must be configured to listen to ports other than 1521. For more information, see the "If Port 1521 is in Use" section of the ''Oracle Application Server Installation Guide 10g Release 2 (10.1.2) for HP-UX PA RISC (64 Bit)''.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|TNS Listener version ... is running|Stop the existing listener.|
|Port is used by non-oracle program|Reconfigure the program to use a different port to 1521.|]]></action>
<action type="positive"><![CDATA[Port 1521 is not used or is used by TNS*Listener version 10.1.0.2 or later.]]></action>
</rule>
<rule condition="==" id="25" maximum="N" minimum="Properly defined" mode="VERIFY" name="Environment Variables" repeat="1" command_type="RDA">
<command><![CDATA[
if grepEnv('^(TNS_ADMIN|ORA_NLS|ORA_NLS32|ORA_NLS33|ORACLE_SID)$')
 return setHcveResult('Some variables are set')
if testFile('e','/etc/oratab')
{if !testFile('r','/etc/oratab')
  return setHcveResult('Cannot access /etc/oratab')
 var @pth = (split(':',join(':',getEnv('PATH'),\
                                getEnv('CLASSPATH'),\
                                getEnv('LD_LIBRARY_PATH'))))
 loop $lin (grepFile('/etc/oratab','#|^$','v'))
 {var $pat = concat('^',quote(replace(field(':',1,$lin),'\/+$')),'(\/.*)?$')
  if grep(@pth,$pat)
   return setHcveResult('Variables containing reference to existing \
                         Oracle homes')
 }
}
return setHcveResult('Properly defined')
]]></command>
<description><![CDATA[This rule checks if the following environment variables are not set: ORACLE_SID, TNS_ADMIN, and all ORA_NLS related environment variables such as ORA_NLS, ORA_NLS33, and so on. In addition, the following environment variables must not reference to any existing Oracle home, PATH, CLASSPATH, SHLIB_PATH, and LD_LIBRARY_PATH.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Variables containing reference to existing Oracle homes|Remove any reference to existing Oracle homes from PATH, CLASSPATH, SHLIB_PATH, and LD_LIBRARY_PATH.|
|Some variables are set|Unset ORACLE_SID, TNS_ADMIN, ORA_NLS, ORA_NLS32, and ORA_NLS33.|
|Cannot access /etc/oratab|Grant read permission on /etc/oratab to the current user.|]]></action>
<action type="positive"><![CDATA[Environment variables do not have a reference to existing Oracle homes.]]></action>
</rule>
<rule id="26" mode="RECORD" name="Domain Name" repeat="1" command_type="RDA">
<command><![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','/bin/nslookup')
{if $nam
 {var $nsl = field(concat(quote($nam),'\.'),1,\
                  grepCommand(concat('/bin/nslookup ',$hst),'Name','f'))
 }
 else
 {var $nsl = field(concat(quote($hst),'\.'),1,\
                  grepCommand(concat('/bin/nslookup ',$hst),'Name','f'))
 }
}
call setHcveResult(cond($dom,$dom,\
                        $nis,$nis,\
                        $dns,$dns,\
                        $nsl,$nsl,\
                             'NotFound'))
]]></command>
<description><![CDATA[The rule gets the host domain name.]]></description>
</rule>
<rule id="27" mode="RECORD" name="IP Address" repeat="1" command_type="RDA">
<command><![CDATA[var ($hst) = command('hostname')
var $ip = field('\s+',3,\
 grepCommand(concat('/usr/sbin/ping ',$hst,' -n 1'),'\s(\d+\.\d+\.)+','f'))
call setHcveResult(replace($ip,':'))
]]></command>
<description><![CDATA[This rule gets the host IP address.]]></description>
</rule>
<rule condition="==" id="28" minimum="Host correctly registered in DNS" mode="VERIFY" name="DNS Lookup" repeat="1" command_type="RDA">
<command><![CDATA[var $ip  = "%27%"
var $hst = field('\.',0,command('hostname'))
call setHcveResult(cond(\
  not(length($ip)),\
    'Cannot determine IP address',\
  not(testFile('x','/bin/nslookup')),\
    'Cannot access /bin/nslookup',\
  and(grepCommand(concat('/bin/nslookup ',$hst),quote($ip),'f'),\
      grepCommand(concat('/bin/nslookup ',$ip),quote($hst),'f')),\
    'Host correctly registered in DNS',\
    'Host not correctly registered in DNS'))
]]></command>
<description><![CDATA[This rule checks if the host is registered properly in the DNS.]]></description>
<action type="negative" 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 /bin/nslookup|Grant execute permission on /bin/nslookup to the current user.|]]></action>
<action type="positive"><![CDATA[The host is registered correctly in the DNS.]]></action>
</rule>
<rule condition="==" id="29" minimum="Contains host.domain" mode="VERIFY" name="/etc/hosts Format" repeat="1" command_type="RDA">
<command><![CDATA[var $dom = "%26%"
var $ip  = "%27%"
if !testFile('r','/etc/hosts')
 return setHcveResult('Cannot access /etc/hosts')
var $hst = field('\.',0,command('hostname'))
var $fqd = concat($hst,'.',$dom)
var ($lin) = grepFile('/etc/hosts',quote($fqd),'f')
var @fld = split('\s+',$lin,4)
call setHcveResult(cond(\
  compare('eq',join('|',$fld[0],$fld[1]),join('|',$ip,$fqd)),\
    'Contains host.domain',\
    'Missing host.domain'))
]]></command>
<description><![CDATA[This rule checks if the /etc/host file contains a line with "ip_address fully_qualified_hostname short_hostname".]]></description>
<action type="negative" syntax="wiki"><![CDATA[The Fully Qualified Host Name is not configured properly.
|*Return Value*|*Action*|
|Missing host.domain|Add the FQDN in the /etc/hosts file.|
|Cannot access /etc/hosts|Grant read permission on /etc/hosts to the current user.|]]></action>
<action type="positive"><![CDATA[The Fuly Qualified Domain name is set correctly.]]></action>
</rule>
<rule condition="==" id="30" minimum="DHCP client is not enabled" mode="VERIFY" name="DHCP Client Check" repeat="1" command_type="RDA">
<command><![CDATA[var @lst = grepFile('/etc/rc.config.d/netconf','^#','v')
var ($cli) = grep(@lst,'DHCP_ENABLE','f')
call setHcveResult(cond(\
  expr('==',field('=',1,$cli),1), 'DHCP client is enabled',\
  expr('==',field('=',1,$cli),0), 'DHCP client is not enabled',\
                                  'Not able to determine DHCP client status'))
]]></command>
<description><![CDATA[This rule checks if the server is running DHCP client. The IP address of the computer must be static. Oracle Application Server does not support HP-UX systems using DHCP.]]></description>
<action type="negative"><![CDATA[DHCP clients are not supported. You must use a static IP address and host name]]></action>
<action type="positive"><![CDATA[This server is not using the DHCP client. No action required.]]></action>
</rule>
<rule condition="==" id="31" minimum="Less than 127 char" mode="VERIFY" name="Oracle Home Length" repeat="1" command_type="RDA">
<command><![CDATA[var $ORACLE_HOME = getEnv('ORACLE_HOME')
call setHcveResult(cond(\
  not(defined($ORACLE_HOME)),\
    'ORACLE_HOME is not set',\
  expr('<=',length($ORACLE_HOME),127),\
    'Less than 127 char',\
    'Longer than 127 characters'))
]]></command>
<description><![CDATA[This rule checks that the path to the Oracle home directory is not longer than 127 characters.]]></description>
<action type="negative" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Longer than 127 characters|Change ORACLE_HOME to a directory not longer than 127 characters.|
|ORACLE_HOME is not set|Set the ORACLE_HOME environment variable.|]]></action>
<action type="positive"><![CDATA[The Oracle home directory is not longer than 127 characters.]]></action>
</rule>
</hcve>
