<!-- $Id: P400RAC_lnx.xml,v 1.6 2007/11/21 16:24:38 mschenke Exp $ -->
<!-- ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/hcve/P400RAC_lnx.xml,v 1.6 2007/11/21 16:24:38 mschenke Exp $ -->
<hcve name="RAC 10G DB and OS Best Practices (Linux)" type="P" product="RAC" platform="linux">
<rule id="10" mode="RECORD" name="ORA_CRS_HOME" repeat="1" command_type="RDA">
<command><![CDATA[call load_passwords()
call initRemote()
var $ORA_CRS_HOME = getEnv('ORA_CRS_HOME')
if !testDir('d',$ORA_CRS_HOME)
{if grepFile('/etc/init.d/init.cssd','^ORA_CRS_HOME=','f')
  var $ORA_CRS_HOME = value(last)
}
call setHcveResult($ORA_CRS_HOME)
]]></command>
<description><![CDATA[This rule records the value of ORA_CRS_HOME.]]></description>
</rule>
<rule id="100" mode="RECORD" name="Database Name" repeat="1" command_type="RDA">
<command><![CDATA[set $sql
{SELECT 'VERSION=' || version
" FROM v$instance;
"SELECT name || '=' || value 
" FROM v$parameter
" WHERE name IN ('cpu_count',
"                'db_block_size',
"                'db_file_multiblock_read_count',
"                'db_name',
"                'max_commit_propagation_delay',
"                'parallel_execution_message_size',
"                'parallel_min_servers');
"SELECT sequence_name || '=' || cache_size
" FROM dba_sequences
" WHERE sequence_name IN ('AUDSES$','IDGEN1$')
"   AND sequence_owner = 'SYS';
"SELECT 'INTERCONNECT_NETWORK=' || SUBSTR(ip_ksxpia,1,7)
" FROM x$ksxpia;
}
call loadSql($sql)
call setHcveResult(value(grepLastSql('db_name=','f')))
]]></command>
<description><![CDATA[This rule loads database parameters and records the database name.]]></description>
</rule>
<rule id="102" mode="RECORD" name="Database Version" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(value(grepLastSql('VERSION=','f')))
]]></command>
<description><![CDATA[This rule records the database version.]]></description>
</rule>
<rule id="104" mode="RECORD" name="Interconnect Network" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(\
value(grepLastSql('INTERCONNECT_NETWORK=','f')))]]></command>
<description><![CDATA[This rule records the value of the Interconnect Network.]]></description>
</rule>
<rule id="106" mode="RECORD" name="DB Block Size" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(\
value(grepLastSql('db_block_size=','f')))]]></command>
<description><![CDATA[This rule records the db_block_size database parameter.]]></description>
</rule>
<rule id="108" mode="RECORD" name="DB File Multiblock Read Count" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(\
value(grepLastSql('db_file_multiblock_read_count','f')))]]></command>
<description><![CDATA[This rule records the db_file_multiblock_read_count database parameter.]]></description>
</rule>
<rule condition="==" id="120" minimum="0" mode="VERIFY" name="Max Commit Propagation Delay" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(\
value(grepLastSql('max_commit_propagation_delay=','f')))]]></command>
<description><![CDATA[This rule verifies the max_commit_propagation_delay database parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The value of the max_commit_propagation_delay database parameter is not set to zero. Set the value to zero.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The value of the max_commit_propagation_delay database parameter is set to zero.]]></action>
</rule>
<rule condition="&gt;=" id="130" minimum="10000" mode="VERIFY" name="SYS.AUDSES$ Cache Size" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(value(grepLastSql('AUDSES\$=','f')))]]></command>
<description><![CDATA[This rule verifies the cache_size parameter for sequence SYS.AUDSES$.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The cache size for sequence SYS.AUDSES$ is less than 10,000. Set the cache size greater than or equal to 10,000.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The cache size for sequence SYS.AUDSES$ is greater than or equal to 10,000.]]></action>
</rule>
<rule condition="&gt;=" id="132" minimum="10000" mode="VERIFY" name="SYS.IDGEN1$ Cache Size" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(value(grepLastSql('IDGEN1\$=','f')))]]></command>
<description><![CDATA[This rule verifies the cache_size parameter for sequence SYS.IDGEN1$.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The cache size for sequence SYS.IDGEN1$ is less than 10,000. Set the cache size greater than or equal to 10,000.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The cache size for sequence SYS.IDGEN1$ is greater than or equal to 10,000.]]></action>
</rule>
<rule condition="&gt;=" id="140" minimum="4096" mode="VERIFY" name="Parallel Execution Msg Size" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(value(grepLastSql('parallel_execution_message_size=','f')))]]></command>
<description><![CDATA[This rule verifies the parallel_execution_message_size database parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The value of the parallel_execution_message_size database parameter is less than 4096. Set the value to 4096 or 8192.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The value of the parallel_execution_message_size database parameter is greater than or equal to 4096.]]></action>
</rule>
<rule id="150" mode="RECORD" name="Min Parallel Servers" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(expr('-',value(grepLastSql('cpu_count=','f')),1))]]></command>
<description><![CDATA[This rule records the minimum number of parallel servers.]]></description>
</rule>
<rule condition="&gt;=" id="152" minimum="%150%" mode="VERIFY" name="Min Parallel Servers" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(value(grepLastSql('parallel_min_servers=','f')))]]></command>
<description><![CDATA[This rule verifies the parallel_min_servers database parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The value of the parallel_min_servers database parameter is less than %150%. Set the value to greater than or equal to %150%.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The value of the parallel_min_servers database parameter is greater than or equal to %150%.]]></action>
</rule>
<rule condition="==" id="200" minimum="Found" mode="VERIFY" name="$ORA_CRS_HOME Defined?" repeat="1" command_type="RDA">
<command><![CDATA[call setHcveResult(cond(testDir('d',"%10%"),'Found','Missing'))]]></command>
<description><![CDATA[This rule verifies the existence of $ORA_CRS_HOME directory.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The $ORA_CRS_HOME directory does not exist or is not set properly. Set the value of the ORA_CRS_HOME environment variable.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The $ORA_CRS_HOME directory exists.]]></action>
</rule>
<rule condition="==" id="210" minimum="All loaded" mode="VERIFY" name="Remote Access" repeat="1" command_type="RDA">
<command><![CDATA[var ($ORA_CRS_HOME,@tbl) = ("%10%")
macro get_remote
{var (\@tbl,$id,$nod,$ora,$crs) = @arg
 
 var %tbl = ()
 if rexec($id,"uname -a",true)
  var @tbl = (@tbl,$nod)
 else
 {var ($sys{$nod}) = getRemoteLines()
  var $tbl{'uname'} = $sys{$nod}

  if !rexec($id,'env',true)
  {loop $lin (getRemoteLines())
   {var $key = key($lin)
    if compare('eq',$key,'ORACLE_HOME')
    {if !$ora
      var $ora = value($lin)
     break $crs
    }
    elsif match($key,'^(ORA_)CRS_HOME$')
    {if !$crs
      var $crs = value($lin)
     break $ora
    }
   }
  }

  if !$crs
   var $crs = "%10%"
  if $crs
  {if !rexec($id,concat('grep "_USR_ORA_DEBUG=" ',\
                        catCommand($crs,'bin','racgwrap')),true)
   {var $tbl{'dbg_crs'} = '?'
    loop $lin (getRemoteLines())
    {var $lin =  replace($lin,'#.*$')
     if compare('eq',key($lin),'_USR_ORA_DEBUG')
      var $tbl{'dbg_crs'} = value($lin)
    }
   }
  }

  if !$ora
   var $ora = getEnv('ORACLE_HOME')
  if $ora
  {if !rexec($id,concat('grep "_USR_ORA_DEBUG=" ',\
                        catFile($ora,'bin','racgwrap')),true)
   {var $tbl{'dbg_ora'} = '?'
    loop $lin (getRemoteLines())
    {var $lin =  replace($lin,'#.*$')
     if compare('eq',key($lin),'_USR_ORA_DEBUG')
      var $tbl{'dbg_ora'} = value($lin)
    }
   }
   if !rexec($id,concat('nm ',catCommand($ora,'bin','oracle'),\
                        ' | grep io_getevents'),true)
    var $tbl{'lib_aio'} = nvl(field('\s+',1,getRemoteLines()),'')
   var $inv = catCommand($ora,'inventory','ContentsXML','comps.xml')
   if compare('eq',"%116%",'10.1.0.5.0')
    var @lst = (4496339,4518443,4528572,5090822,5406923,5496454,5501362)
   elsif compare('eq',"%116%",'10.1.0.4.0')
    var @lst = (4215207,4463426,4518443,4539420,4694761,4902267,5021063)
   else
    var @lst = ()
   loop $num (@lst)
   {if rexec($id,concat('grep -sq "Oneoffs21\/',$num,'" ',$inv))
     var $tbl{'patch'} = join(',',$tbl{'patch'},$num)
   }
   if missing($tbl{'patch'})
    var $tbl{'patch'} = ''
  }

  if !rexec($id,"getconf LONG_BIT",true)
   var ($tbl{'bit'}) = getRemoteLines()
  if !rexec($id,"cat /proc/sys/fs/aio-max-size",true)
   var ($tbl{'aio_max'}) = getRemoteLines()
  if !rexec($id,"cat /proc/sys/kernel/sysrq",true)
   var ($tbl{'sys_req'}) = getRemoteLines()
  if !rexec($id,"free",true)
  {var @tmp = getRemoteLines()
   var $tbl{'mem'} = field('\s+',1,grep(@tmp,'^Mem:','f'))
   var $tbl{'swp'} = field('\s+',1,grep(@tmp,'^Swap:','f'))
  }
  if !rexec($id,"cat /proc/sys/net/core/rmem_max",true)
   var ($tbl{'rmm_max'}) = getRemoteLines()
  if !rexec($id,"cat /proc/sys/net/core/wmem_max",true)
   var ($tbl{'wmm_max'}) = getRemoteLines()
  if !rexec($id,"cat /proc/sys/net/core/rmem_default",true)
   var ($tbl{'rmm_def'}) = getRemoteLines()
  if !rexec($id,"cat /proc/sys/net/core/wmem_default",true)
   var ($tbl{'wmm_def'}) = getRemoteLines()
  if !rexec($id,"/sbin/lsmod |grep 'hangcheck-timer'",true)
   var $tbl{'hng_chk'} = field('\s+',0,getRemoteLines())
 }
 call setDataValue($nod,%tbl)
}

if getSetting('REMOTE_NODES')
{loop $id (split(',',last))
 {var ($nod,$ora) = getSetting(concat('REMOTE_',$id,'_HOSTNAME'))
  var @nod = (@nod,$nod)
  if getRemoteSetup($id,true)
  {var $cfg = catFile(getSetting('RDA_WORK'),last)
   loop $lin (grepFile($cfg,'^ORACLE_HOME='))
    var $ora = value($lin)
  }
  call get_remote(\@tbl,$id,$nod,$ora)
 }
}
else
{if command(catCommand($ORA_CRS_HOME,'bin','olsnodes'))
  var @nod = last
 else
  var @nod = command(catCommand($ORA_CRS_HOME,'bin','lsnodes'))
 else
  var @nod = ()
 loop $nod (@nod)
 {call setTempSetting('REMOTE_RAC_DESCRIPTION',concat('Cluster node ',$nod))
  call setTempSetting('REMOTE_RAC_HOSTNAME',$nod)
  call get_remote(\@tbl,'RAC',$nod)
 }
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),\
                   cond(scalar(@nod),'All loaded','None')))
]]></command>
<description><![CDATA[This rule collects the remote node information.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The reported nodes are not reachable. Take the appropriate actions.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The remote node information is loaded successfully.]]></action>
</rule>
<rule condition="==" id="220" minimum="All Set" mode="VERIFY" name="_USR_ORA_DEBUG / CRS" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'dbg_crs')
 next compare('eq',$val,'1')
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'All Set'))
]]></command>
<description><![CDATA[This rule verifies that '_USR_ORA_DEBUG' is set to 1 in $ORA_CRS_HOME/bin/racgwrap.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The _USR_ORA_DEBUG parameter is either missing or not set to 1 in some nodes. Set the _USR_ORA_DEBUG parameter to 1 in $ORA_CRS_HOME/bin/racgwrap for the failed nodes.
When the status is 'Unknown', check the connectivity to the node first and then check if the ORA_CRS_HOME variable is set.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The _USR_ORA_DEBUG parameter is set to 1 in $ORA_CRS_HOME/bin/racgwrap.]]></action>
</rule>
<rule condition="==" id="230" minimum="All Set" mode="VERIFY" name="_USR_ORA_DEBUG / ORA" repeat="1" command_type="RDA">
<command><![CDATA[import %dbg_ora
if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'dbg_ora')
 next compare('eq',$val,'1')
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'All Set'))
]]></command>
<description><![CDATA[This rule verifies that _USR_ORA_DEBUG is set to 1 in $ORACLE_HOME/bin/racgwrap.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The _USR_ORA_DEBUG parameter is either missing or not set to 1 in some nodes. Set the _USR_ORA_DEBUG parameter to 1 in $ORACLE_HOME/bin/racgwrap for the failed nodes.
When the status is 'Unknown', check the connectivity to the node first and then check if the ORACLE_HOME variable is set.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The _USR_ORA_DEBUG parameter is set to 1 in $ORACLE_HOME/bin/racgwrap.]]></action>
</rule>
<rule condition="==" id="240" minimum="OK" mode="VERIFY" name="rmem_max" repeat="1" command_type="RDA">
<command><![CDATA[import %rmm_max
if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'rmm_max')
 next expr('>=',$val,262144)
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the value of the rmem_max User Datagram Protocol parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The rmem_max parameter is either missing or less than 262,144 in some nodes. Set the value in /proc/sys/net/core/rmem_max to greater than or equal to 262,144 for the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The /proc/sys/net/core/rmem_max parameter is greater than or equal to 262,144.]]></action>
</rule>
<rule condition="==" id="250" minimum="OK" mode="VERIFY" name="UDP Buffer Size" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
var $BUF_REQD = expr('*',num('%108%',0),num('%106%',0))
call setHcveVariable('$BUF_REQD')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'rmm_max')
 if !defined($val)
  var @tbl = (@tbl,concat($nod,':Unknown'))
 next or(expr('<=',$BUF_REQD,262144),expr('>=',$val,$BUF_REQD))
 var @tbl = (@tbl,concat($nod,':',$val))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the value of the User Datagram Protocol Buffer Size parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[In some nodes, the User Datagram Protocol buffer size is lower than the product of db_file_multiblock_read_count and db_block_size. Set the value of rmem_max to ${BUF_REQD} or higher.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The User Datagram Protocol buffer size is less than ${BUF_REQD}.]]></action>
</rule>
<rule condition="==" id="260" minimum="OK" mode="VERIFY" name="wmem_max" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'wmm_max')
 next expr('>=',$val,262144)
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the value of the wmem_max User Datagram Protocol parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The wmem_max parameter is either missing or less than 262,144 in some nodes. Set the value in /proc/sys/net/core/wmem_max to greater than or equal to 262,144 for the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The /proc/sys/net/core/wmem_max parameter is greater than or equal to 262,144.]]></action>
</rule>
<rule condition="==" id="270" minimum="OK" mode="VERIFY" name="rmem_default" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'rmm_def')
 next expr('>=',$val,262144)
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the value of the rmem_default User Datagram Protocol parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The rmem_default parameter is either missing or less than 262,144 in some nodes. Set the value in /proc/sys/net/core/rmem_default to greater than or equal to 262,144 for the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The /proc/sys/net/core/rmem_default parameter is greater than or equal to 262,144.]]></action>
</rule>
<rule condition="==" id="280" minimum="OK" mode="VERIFY" name="wmem_default" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'wmm_def')
 next expr('>=',$val,262144)
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the value of the wmem_default User Datagram Protocol parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The wmem_default parameter is either missing or less than 262,144 in some nodes. Set the value in /proc/sys/net/core/wmem_default to greater than or equal to 262,144 for the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The /proc/sys/net/core/wmem_default parameter is greater than or equal to 262,144.]]></action>
</rule>
<rule condition="==" id="290" minimum="OK" mode="VERIFY" name="Sysrq Magic Keys" repeat="1" command_type="RDA">
<command><![CDATA[import %sys_req
if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'sys_req')
 next compare('eq',$val,'1')
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies that Sysrq Magic Keys are enabled.]]></description>
<action type="negative" syntax="wiki"><![CDATA[Sysrq keys are not enabled in some nodes. Set the value in /proc/sys/kernel/sysrq to 1 for the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[Sysrq Magic Keys are enabled in /proc/sys/kernel/sysrq.]]></action>
</rule>
<rule condition="==" id="300" minimum="linked" mode="VERIFY" name="Oracle Executable Linkage with async I/O" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'lib_aio')
 if !match($val,'io_getevents\@\@LIBAIO_\d+.\d+')
  var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'linked'))
]]></command>
<description><![CDATA[This rule verifies Oracle executable linkage with async I/O.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The Oracle executable is not linked with async I/O in some nodes. Link the Oracle executable with async I/O for the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The Oracle executable is linked with async I/O.]]></action>
</rule>
<rule condition="==" id="310" minimum="OK" mode="VERIFY" name="hangcheck-timer" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'hng_chk')
 if !compare('eq',$val,'hangcheck-timer')
  var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the Linux hangcheck-timer parameter.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The Linux hangcheck-timer module is not loaded in some nodes. Load the hangcheck-timer module in the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The Linux hangcheck-timer module is loaded.]]></action>
</rule>
<rule condition="==" id="320" minimum="OK" mode="VERIFY" name="aio-max-size Setting" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'aio_max')
 next expr('>=',$val,1048576)
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown')))
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies the aio-max-size setting.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The aio_max_size parameter is either missing or less than 1,048,576 in some nodes. Set the value in /proc/sys/fs/aio-max-size to greater than or equal to 1,048,576 in the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<action type="positive" syntax="wiki"><![CDATA[The aio-max-size parameter is greater than or equal to 1,048,576.]]></action>
</rule>
<rule condition="==" id="330" minimum="OK" mode="VERIFY" name="Memory (32-bit)" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $bit = getDataValue($nod,'bit')
 var $mem = getDataValue($nod,'mem')
 var $sys = getDataValue($nod,'uname')
 if !and($bit,$mem,$sys)
  var @tbl = (@tbl,concat($nod,':Unknown'))
 elsif and(compare('eq',$bit,'32'),expr('>=',$mem,6291456))
 {if !match($sys,'hugemem')
   var @tbl = (@tbl,concat($nod,':',field('\s+',2,$sys)))
 }
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies memory (32-bit).]]></description>
<action type="negative" syntax="wiki"><![CDATA[The hugemem kernel is not installed for RAM greater than 6GiB (RH 32-bit only) in some nodes. Install the hugemem kernel in the failed nodes.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<<action type="positive" syntax="wiki"><![CDATA[The hugemem kernel is installed for RAM greater than 6GiB (RH 32-bit only).]]></action>
</rule>
<rule condition="==" id="340" minimum="OK" mode="VERIFY" name="Swap (32-bit)" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $bit = getDataValue($nod,'bit')
 var $mem = getDataValue($nod,'mem')
 var $swp = getDataValue($nod,'swp')
 if !and($bit,$mem,$swp)
  var @tbl = (@tbl,concat('[',$nod,':]Unknown'))
 elsif compare('eq',$bit,'32')
 {if expr('<=',$mem,1048576)
  {next expr('>=',$swp,expr('*',2,$mem))
    var @tbl = (@tbl,concat('[',$nod,':]Swap<2RAM'))
  }
  elsif !expr('>=',$swp,2097152)
   var @tbl = (@tbl,concat('[',$nod,':]Swap<2GiB'))
 }
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies swap (32-bit).]]></description>
<action type="negative" syntax="wiki"><![CDATA[Refer to the following table for the necessary action to take:
|*Return Value*|*Action*|
|...Swap<2RAM|The Operating System swap space is less than twice the RAM in some nodes. The swap space should be greater than or equal to twice the RAM (twice physical RAM up to 2 GiB maximum for 32-bit).|
|...Swap<2GiB|The Operating System swap space is less than 2 GiB in some nodes. The swap space should be equal to 2,146,754,560 (32-bit Linux 2 GiB maximum swap).|
|...Unknown|Check the connectivity to the reported nodes.|]]></action>
<<action type="positive" syntax="wiki"><![CDATA[The Operating System swap space is OK.]]></action>
</rule>
<rule condition="==" id="350" minimum="OK" mode="VERIFY" name="Swap (64-bit)" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $bit = getDataValue($nod,'bit')
 var $mem = getDataValue($nod,'mem')
 var $swp = getDataValue($nod,'swp')
 if !and($bit,$mem,$swp)
   var @tbl = (@tbl,concat('[',$nod,':]Unknown'))
 elsif compare('eq',getDataValue($nod,'bit'),'64')
 {if expr('<=',$mem,4194304)
  {next expr('>=',$swp,expr('*',2,$mem))
   var @tbl = (@tbl,concat('[',$nod,':]Swap<2RAM'))
  }
  elsif !expr('>=',$swp,$mem)
   var @tbl = (@tbl,concat('[',$nod,':]Swap<RAM'))
 }
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'OK'))
]]></command>
<description><![CDATA[This rule verifies swap (64-bit).]]></description>
<action type="negative" syntax="wiki"><![CDATA[Refer to the following table for the necessary action to take:
|*Return Value*|*Action*|
|...Swap<2RAM|The Operating System swap space is less than twice the RAM in some nodes. For the nodes with RAM upto 4 GiB, the swap space should be greater than twice the RAM (RAM <= 4 GiB, SWAP >= 2*RAM).|
|...Swap<RAM|The Operating System swap space is less than the RAM in some nodes. For nodes with RAM more than 4 GiB, the swap space should be greater than or equal to RAM (RAM > 4 GiB, SWAP >= RAM).|
|...Unknown|Check the connectivity to the reported nodes.|]]></action>
<<action type="positive" syntax="wiki"><![CDATA[The Operating System swap space is OK.]]></action>
</rule>
<rule condition="==" id="360" minimum="Complete" mode="VERIFY" name="Patch List" repeat="1" command_type="RDA">
<command><![CDATA[if compare('eq',"%210%",'None')
 return setHcveResult('Unknown nodes')
loop $nod (getDataKeys())
{var $val = getDataValue($nod,'patch')
 next compare('eq',$val,'')
 var @tbl = (@tbl,concat($nod,':',nvl($val,'Unknown'))) 
}
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Complete'))
]]></command>
<description><![CDATA[This rule verifies that all patches are applied.]]></description>
<action type="negative" syntax="wiki"><![CDATA[The listed patches are not applied in some nodes. Take the appropriate action.
When the status is 'Unknown', check the connectivity to the node.]]></action>
<<action type="positive" syntax="wiki"><![CDATA[All patches are applied.]]></action>
</rule>
</hcve>
