# DCos.ctl:100:Collects the Operating System Information # $Id: DCos.ctl,v 1.13 2016/02/09 18:40:07 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/DCos.ctl,v 1.13 2016/02/09 18:40:07 RDA Exp $ # # Change History # 22309546 SJC Collect /etc/security/limits.d/90-nproc.conf if present =head1 NAME OS:DCos - Collects the Operating System Information =head1 DESCRIPTION This module performs operating system information gathering for the RDA process. The following reports can be generated and are regrouped under C: =cut use Mrc echo tput('bold'),'Processing OS.OS module ...',tput('off') # Initialization var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' var $XPL = 'OS.OS/files/' toc '1:Operating System Setup' =head2 report - Report Settings Produces an overview of the main current settings, as well as some statistics about the SQL statement executions. This report contains basic run-time information only. You can find all gathered data by using the links in the index frame. The END module generates the report. =cut toc '2:[[',getFile('report','RDA.END',true),'][rda_report][Report Settings]]' =head2 system - System Information Produces an overview of key system configuration information (for example, CPUs and memory). The END module generates the report. =cut toc '2:[[',getFile('system','RDA.END'),'][rda_report][System Information]]' =pod The report provides on details of the system and operating system information (platform-specific code). =cut var @LINKS = () run &{check(getOsName(),'aix', 'OSaix',\ 'darwin', 'OSdarwin',\ 'dec_osf', 'OSosf',\ 'dynixptx', 'OSptx',\ 'hpux', 'OShpux',\ 'linux', 'OSlinux',\ 'solaris', 'OSsunos',\ cond(isCygwin(), 'OSwin32',\ isUnix(), 'OSunix',\ isVms(), 'OSvms',\ isWindows(), 'OSwin32'))}('OS',\@LINKS) =head2 nls_env - NLS Environment Information Collects NLS information. =cut debug ' Inside OS module, gathering NLS information' report nls_env if ?getCodePage() write '' write '---+!! National Language Support Settings' write $TOC if or(isWindows(),isCygwin()) {write '---+ Regional Options' var $key = "HKCU\Control Panel\International" write '|*Language*|',nvl(getRegValue($key,'sLanguage'),'N/A'),'|' write '|*Country*|',nvl(getRegValue($key,'sCountry'),'N/A'),'|' write $TOP } write '---+ National Language Support NLS Environment Settings' prefix {call beginBlock(true) call addBlock('X','T','OS.OS/nlsenv') } loop $key (grepEnv('NLS','i')) write $key,'=',getEnv($key) if hasOutput(true) call endBlock() write $TOP write '---+ National Language Support TZ Environment Settings' prefix {call beginBlock(true) call addBlock('X','T','OS.OS/nlsenv') } loop $key (grepEnv('TZ','i')) write $key,'=',getEnv($key) if hasOutput(true) call endBlock() write $TOP write '---+ National Language Support Character Set Test' write '
'
if isVms()
 var $cmd = "write sys$output \042\350\042"
else
 var $cmd = "echo \042\350\042"
call loadCommand($cmd)
var ($str) = getLines(0,0)
write sprintf('%04x',unpack('C',$str))
write encode(sprintf("%4s",$str))
write '
' write '---++++!! Note:' write 'The above output was generated by echoing the character e with an \ accent grave. Depending on the language setting of the browser being \ used to view the output, this may show up as an unprintable character \ on the second line. This display should not be considered a problem \ with the script.%BR%' write $TOP if loadCommand('locale') {write '---+ locale Environment Summary' write '---## Output from: locale' call addBlock('X','O','OS.OS/locale.out') call writeLastFile() write $TOP } if loadCommand('locale LC_CTYPE') {write '---+ locale Environment Values' write "---## Output the 10 first lines of: locale LC_CTYPE" call addBlock('X','O','OS.OS/locale_LC_CTYPE.out') call writeLastFile(0,9) write $TOP } toc '2:[[',getFile(),'][rda_report][NLS Environment Information]]' =head2 java_version - Java Version Gets the Java version from the execution path. When the F command supports data model options like C<-d32> and C<-d64>, RDA also tries to collect those versions. Their success depends on the Java version. =cut debug ' Inside OS module, gathering Java version' if ?findCommand('java') {var $pgm = last report java_version prefix {write '---+ Java Version' write '---## Using: ',encode($cmd) call addBlock('X','E','OS.OS/java_version') } if writeCommand($cmd = concat($pgm,' -version 2>&1')) {write $TOP title '---+ Java Supported Data Models' loop $opt (reverse(grepCommand(concat($pgm,' -help 2>&1'),'\s(-d\d+)\s','1'))) {prefix {write '---## Using: ',encode($cmd) call addBlock('X','E',concat('OS.OS/java_',$opt,'_version')) } call writeCommand($cmd = join(' ',$pgm,quote($opt),'-version','2>&1')) if hasOutput(true) write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Java Version]]' } =head2 oh_java_version - Oracle Home Java Version Gets the Java version from the Oracle home. When the F command supports data model options like C<-d32> and C<-d64>, RDA also tries to collect those versions. Their success depends on the Java version. =cut debug ' Inside OS module, gathering Java version from Oracle home' if ?testFile('f',\ catFile(${SET.RDA.BEGIN.D_ORACLE_HOME},'jdk','bin',${AS.EXE:'java'})) {var $pgm = quote(last) report oh_java_version prefix {write '---+ Java Version' write '---## Using: ',encode($cmd) call addBlock('X','E','OS.OS/java_OH_version') } if writeCommand($cmd = concat($pgm,' -version 2>&1')) {write $TOP title '---+ Java Supported Data Models' loop $opt (reverse(grepCommand(concat($pgm,' -help 2>&1'),'\s(-d\d+)\s','1'))) {prefix {write '---## Using: ',encode($cmd) call addBlock('X','E',concat('OS.OS/java_OH_',$opt,'_version')) } call writeCommand($cmd = join(' ',$pgm,quote($opt),'-version','2>&1')) if hasOutput(true) write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Oracle Home Java Version]]' } =for stopwords conf =head2 etc_conf - *.conf Files in /etc Gets C<*.conf> files in C. =cut debug ' Inside OS module, listing *.conf files in /etc' report etc_conf prefix {write '---+!! *.conf Files in /etc' write '%TOC3%' } loop $fil (grepDir('/etc','\.conf$','np')) {write '---+ ',encode($fil),' File' call statFile('b',$fil) call addBlock('X','D',concat($XPL,$fil)) call writeFile($fil) write $TOP } loop $fil ('/etc/security/limits.conf',\ '/etc/security/limits.d/90-nproc.conf',\ '/etc/sysconfig/oracleasm',\ '/etc/sysconfig/rawdevices',\ '/etc/sysconfig/selinux') {if ?testFile('r',$fil) {write '---+ ',$fil,' File' call statFile('b',$fil) call addBlock('X','D',concat($XPL,$fil)) call writeFile($fil) write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][*.conf Files in /etc]]' =head2 tracing - Tracing Tools Identifies the availability of tracing tools. =cut debug ' Inside OS module, identifying the availability of debugging tools' report tracing prefix {write '---+ Tracing Tools' call beginBlock(true) call addBlock('X','T','OS.OS/debug_tools') } loop $cmd ('adb','crash','dbx','debug','dg_strace','gdb','kcrash','procstack',\ 'prss','pstack','sdb','strace','syscalls','trace','truss','tusc',\ 'xdb') {var $cmd = findCommand($cmd,true) if $cmd write $cmd } if isCreated(true) {call endBlock() write $TOP toc '2:[[',getFile(),'][rda_report][Tracing Tools]]' } =pod Adds useful platform-related links in the index. =cut if @LINKS toc '2:[[',$LINKS[0],'][_blank][Links]]\ ([[',$LINKS[1],'][_blank][Patches]])\ ([[',$LINKS[2],'][_blank][Docs]])' =begin credits =over 10 =item RDA 4.6: Michael Ferrante, Shawn Gillespie, Guido Tijskens. =item RDA 4.7: Weifeng Xie. =item RDA 4.18: Dave Henriquez, Munukuntla Murty. =item RDA 4.22: Grant Hayden. =item RDA 4.30: Adriana Dominguez. =item RDA 8.02: Adriana Dominguez. =item RDA 8.04: Adriana Dominguez. =item RDA 8.07: Rui Du. =item RDA 8.09: Torben Hein. =back =end credits =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut