# S100OS.def: Collects the Operating System Information # $Id: S100OS.def,v 2.8 2012/01/23 13:47:29 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S100OS.def,v 2.8 2012/01/23 13:47:29 mschenke Exp $ # # Change History # 20120123 KRA Use HKCU abbreviation. =head1 NAME S100OS - 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 module ...',tput('off') # Initialization var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' 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 runtime 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:[[%MRC:S999END%',getFile('report','S999END'),\ '][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','S999END'),'][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 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' write '' loop $key (grepEnv('NLS','i')) write $key,'=',getEnv($key) write '' write $TOP write '---+ National Language Support TZ Environment Settings' write '' loop $key (grepEnv('TZ','i')) write $key,'=',getEnv($key) write '' 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 writeLastFile() write $TOP } if loadCommand('locale LC_CTYPE') {write '---+ locale Environment Values' write "---## Output the 10 first lines of: locale LC_CTYPE" call writeLastFile(0,9) write $TOP } toc '2:[[',getFile(),'][rda_report][NLS Environment Information]]' =head2 java_version - Java Version Gets the Java version. =cut debug ' Inside OS module, gathering Java version' if findCommand('java',true) {var $cmd = last report java_version prefix {write '---+ Java Version' write '---## Gathered by running: ',encode($cmd),' -version' } call writeCommand(concat(catCommand($cmd),' -version 2>&1')) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Java Version]]' } =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 writeFile($fil) write $TOP } loop $fil ('/etc/security/limits.conf',\ '/etc/sysconfig/oracleasm',\ '/etc/sysconfig/rawdevices',\ '/etc/sysconfig/selinux') {if testFile('r',$fil) {write '---+ ',$fil,' File' call statFile('b',$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' write '' } 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) {write '' 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. =back =end credits =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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