# OSsunos.ctl: Solaris Specific Code # $Id: OSsunos.ctl,v 1.20 2015/09/25 00:39:24 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/OSsunos.ctl,v 1.20 2015/09/25 00:39:24 RDA Exp $ # # Change History # 20150924 MSC Eliminate trailing spaces. =head1 NAME OS:OSsunos - Submodule Specific to the Solaris Operating System =cut use Mrc # Make the module persistent keep $KEEP_BLOCK,@SHARE_MACROS var @SHARE_MACROS = ('ping_command') # Get the calling module var $MODULE = $arg[0] import $TOC,$TOP =head1 DESCRIPTION This module determines the Solaris version and the F command format. =cut if !$OS {keep $OS,$OSA,$OSM,$OSN,$OSP,$OSV var $OS = true # Determine the ps command format var $OSP = testCommand('ps -ef','/bin/ps -ef','/usr/bin/ps -ef') var $OSA = concat($OSP,' -o comm,args') # Determine the solaris version var $OSN = uname('s') var $OSV = replace(uname('r'),'^5','2') var $OSM = field('\.',1,$OSV) } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE INI MODULE Nothing required yet. =cut if compare('eq',$MODULE,'INI') {# Nothing required yet } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE END MODULE =head2 report - Report Settings Determines the operating system version and its bit size. =cut elsif compare('eq',$MODULE,'END_report') {#Determine for the end report the operating system version and its bit size. debug ' Inside END module, determining OS characteristics (solaris)' var $bit = 32 if expr('>=',$OSM,7) {var ($str) = command('isainfo -v') if match($str,'^64-bit') var $bit = 64 } # Load the system settings write '|Platform|',$bit,'-bit Sun|' write '|O/S Version|',$OSV,'|' } =head2 system - System information Extracts the system information such as CPU, memory, and swap information. =cut elsif compare('eq',$MODULE,'END_system') {prefix write '|*Item*|*Value*|' debug ' Inside END module, getting CPU information (solaris)' var $cnt = 0 loop $lin (grepCommand('psrinfo -v','processor operates at')) {incr $cnt var ($cpu[$cnt],$mhz[$cnt]) = \ match($lin,'The (.*) processor operates at (.*) MHz') } if $cnt {var ($off,$str) = (0,concat($cnt,' Processor(s) Installed')) while expr('<',$off,$cnt) {incr $off var $str = sprintf('%s%%BR%%[%02d]: %s %d MHz',$str,$off,\ $cpu[$off],$mhz[$off]) } write '|Processor(s)|',$str,'|' } debug ' Inside END module, getting memory information (solaris)' var ($lin) = grepCommand('prtconf','Memory size\:','f') if $lin {var $siz = replace(field('\:\s*',1,$lin),'Megabytes','MiB') write '|Total Physical Memory|',$siz,'|' } debug ' Inside END module, getting swap information (solaris)' var ($lin) = grepCommand('swap -s','\dk used,\s+\d+k available','f') if $lin {var ($use,$fre) = match($lin,'\s(\d+)k used,\s+(\d+)k available') var $tot = expr('+',$use,$fre) write sprintf('|Swap: Max Size|%d MiB|', expr('/',$tot,1024)) write sprintf('|Swap: Available|%d MiB|',expr('/',$fre,1024)) write sprintf('|Swap: In Use|%d MiB|', expr('/',$use,1024)) } if !hasOutput(true) write 'Information not available%BR%' write $TOP } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE OS MODULE =cut elsif compare('eq',$MODULE,'OS') { =head2 cpu_info - CPUs Gets CPU information. =cut debug ' Inside OS module, getting CPU information (solaris)' report cpu_info write '---+ CPU Information' write '---## Using: psrinfo -v' call writeCommand('psrinfo -v') write $TOP toc '2:[[',getFile(),'][rda_report][CPUs]]' =head2 memory_info - Memory Gets information about the physical memory. =cut debug ' Inside OS module, about physical memory (solaris)' report memory_info write '---+ Physical Memory Installed' write '---## Using: prtconf | grep "Memory size"' write '' loop $lin (grepCommand('prtconf','Memory size')) write $lin write '' write $TOP toc '2:[[',getFile(),'][rda_report][Memory]]' =head2 ism_info - Intimate Shared Memory Gets Intimate Shared Memory (ISM) usage. Oracle Solaris 8 identifies ISM attachments correctly. =cut if expr('>=',$OSM,8) {debug ' Inside OS module, about Intimate Shared Memory (ISM) usage (solaris)' report ism_info write '---+ Intimate Shared Memory (ISM) Usage' write 'To determine Intimate Shared Memory (ISM) usage use the instructions \ in %MOS_DOC:68281.1% to determine the Shared Memory Segment for the \ Oracle instance. Look at the associated line from the $ISM_Info \ command output. The ISMATTCH column shows the number of ISM attaches \ to shared memory segments, so a value greater than 0 means ISM is in \ use.' if expr('>=',$OSM,10) var $cmd = 'ipcs -imJ' else var $cmd = 'ipcs -im' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '2:[[',getFile(),'][rda_report][Intimate Shared Memory]]' } =head2 disk_info - Disk Drives Gets information about the disks. =cut debug ' Inside OS module, about disks (solaris)' report disk_info write '---+!! Disk Information' write $TOC write '---+ Disk Mounts' call writeCommand('mount') write $TOP write '---+ Disk Free' call writeCommand('df -k') write $TOP write '---+ Swap' call writeCommand('swap -l') write $TOP toc '2:[[',getFile(),'][rda_report][Disk Drives]]' =head2 ipc_info - Kernel Tables and IPC Gets the kernel tables and IPC information. =cut report kernel_info write '---+!! Kernel Tables and IPC' write $TOC write '---+ Kernel Tables' call writeCommand('sar -v 1 1') write $TOP write '---+ Semaphores' if expr('>=',$OSM,10) var $cmd = 'ipcs -saJ' else var $cmd = 'ipcs -sa' call writeCommand($cmd) write $TOP write '---+ Shared Memory' if expr('>=',$OSM,10) var $cmd = 'ipcs -maJ' else var $cmd = 'ipcs -ma' call writeCommand($cmd) write $TOP toc '2:[[',getFile(),'][rda_report][Kernel Tables and IPC]]' =head2 projects - Projects Lists all projects and reports the dynamic settings. Only projects with settings are reported in the second section. (Applies to Oracle Solaris 10 and later only.) =cut if expr('>=',$OSM,10) {debug ' Inside OS module, getting project information (solaris)' report projects write '---+!! Project Information' write $TOC # Get the project list and permanent settings var $cmd = 'projects -l' write '---+ Project List' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP # Get the current settings title '---+ Current Project Settings' loop $prj (grepCommand($cmd,'^\S')) {var $cmd = concat('prctl -i project ',quote($prj)) prefix {write '---++ Project ',encode($prj) write '---### Using: ',encode($cmd) } call writeCommand($cmd) if hasOutput(true) write $TOP } toc '2:[[',getFile(),'][rda_report][Projects]]' } =head2 zones - Zones Gets the zone information. (Applies to Oracle Solaris 10 and later only.) =cut if expr('>=',$OSM,10) {debug ' Inside OS module, getting zone information (solaris)' report zones var $cmd = 'zoneadm list -i -v' write '---+ Zone Information' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '2:[[',getFile(),'][rda_report][Zones]]' } =head2 ntp - NTP Status and Configuration Collects NTP status and the process information when NTP is running and accessible. It collects the F file when present. =cut debug ' Inside OS module, getting NTP status and configuration (solaris)' report ntp title '---+!! NTP Status, Process, and Configuration Information' title $TOC # Get the NTP status if ?findCommand('ntpq') {var $cmd = concat(last,' -p') prefix {write '---+ NTP Status' write '---## Using: ntpq -p' } var $hdr = true loop $lin (grepCommand($cmd,'.')) {if match($lin,'^=') var $hdr = false elsif match($lin,'No association ') write $lin elsif $hdr write '|*',replace(trim($lin),'\s+','*|*',true),'*|' else write '|',replace(trim($lin),'\s+',' |',true),' |' } if hasOutput(true) write $TOP } # Check for NTP process prefix {write '---+ NTP Process' write '' } loop $lin (grepCommand($OSP,'ntp')) write $lin if hasOutput(true) {write '' write $TOP } # Get the NTP configuration file prefix {write '---+ NTP Configuration' write '---## Information Taken from /etc/inet/ntp.conf' } call writeFile('/etc/inet/ntp.conf') if hasOutput(true) write $TOP if isCreated() toc '2:[[',getFile(),'][rda_report][NTP Status]]' =head2 packages - Operating System Packages Lists all operating system packages. =cut debug ' Inside OS module, getting operating system package information' report packages var $cmd = 'pkginfo -l' write '---+ Operating System Package Information' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '2:[[',getFile(),'][rda_report][Operating System Packages]]' =head2 patches - Operating System Patches Lists the operating system patches installed. Some Sun patches have long requirement lists, which cause F to throw C errors. RDA extracts data from the first 7 fields, thus limiting the output from F to 200 bytes, which prevents these errors. =cut debug ' Inside OS module, getting operating system patches (solaris)' report patches prefix {write '---+ Operating System Patches Information' write '---## Using: showrev -p' } loop $lin (command('showrev -p 2>/dev/null')) {var ($f1,$f2,$f3,$f4,$f5,$f6,$f7) = split('\s+',$lin,8) write $f1,' [[https://support.oracle.com/rs?type=search&\ sources=PATCH&term=',$f2,'][_blank][',$f2,']] ',\ $f4,' ',$f5,' ',$f6,' ',$f7,'%BR%' } if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Operating System Patches]]' } =head2 sysdef - System/Kernel Settings Gets the system/kernel settings. =cut debug ' Inside OS module, getting system/kernel settings (solaris)' report sysdef write '---+!! Display of System/Kernel Settings' write $TOC var $src = '/etc/sysdef' if loadCommand($src) {macro get_kernel {var ($nam,$src,$flg) = @arg var $val = field('\s+',0,grepLastFile(uc($nam),'f')) if and($flg,not(defined($val))) {var $src = '/etc/system' var $val = value(grepFile($src,$nam,'if')) } write '|',$nam,'| ',$val,'|',encode($src),'|' } write '---+ Main Kernel Parameters' write '|*Parameter*| *Value*|*Source*|' if match($OSV,'^2\.8$') {call get_kernel('noexec_user_stack',$src,true) call get_kernel('semmni',$src) call get_kernel('semmns',$src) call get_kernel('semmsl',$src) call get_kernel('semvmx',$src) call get_kernel('shmmax',$src) call get_kernel('shmmin',$src) call get_kernel('shmmni',$src) call get_kernel('shmseg',$src) } elsif match($OSV,'^2\.9$') {call get_kernel('noexec_user_stack',$src,true) call get_kernel('semmni',$src) call get_kernel('semmns',$src) call get_kernel('semmsl',$src) call get_kernel('semvmx',$src) call get_kernel('shmmax',$src) call get_kernel('shmmni',$src) } elsif match($OSV,'^2\.10$') {macro chk_param {var ($cmd,$prj) = @arg var ($lin) = grepCommand(concat($cmd,' -n ',$prj,' ',${RDA.N_PID}),\ '(basic|privileged|system)','if') if match($lin,'\b(\d+(\.\d*)?)(\w*)\b') var ($siz,undef,$typ) = (last) return join('',$siz,uc($typ)) } var $cmd = findCommand('prctl') call get_kernel('noexec_user_stack',$src,true) write '|semmni| ',chk_param($cmd,'project.max-sem-ids'),'|',encode($cmd),'|' write '|semmsl| ',chk_param($cmd,'process.max-sem-nsems'),'|',encode($cmd),\ '|' write '|shmmax| ',chk_param($cmd,'project.max-shm-memory'),'|',encode($cmd),\ '|' write '|shmmni| ',chk_param($cmd,'project.max-shm-ids'),'|',encode($cmd),'|' } write $TOP } var $cmd = '/usr/sbin/sysdef | grep -v instance | grep -v drv | tail -77' write '---+ System/Kernel Settings' write '---## Using: ',encode($cmd) write '' loop $lin (grepCommand('/usr/sbin/sysdef','(instance|drv)','v',-77)) write $lin write '' write $TOP toc '2:[[',getFile(),'][rda_report][System/Kernel Settings]]' =head2 initiator_port - Multipath Initiator Ports collects multipath initiator ports information. =cut debug ' Inside OS module, getting Multipath Initiator Ports information' report initiator_port title '---+ Multipath Initiator Ports' title '---++ List of Initiator Ports' call loadCommand('/usr/sbin/mpathadm list initiator-port') call writeLastFile() loop $lin (getLines()) {next !?$prt = isPort(field('\s+',2,$lin),true) write '---++ Information about Initiator Port ',$prt call writeCommand(\ concat('/usr/sbin/mpathadm show initiator-port ',$prt)) } if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Multipath Initiator Ports]]' } =for stopwords Reconfigurable =head2 cfgadm - Dynamically Reconfigurable Hardware Configuration collects attachment points data for hardware =cut debug ' Inside OS module, getting dynamically reconfigurable hardware info' report cfgadm title '---+ Dynamically Reconfigurable Hardware Configuration' title '---++ List of Attachment Points' call loadCommand('/usr/sbin/cfgadm -al') call writeLastFile() loop $lin (getLines(1)) {next !?$prt = isPort(field('\s+',0,$lin),true) write '---++ Configuration for Attachment Point ',$prt call writeCommand(concat('/usr/sbin/cfgadm -alv ',$prt)) } if isCreated(true) {write $TOP toc '2:[[',getFile(),\ '][rda_report][Dynamically Reconfigurable Hardware Configuration]]' } =head2 mpo - Memory Placement Optimization Collects memory placement optimization information. =head2 system_error_log - System Error Log Collects system error log data. =cut collect OS:RCsunos|OS() =pod Identifies useful platform-related links. =cut var \@LINKS = $arg[1] var @LINKS = ('http://www.oracle.com/us/sun/index.htm',\ 'https://support.oracle.com/handbook_partner/General/\ Sun_HW_Patch_TOC.html',\ 'http://www.oracle.com/technetwork/indexes/documentation/index.html') } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE PERF MODULE =cut elsif compare('eq',$MODULE,'PERF') {# Produce the performance report report perf_over write '---+!! System Performance Overview' write $TOC =pod Gets the system uptime. =cut debug ' Inside PERF module, about to execute uptime command' prefix write '---+ Uptime' call writeCommand('uptime') if hasOutput(true) write $TOP =pod Gets the system last reboot. =cut debug ' Inside PERF module, about to execute last reboot command' prefix write '---+ Last Restart' if findCommand('last') call writeCommand(concat(last,' reboot')) if hasOutput(true) write $TOP =pod Gets a process overview in terms of running databases, users logged on, and top CPU users. =cut if loadCommand($OSP) {debug ' Inside PERF module, about to gather user and process counts' write '---+ Process Overview' var $cnt = grepLastFile('oracle') write '|*Oracle Processes*|', $cnt,' |' var $cnt = grepLastFile('tnslsn','i') write '|*Listeners Processes*|', $cnt,' |' var $cnt = grepLastFile('DESCRIPTION=') write '|*Background Processes*|',$cnt,' |' var $cnt = grepLastFile('root') write '|*Root Processes*|', $cnt,' |' var $cnt = getLastLength() write '|*Total Processes*|', $cnt,' |' var $cnt = command('who') write '|*Number Users*|', $cnt,' |' var ($hdr) = getLines(0,0) call sortLastFile('ps_time') debug ' Inside PERF module, about to determine running databases' prefix {write '---+ Running Databases' write 'Note: the CPU usage in minutes' write '' write $hdr } loop $lin (grepLastFile('pmon')) write $lin if hasOutput(true) {write '' write $TOP } debug ' Inside PERF module, about to determine users logged on' write '---+ Who is Logged On?' call writeCommand('who | sort') write $TOP debug ' Inside PERF module, about to determine CPU hogs' var $cnt = ${N_TOP_PS:15} write '---+ Current CPU Hogs / Top ',$cnt,' by CPU Time' call writeLastFile(0,$cnt) write $TOP debug ' Inside PERF module, about to determine CPU hogs by %CPU' write '---+ Current TOP 10 CPU by %CPU (via /usr/ucb/ps)' call writeCommand('/usr/ucb/ps aux | head -11') debug ' Inside PERF module, about to determine root CPU hogs' var $cnt = ${N_TOP_ROOT:5} write '---+ Root CPU Hogs / Top ',$cnt,' by CPU Time' write '' write $hdr loop $lin (grepLastFile('root')) {next match($lin,'ckunix') write $lin decr $cnt break !$cnt } write '' write $TOP } =pod Gets a disk overview in terms of free space, disk I/O, disk errors, paging, and swapping. =cut debug ' Inside PERF module, about to gather File System Free Space' write '---+ File System Free Space in KiB' call writeCommand('df -k') write $TOP debug ' Inside PERF module, about to gather disk throughput in MiB' write '---+ Throughput MiB/sec, Transfers/sec, avg Service Time milliseconds' write '---## Using: iostat -M 10 3' call writeCommand('iostat -M 10 3') write $TOP debug ' Inside PERF module, about to gather disk throughput in KiB' write '---+ Disks Throughput' write '100 I/O per sec implies seek time 10 ms since most access is seek \ time%BR%Disks on PC capable of sustained 8-16 Mbit/sec and UNIX 32-40 \ Mbit/sec' write '---## Using: iostat -d 10 3' call writeCommand('iostat -d 10 3') write $TOP debug ' Inside PERF module, about to gather extended disk statistics' write '---+ Extended Disk Statistics' write 'Look for disks more than 30 % busy and service times of more than \ 50ms iostat -x.b > 30% && iostat -x.svc_t > 50ms == busy disk%BR%\ Look for overloaded scsi bus iostat -x.w >= 5% == busy scsi bus%BR%\ Stripping filesytems and tablespaces over multiple disks and \ controllers can spread I/O over multiple spindles.' write '---## Using: iostat -xe 10 3' call writeCommand('iostat -xe 10 3') write $TOP debug ' Inside PERF module, about to gather disk error reports' write '---+ Disk Error Reports' write '---## Using: iostat -e' call writeCommand('iostat -e') write $TOP var $out = verbatim($OSN) debug ' Inside PERF module, about to gather paging statistics' write '---+ Paging Activities' write '---## Using: sar -g 1 4 | grep -v ',$OSN write '' loop $lin (grepCommand('sar -g 1 4 2>&1',$out,'v')) write $lin write '' write $TOP debug ' Inside PERF module, about to gather swapping activity' write '---+ Swap Activities' write '---## Using: swap -l' call writeCommand('swap -l') write '---## Using: swap -s' call writeCommand('swap -s') write $TOP =pod Gets a system overview in terms of CPU usage, top processes, system calls, memory, message, and semaphore statistics. =cut debug ' Inside PERF module, about to gather CPU per-processor stats' write '---+ CPU per-Processor Statistics' write '---## Using: mpstat 1 3 -v' call writeCommand('mpstat 1 3 -v 2>&1') write $TOP debug ' Inside PERF module, about to gather CPU usage stats' write '---+ CPU Usage Statistics' write '---## Using: sar -u 1 4 | grep -v ',$OSN write '' loop $lin (grepCommand('sar -u 1 4 2>&1',$out,'v')) write $lin write '' write $TOP debug ' Inside PERF module, about to echo top command output' write '---+ Top Report Usage' call writeCommand('/usr/local/bin/top 40 1') write $TOP debug ' Inside PERF module, about to gather system calls' write '---+ System Calls' write '---## Using: sar -c 1 4 | grep -v ',$OSN write '' loop $lin (grepCommand('sar -c 1 4 2>&1',$out,'v')) write $lin write '' write $TOP debug ' Inside PERF module, about to gather memory statistics' write '---+ Memory Statistics' write '---## Using: vmstat -s' call writeCommand('vmstat -s') write $TOP debug ' Inside PERF module, about to gather message and semaphore statistics' write '---+ Message and Semaphore Statistics' write '---## Using: sar -m 1 4 | grep -v ',$OSN write '' loop $lin (grepCommand('sar -m 1 4 2>&1',$out,'v')) write $lin write '' write $TOP =pod Lists running processes information. =cut if ${B_PS} {debug ' Inside PERF module, about to list running processes' prefix {write '---+ List of Running Processes' write '---## Using: ps -aef' } call writeCommand(replace($OSP,'-ef','-aef')) if hasOutput(true) write $TOP } =pod Lists open files. =cut if ${B_LSOF} {debug ' Inside PERF module, about to list of open files' if findCommand('lsof') {var $cmd = last prefix {write '---+ List of Open Files' write '---## Using: lsof -S 2' } if and(isFiltered(),$pat = ${COL.FILTER.DFT_HOST.T_PATTERNS/VP}) {call loadCommand(concat($cmd,' -S 2')) var $buf = getLastBuffer() call $buf->filter('s%R:HOST%DBG_','r',concat('\bs(',$pat,')DBG_')) call writeFile($buf,['C','lsof -S 2']) } else call writeCommand(concat($cmd,' -S 2')) if hasOutput(true) write $TOP } } toc '2:[[',getFile(),'][rda_report][System Performance Overview]]' } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE NET MODULE Determines the F and F command format. =cut elsif compare('eq',$MODULE,'NET') {# Define the ping and ps command format var (undef,\$PING,\$NETSTAT) = @arg var $PING = 'ping -s -v -R %s %d 10' var $NETSTAT = 'netstat' =head2 ifconfig - Interface Configuration Gets the network interface configuration. =head2 aggregation - Link Aggregation Gets the network link aggregation data using the F command. =head2 driver - Driver Configuration Parameters Collects F driver configuration parameters using the F command. =cut collect OS:RCsunos|NET() =head2 tcpip_settings - TCP/IP Settings Gets the TCP/IP settings. =cut debug ' Inside NET module, getting tcp/ip settings (solaris)' report tcpip_settings write '---+ TCP/IP Settings' write '---## Using: ndd' write '' write 'Note: See the actual value settings after the permissions.' write ' They will be listed in name=value pairs.' write loop $key (command('ndd /dev/tcp \?')) {next match($key,'write only') var ($key) = split('\s*\(',$key,2) next compare('eq',$key,'?') next compare('eq',$key,'tcp_status') next match($key,'_hash$') next match($key,'obsoleted') write $key,'=',command(concat('ndd -get /dev/tcp ',quote($key))) } write '' if isCreated() toc '2:[[',getFile(),'][rda_report][TCP/IP Settings]]' =head2 udp_settings - UDP Settings Gets the UDP settings. =cut debug ' Inside NET module, getting udp settings (solaris)' report udp_settings write '---+ UDP Settings' write '---## Using: ndd' write '' write 'Note: See the actual value settings after the permissions.' write ' They will be listed in name=value pairs.' write loop $key (command('ndd /dev/udp \?')) {next match($key,'write only') var ($key) = split('\s*\(',$key,2) next compare('eq',$key,'?') next compare('eq',$key,'udp_status') next match($key,'_hash$') next match($key,'obsoleted') write $key,'=',command(concat('ndd -get /dev/udp ',quote($key))) } write '' if isCreated() toc '2:[[',getFile(),'][rda_report][UDP Settings]]' =for stopwords Multipathing multipathing =head2 mpathd - Multipathing Configuration Gets the network multipathing configuration. =cut debug ' Inside NET module, getting network multipathing configuration \ (solaris)' report mpathd var $fil = '/etc/default/mpathd' prefix {write '---+ Network Multipathing Configuration' write '---## Information Taken from ',encode($fil) } call writeFile($fil) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Multipathing Configuration]]' } =head2 nettr - Trunked Interfaces Gets the network trunked interfaces. =cut debug ' Inside NET module, getting trunked interfaces (solaris)' if ?findCommand('nettr') {var $cmd = concat(last,' -conf') report nettr prefix {write '---+ Network Trunked Interfaces' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Trunked Interfaces]]' } } =head2 send_error - Errors Sending Packets Gets the errors trying to send packets upstream. =cut debug ' Inside NET module, getting errors sending packets (solaris)' report send_error var $cmd = "kstat -p -s '*nocanput*'" prefix {write '---+ Errors Sending Packets' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Errors Sending Packets]]' } =head2 nic_kernel_stats - NIC Kernel Statistics Gets the NIC kernel statistics information. =cut debug ' Inside NET module, getting NIC kernel statistics (solaris)' report nic_kernel_stats loop $lin (grepCommand('ifconfig -a','^\S')) {var $cmd = concat('kstat -n ',quote(field(':',0,$lin))) prefix {if !isCreated() {write '---+!! NIC Kernel Statistics' write $TOC } write '---+ Using: ',encode($cmd) } call writeCommand($cmd) if hasOutput(true) write $TOP } if isCreated() toc '2:[[',getFile(),'][rda_report][NIC Kernel Statistics]]' } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE DEV MODULE Sets up the shared library path for Oracle Forms and Reports. =cut elsif compare('eq',$MODULE,'DEV') {# Setup the shared library path for Forms and Reports var (undef,\$ENV,\$PS_EF) = @arg if and($ora = ${SET.OFM.INIT.D_ORACLE_HOME/P},${CUR.W_SHLIB}) {loop $key (@{CUR.W_SHLIB}) var $ENV->{$key} = join(${RDA.T_SEPARATOR},\ concat($ora,'/network/jre11/lib/sparc/native_threads'),@{SYS.${VAR.key}}) } var $PS_EF = $OSP } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE CRS MODULE =cut elsif compare('eq',$MODULE,'CRS') {import $CRS_HOME var $CLUSTER_DETECTED = false var $CLUSTER_READY = false var $CLUSTER_WARNING = false var $CRS_DETECTED = defined($CRS_HOME) =head2 cluster_status_file - Cluster Status Detects the status of the cluster and verifies that it is up and ready for RAC. Because Oracle Database 10g works with CRS, CRS may be used instead of vendor cluster software. =cut debug ' Inside CRS module, processing Cluster status (solaris)' report cluster_status_file write '---+ Status of the Cluster' prefix write '---++ Verify cluster exists' if ?testFile('f','/usr/cluster/bin/scconf') {# SUN cluster=3X var $CLUSTER_DETECTED = true write 'Cluster has been detected.%BR%' call loadCommand('/usr/cluster/bin/scstat -n') var $cnt = grepLastFile('Cluster node:') var $cup = grepLastFile('Online') if $cup {write 'You have ',$cnt,' cluster members configured and ',\ $cup,' are currently up.' var $CLUSTER_READY = true } else {write 'No members of your cluster are in the UP status.' var $CLUSTER_WARNING = true } } elsif ?testFile('f','/opt/SUNWcluster/bin/get_node_status') {# SUN cluster=2X var $CLUSTER_DETECTED = true write 'Cluster has been detected.%BR%' var $cnt = command("/opt/SUNWcluster/bin/get_node_status | \ grep 'membership:' | awk '{print $NF + 1}'") var $cup = command("/opt/SUNWcluster/bin/get_node_status | \ grep 'membership:' | awk '{print $NF + 1}'") if $cup {write 'You have ',$cnt,' cluster members configured and ',\ $cup,' are currently up.' var $CLUSTER_READY = true } else {write 'No members of your cluster are in the UP status.' var $CLUSTER_WARNING = true } } unprefix write '---++ Real Application Cluster Option Verification' if $CLUSTER_DETECTED {write 'A cluster has been detected.' if $CLUSTER_READY write 'That cluster is up.' else write 'That cluster is not up.' } elsif $CRS_DETECTED write 'An Oracle clusterware has been detected.' else write 'A cluster was not detected.' if $CLUSTER_WARNING write '%BR%A partial cluster has been detected which could cause the RAC \ option problems.' toc '2:[[',getFile(),'][rda_report][Cluster Status]]' =head2 cluster_info - Cluster Information Gets information about the cluster when detected. =cut if $CLUSTER_DETECTED {debug ' Inside CRS module, obtaining cluster information (solaris)' report cluster_info write '---+!! Cluster Information' write $TOC write '---+ Cluster Components' write '---## Using: /usr/cluster/bin/scstat -pv' call writeCommand('/usr/cluster/bin/scstat -pv') write $TOP write '---+ Resource Group Status' write '---## Using: /usr/cluster/bin/scstat -g' call writeCommand('/usr/cluster/bin/scstat -g') write $TOP write '---+ IP Network Multipathing' write '---## Using: /usr/cluster/bin/scstat -i' call writeCommand('/usr/cluster/bin/scstat -i') write $TOP if ?testFile('x','/usr/cluster/bin/interconnect') {write '---+ Interconnect Configuration' write '---## Using: /usr/cluster/bin/interconnect show' call writeCommand('/usr/cluster/bin/interconnect show') write $TOP write '---+ Interconnect Status' write '---## Using: /usr/cluster/bin/interconnect status' call writeCommand('/usr/cluster/bin/interconnect status') write $TOP } if ?testFile('x','/usr/cluster/bin/clnode') {write '---+ Node List' write '---## Using: /usr/cluster/bin/clnode list' call writeCommand('/usr/cluster/bin/clnode list') write $TOP write '---+ Node Information' write '---## Using: /usr/cluster/bin/clnode show' call writeCommand('/usr/cluster/bin/clnode show') write $TOP write '---+ Node Status' write '---## Using: /usr/cluster/bin/clnode status' call writeCommand('/usr/cluster/bin/clnode status') write $TOP } if ?testFile('x','/usr/cluster/bin/hastatus') {write '---+ Cluster Status' write '---## Using: /usr/cluster/bin/hastatus -summary' call writeCommand('/usr/cluster/bin/hastatus -summary') write $TOP } if ?testFile('x','/usr/cluster/bin/lltstat') {write '---+ Veritas Low Level Transport Protocol Statistics' write '---## Using: /usr/cluster/bin/lltstat' call writeCommand('/usr/cluster/bin/lltstat') write $TOP write '---+ Veritas Peer Systems Status' write '---## Using: /usr/cluster/bin/lltstat -nvv' call writeCommand('/usr/cluster/bin/lltstat -nvv') write $TOP } if ?testDir('dr','/opt/VRTSvcs/rac') {write '---+ Veritas Cluster Libraries' var (@dir,$lib) = ('/opt/VRTSvcs/rac/lib','/opt/ORCLcluster/lib') if ?$CRS_HOME call push(@dir,$lib = catDir($CRS_HOME,'lib')) loop $dir (@dir) {if ?testFile('dr',$dir) {write '---## From ',encode($dir) call statFile('b',grepDir($dir,'^libskgx[np]','np')) } } write $TOP prefix write '---+ Link to libodm.so' call statFile('b',grepDir($lib,'^libodm','np')) if hasOutput(true) write $TOP } toc '2:[[',getFile(),'][rda_report][Cluster Information]]' } =head2 cluster_net - Network Looks for network and interconnect settings at the operating system level. =cut debug ' Inside CRS module, looking for network and interconnect settings' report cluster_net write '---+ Network Settings' write '---++ UDP Settings' write '' write 'Current setting for udp_xmit_hiwat is ',\ command('/usr/sbin/ndd -get /dev/udp udp_xmit_hiwat') write 'Current setting for udp_recv_hiwat is ',\ command('/usr/sbin/ndd -get /dev/udp udp_recv_hiwat') write '' toc '2:[[',getFile(),'][rda_report][Network]]' =head2 proc_projid - Process Project Identifiers Get the project identifier from the C background process for the current Oracle system identifier and from the F process. =cut debug ' Inside CRS module, getting process project identifiers (solaris)' report proc_projid prefix {write '---+ Project Identifiers' write '| *Project ID*|*Process*|' } var $cmd = replace($OSP,'-ef','-e -o projid,comm') var $sid = getSid(${SET.DB.DB.T_ORACLE_SID/P},${SET.DB.DB.T_DB_NAME/P}) loop $lin (grepCommand($cmd,\ concat('(\/bin\/ocssd\.bin|\bora_pmon_',$sid,')\b'))) write'| ',replace(trim($lin),'\s+','|'),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Process Project Identifiers]]' # Set the list of operating specific configuration and log files var (undef,\@ini,\@cfg,\@log) = @arg var @ini = ('/etc/inittab',\ '/etc/init.d/init.crs',\ '/etc/init.d/init.crsd',\ '/etc/init.d/init.cssd',\ '/etc/init.d/init.evmd',\ '/etc/init.d/init.ohasd') var @cfg = ('/etc/opt/SUNWcluster/conf/udlm.conf',\ '/etc/cluster/clpl',\ '/etc/cluster/ccr',\ '/etc/nsswitch.conf',\ '/etc/project',\ '/etc/user_attr') var @log = ('/var/adm/messages',\ '/var/cluster/logs/install',\ '/var/cluster/ucmm/ucmm_reconfig.log') } #------------------------------------------------------------------------------ elsif compare('eq',$MODULE,'PS') {# Pass the command format of the ps variants import $PS_ARG,$PS_EF var $PS_ARG = $OSA var $PS_EF = $OSP } #------------------------------------------------------------------------------ # Return a ping command macro ping_command return concat('ping -s -v -R ',quote($arg[0]),' ',nvl($arg[1],56),' 10') =head1 OPERATING SYSTEM COMMANDS USED The main operating system commands used in the data collection include the following: =over 16 =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F (F) =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =back =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.0: Andy Parkman. =item RDA 4.1: Noriyuki Kamei. =item RDA 4.2: Jack Connolly, Roger Snowden. =item RDA 4.9: Tom Holden. =item RDA 4.10: Roberta Librone. =item RDA 4.16: Jaime Alcoreza, Hagen Herbst, Scott Jesse, Rick Pulliam, Sanjay Singh. =item RDA 4.18: Jaime Alcoreza. =item RDA 4.21: Jaime Alcoreza. =item RDA 4.25: Jaime Alcoreza. =item RDA 4.30: Daniel Mortimer. =item RDA 8.06: Hiroki Ata. =item RDA 8.09: Torben Hein. =back =end credits =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