# OShpux.ctl: HP-UX Specific Code # $Id: OShpux.ctl,v 1.14 2015/06/15 09:51:27 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/OShpux.ctl,v 1.14 2015/06/15 09:51:27 RDA Exp $ # # Change History # 20150612 KRA Add 'Back to top' link. =head1 NAME OS:OShpux - Submodule Specific to the HP-UX 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 HP-UX version and the F command format. =cut if !$OSV {keep $OS,$OSA,$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 HP-UX version var $OSN = uname('s') var $OSV = substr(uname('r'),2,5) } #------------------------------------------------------------------------------ =head1 CONTRIBUTION TO THE INI MODULE Setting for UNIX95 must be in place to enable the use of C. =cut if compare('eq',$MODULE,'INI') {call setLocalEnv('UNIX95','') } #------------------------------------------------------------------------------ =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 (hpux)' var $bit = 32 if match($OSV,'^11') {var ($str) = command('getconf KERNEL_BITS') if match($str,'^64') var $bit = 64 } # Load the system settings write '|Platform|',$bit,'-bit HPUX|' write '|O/S Version|',$OSV,'|' } =head2 system - System Information Extracts system information such as CPU and memory information. Because this information requires the use of the F command, it is available only when the OS module is collected. Otherwise, only the number of processors is retrieved. =cut elsif compare('eq',$MODULE,'END_system') {prefix write '|*Item*|*Value*|' debug ' Inside END module, getting CPU information (hpux)' if @rec = @{SET.OS.OS.T_CFG_CPU} {var $rec[0] = concat($rec[0],' Processor(s) Installed') write '|Processor(s)|',join('%BR%',@rec),'|' } elsif grepCommand('ioscan -fnkC processor','PROCESSOR') {var $cnt = last write '|Processor(s)|',$cnt,' Processor(s) Installed|' } debug ' Inside END module, getting memory information (hpux)' if ${SET.OS.OS.N_CFG_MEMORY} write '|Total Physical Memory|',last,' MiB|' debug ' Inside END module, getting swap information (hpux)' if grepCommand('swapinfo -tm','^total','f') {var (undef,$tot,$use,$fre) = split('\s+',last,5) write '|Swap: Max Size|',$tot,' MiB|' write '|Swap: Available|',$fre,' MiB|' write '|Swap: In Use|',$use,' MiB|' } 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 (hpux)' report cpu_info var $cmd = 'ioscan -fnkC processor' write '---+ CPU Information' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '2:[[',getFile(),'][rda_report][CPUs]]' =head2 memory_info - Memory Gets information about the physical memory. This is subject to the availability of the F command (cf. licensing aspects) or the F command. =cut debug ' Inside OS module, about physical memory (hpux)' report memory_info write '---+ Physical Memory Installed' write 'Physical Memory is not easily gathered on this platform with a simple \ command. Review documentation on the [[http://docs.hp.com//\ hpux/onlinedocs/diag/stm/sto_summ.htm][_blank][Support Tools Manager]] \ product to learn how to determine physical memory on HP.' toc '2:[[',getFile(),'][rda_report][Memory]]' var $mem = undef suspend memory_info =head2 disk_info - Disk Drives Gets information about the disks. =cut debug ' Inside OS module, about disks (hpux)' 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' if !writeCommand('swapinfo -m') call writeCommand('sar -w 2 2') write $TOP prefix write '---+ Logical Volumes' loop $pth (grepCommand('/usr/sbin/vgdisplay -v','^\s*LV\s+Name\s')) {var $pth = field('\s+',2,$pth) write '---++ Logical Volume ',$pth call writeCommand(concat('/usr/sbin/lvdisplay -v ',quote($pth))) write $TOP } unprefix 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' call writeCommand('ipcs -sa') write $TOP write '---+ Shared Memory' call writeCommand('ipcs -ma') write $TOP toc '2:[[',getFile(),'][rda_report][Kernel Tables and IPC]]' =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 (hpux)' report ntp var $ttl = '---+!! NTP Status, Process, and Configuration Information' # Get the NTP status if ?findCommand('ntpq') {var $cmd = concat(last,' -p') prefix {if !isCreated() {write $ttl write $TOC } 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 {if !isCreated() {write $ttl write $TOC } write '---+ NTP Process' write '' } loop $lin (grepCommand($OSP,'ntp')) write $lin if hasOutput(true) {write '' write $TOP } # Get the NTP configuration file prefix {if !isCreated() {write $ttl write $TOC } write '---+ NTP Configuration' write '---## Information Taken from /etc/ntp.conf' } call writeFile('/etc/ntp.conf') if hasOutput(true) write $TOP if isCreated() toc '2:[[',getFile(),'][rda_report][NTP Status and Configuration]]' =head2 packages - Operating System Packages Lists all operating system packages. =cut debug ' Inside OS module, getting operating system package information (hpux)' report packages var $cmd = 'swlist -lbundle' 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. Release 11.0 uses F to show revisions, while 10.20 uses F. =cut debug ' Inside OS module, getting operating system patches (hpux)' report patches if match($OSV,'^11') var $cmd = '/usr/contrib/bin/show_patches' else var $cmd = 'swlist -lproduct PH\*' write '---+ Operating System Patches Information' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '2:[[',getFile(),'][rda_report][Operating System Patches]]' =head2 sysdef - System/Kernel Settings Gets the system/kernel settings. This is subject to the availability of the F command (cf. licensing aspects). =cut debug ' Inside OS module, getting system/kernel settings (hpux)' report sysdef write '---+!! Display of System/Kernel Settings' write $TOC write '---+ Main Kernel Parameters' write '|*Parameter*| *Value*|*Source*|' macro wrt_rpt {var ($src,$nam) = @arg var $val = field('\s+',1,grepLastFile(concat('^',$nam,'\s'),'f')) write '|',$nam,'| ',$val,'|',encode($src),'|' } var $src = check($OSV,'^11',cond(testFile('x','/usr/sbin/kctune'),\ '/usr/sbin/kctune',\ '/usr/sbin/kmtune'),\ '/usr/sbin/sysdef') if loadCommand($src) {call wrt_rpt($src,'executable_stack') call wrt_rpt($src,'ksi_alloc_max') call wrt_rpt($src,'max_thread_proc') call wrt_rpt($src,'maxdsiz') call wrt_rpt($src,'maxdsiz_64bit') call wrt_rpt($src,'maxfiles') call wrt_rpt($src,'maxfiles_lim') call wrt_rpt($src,'maxssiz') call wrt_rpt($src,'maxssiz_64bit') call wrt_rpt($src,'maxswapchunks') call wrt_rpt($src,'maxuprc') call wrt_rpt($src,'maxusers') call wrt_rpt($src,'msgmap') call wrt_rpt($src,'msgmni') call wrt_rpt($src,'msgseg') call wrt_rpt($src,'msgtql') call wrt_rpt($src,'ncallout') call wrt_rpt($src,'ncsize') call wrt_rpt($src,'nfile') call wrt_rpt($src,'nflocks') call wrt_rpt($src,'ninode') call wrt_rpt($src,'nkthread') call wrt_rpt($src,'nproc') call wrt_rpt($src,'semmap') call wrt_rpt($src,'semmni') call wrt_rpt($src,'semmns') call wrt_rpt($src,'semmnu') call wrt_rpt($src,'semvmx') call wrt_rpt($src,'shmmax') call wrt_rpt($src,'shmmni') call wrt_rpt($src,'shmseg') call wrt_rpt($src,'tcp_conn_request_max') call wrt_rpt($src,'vps_ceiling') write $TOP if !match($OSV,'^11') {write '---+ Kernel Settings' write '---++ Using: ',$src call writeLastFile() } } if match($OSV,'^11') {var $cmd = cond(testFile('x','/usr/sbin/kctune'),'/usr/sbin/kctune -v',\ '/usr/sbin/kmtune -l') write '---+ Kernel Settings' write '---++ Using: ',encode($cmd) call writeCommand($cmd) } write $TOP toc '2:[[',getFile(),'][rda_report][System/Kernel Settings]]' var $cmd = 'echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm' write '---++ Using: ',encode($cmd) if ${B_NO_CSTM} {write 'The cstm command usage has been disabled at data collection setup.%BR%' write $TOP } elsif loadCommand($cmd) {call writeLastFile() write $TOP # Extract CPU information if grepLastFile('Number of CPUs in .*\s*=\s*\d+','f') {var ($off,@rec) = (0,value(last)) loop $lin (grepLastFile('CPU Module')) {incr $off break expr('>',$off,$rec[0]) var $rec[$off] = trim(replace($lin,'CPU Module.*$')) } var @{T_CFG_CPU:'CPU Information'} = @rec } # Extract memory information from cstm results resume memory_info prefix {var $cmd = 'echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm' write '---## Using: ',encode($cmd),' | grep "Total Configured Memory"' write '' } loop $lin (grepLastFile('Total Configured Memory')) {write $lin if match($lin,'Total Configured Memory\s*\:\s*(\d+)\s*MB') {var ($siz) = (last) incr $mem,$siz } } if hasOutput(true) {write '' write $TOP if ?$mem var ${N_CFG_MEMORY:'Total Physical Memory (in MiB)'} = $mem } suspend memory_info } else {write 'cstm is probably not available in the system or did not respond \ within 30 seconds.%BR%' write $TOP } =for stopwords sqmax =head2 streams_sqmax - streams_sqmax Parameter Displays the C parameter value. =cut debug ' Inside OS module, getting streams_sqmax paramter (hpux)' report streams_sqmax var $cmd = 'echo "streams_sqmax/d" | adb /stand/vmunix /dev/kmem' prefix {write '---+ streams_sqmax Parameter' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][streams_sqmax Parameter]]' } =head2 machinfo - Machine Information Displays the machine information. =cut debug ' Inside OS module, getting machine information (hpux)' report machinfo if ?findCommand('machinfo') var $cmd = last elsif ?testFile('x','/usr/contrib/bin/machinfo') var $cmd = '/usr/contrib/bin/machinfo' else var $cmd = undef if $cmd {prefix {write '---+ Machine Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Machine Information]]' # Extract memory information from machinfo, if not already found if !?$mem {if grepFile(getFile('/'),'Memory\s*[=:]\s*(\d+)\s*MB','f1') {var ($mem) = last resume memory_info write '---## Using: ',$cmd,' | grep "Memory"' write '' write 'Total Physical Configured Memory: ',$mem,' MiB' write '' write $TOP var ${N_CFG_MEMORY:'Total Physical Memory (in MiB)'} = $mem suspend memory_info } } } } if !?$mem {resume memory_info write 'cstm is probably not available in the system or did not respond \ within 30 seconds.%BR%' write $TOP } =head2 system_error_log - System Error Log Collects system error log data. =cut collect OS:RChpux|OS() =pod Identifies useful platform-related links. =cut var \@LINKS = $arg[1] var @LINKS = ('http://www.itrc.hp.com/service/home/hpMaint.do?\ admit=109447627+1203490362191+28353475',\ 'http://www.itrc.hp.com/service/patch/mainPage.do',\ 'http://docs.hp.com/') } #------------------------------------------------------------------------------ =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 Get 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 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 IO, 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 system throughput (takes 30 sec)' write '---+ Throughput MiB/sec, Transfers/sec, avg Service Time milliseconds' write '---## Using: iostat 10 3' call writeCommand('iostat 10 3') write $TOP debug ' Inside PERF module, about to gather swapping activity' write '---+ Swap Activities' prefix write '---## Using: swapinfo -m' if writeCommand('swapinfo -m') {unprefix write '---## Using: swapinfo -t' call writeCommand('swapinfo -t') } else {unprefix write '---## Using: sar -w 2 2' call writeCommand('sar -w 2 2') } write $TOP =pod Gets a system overview in terms of CPU usage, top processes, system calls, memory, messages, and semaphores statistics. =cut var $out = verbatim($OSN) 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' write '---## Using: /usr/bin/top -s 1 -d 1 -n 40' var $fil = getTemp('top') if loadCommand(concat('/usr/bin/top -s 1 -d 1 -n 40 -f ',$fil),true,$FACTOR) call writeFile($fil) call unlinkTemp('top') 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 command format. =cut elsif compare('eq',$MODULE,'NET') {# usage: ping [-oprv] [-i address] [-t ttl] host [-n count] # ping [-oprv] [-i address] [-t ttl] host packet-size [[-n] count] # -o records the route.. var (undef,\$PING,\$NETSTAT) = @arg var $PING = 'ping -o %s %d 10' var $NETSTAT = 'netstat' =head2 ifconfig - Interface Configuration Gets the network interface configuration. =cut collect OS:RChpux|NET() =head2 tcpip_settings - TCP/IP Settings Gets the TCP/IP settings. =cut debug ' Inside NET module, getting tcp/ip settings (hpux)' report tcpip_settings if match($OSV,'^11') {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))) } } else {var $cmd = '/usr/contrib/bin/nettune -l' write '---+ TCP/IP Settings' write '---## Using: ',encode($cmd) write '' loop $lin (command($cmd)) {next match($lin,'tcpstatus') next match($lin,'tcp_bind_hash') next match($lin,'tcp_listen_hash') next match($lin,'tcp_queue_hash') write $lin } if status() {write 'Could not get tcp/ip settings.' write 'Probable permission problem.' } } 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 (hpux)' report udp_settings if match($OSV,'^11') {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))) } } else {var $fil = '/opt/clic/lib/skgxp/skclic.conf' if !?testFile('f',$fil) {write '---+ UDP Settings' write encode($fil),' does not exist. UDP apparently not installed.' } elsif !?testFile('r',$fil) {write '---+ UDP Settings' write encode($fil),' not readable.' } else {var ($cmd) = command('cat /opt/clic/lib/skgxp/skclic.conf') write '---+ UDP Settings' write '---## Using: ',encode($cmd) write '' loop $lin (command(quote($cmd))) {next match($lin,'tcpstatus') next match($lin,'tcp_bind_hash') next match($lin,'tcp_listen_hash') next match($lin,'tcp_queue_hash') write $lin } write '' } } if isCreated() toc '2:[[',getFile(),'][rda_report][UDP Settings]]' =head2 net_summary - Network Device Summary Gets the Network Device Summary Information. =cut debug ' Inside NET module, getting network device summary information (hpux)' report net_summary title '---+!! Network Device Summary Information' title $TOC var @dev = () if ?testFile('x','/usr/sbin/nwmgr') {var $pgm = '/usr/sbin/nwmgr' prefix write '---++ Using: ',$pgm call loadCommand($pgm) call writeLastFile() if hasOutput(true) write $TOP # Get the names corresponding to each device loop $lin (getLines()) call push(@dev,field('\s+',0,$lin)) # Report device information title '---++ Device Information' loop $dev (@dev) {var $cmd = concat($pgm,' -c ',quote($dev)) prefix write '---+++ Using: ',$cmd call writeCommand($cmd) if hasOutput(true) write $TOP } } elsif ?testFile('x','/usr/sbin/lanscan') {var $pgm = '/usr/sbin/lanscan' prefix write '---++ Using: ',$pgm call loadCommand($pgm) call writeLastFile() if hasOutput(true) write $TOP # Get the identifiers corresponding to each device loop $lin (getLines()) {var $dev = field('\s+',2,$lin) if match($dev,'^\d+$') call push(@dev,$dev) } # Report device overview var $cmd = concat($pgm,' -v') prefix write '---++ Using: ',$cmd call writeCommand($cmd) if hasOutput(true) write $TOP # Report device information title '---++ Device Information' loop $dev (@dev) {var $cmd = concat('/usr/sbin/lanadmin -x ',quote($dev)) prefix write '---+++!! Using: ',$cmd call writeCommand($cmd) if hasOutput(true) write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Network Device Summary]]' =head2 net_statistics - Network Device Statistics Gets the network device statistics information. =cut if ?testFile('x','/usr/sbin/lanadmin') {debug ' Inside NET module, getting network device statistics (hpux)' report net_statistics title '---+!! Network Device Statistics Information' title $TOC loop $dev (@dev) {var $cmd = concat('/usr/sbin/lanadmin -g mibstats_ext ',\ quote(replace($dev,'^lan'))) prefix write '---++ Using: ',encode($cmd) call writeCommand($cmd) if hasOutput(true) write $TOP } if isCreated() toc '2:[[',getFile(),'][rda_report][Network Device Statistics]]' } =head2 clicstat - HyperFabric Component Information Collects HyperFabric component information. =cut if ?testFile('fx','/opt/clic/bin/clic_stat') {debug ' Inside NET module, getting HyperFabric component information (hpux)' report clicstat write '---+!! HyperFabric Component Information' write $TOC write '---+ HyperFabric Component Information' write '---## Using: /opt/clic/bin/clic_stat' call writeCommand('/opt/clic/bin/clic_stat') write $TOP write '---+ Fabric Component Statistics' write '---## Using: /opt/clic/bin/clic_stat -d NET' call writeCommand('/opt/clic/bin/clic_stat -d NET') write $TOP loop $lin (grepCommand('/opt/clic/bin/clic_stat -d VRID','^\s*Adapter\s*:')) {var (undef,$nam) = split(':',$lin,2) var $nam = trim($nam) write '---+ Statistics for adapter ID ',$nam write '---## Using: /opt/clic/bin/clic_stat -c ',$nam call writeCommand(concat('/opt/clic/bin/clic_stat -c ',quote($nam))) write $TOP } toc '2:[[',getFile(),'][rda_report][HyperFabric Component Information]]' } } #------------------------------------------------------------------------------ =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/PA_RISC/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 (hpux)' report cluster_status_file write '---+ Status of the Cluster' prefix write '---++ Verify cluster exists' if ?testFile('f','/usr/sbin/cmviewcl') {var $CLUSTER_DETECTED = true call loadCommand('/usr/sbin/cmviewcl') var ($sta) = getLines(2,2) var $sta = field('\s+',1,$sta) if compare('ne',$sta,'up') write 'Cluster is not up.' else {var $cnt = grepLastFile('\bup\b','',undef,4) write 'Cluster has been detected.%BR%' if $cnt {write 'You have a cluster and ',$cnt,' cluster members are up.' var $CLUSTER_READY = true } else var $CLUSTER_WARNING = true } } else write 'Cluster administration files are not present.' 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_net - Network Looks for network and interconnect settings at the operating system level. =cut debug ' Inside CRS module, looking for network and interconnect settings \ (hpux)' report cluster_net write '---+ Network Settings' write '---++ UDP Settings' write $OSN,' does not allow the user to change the UDP buffer settings.%BR%' if ?testFile('f','/opt/clic/lib/skgxp/skclic.conf') call writeFile('/opt/clic/lib/skgxp/skclic.conf') else write '**There is no skclic.conf file found for HMP configuration**.%BR%' toc '2:[[',getFile(),'][rda_report][Network]]' =head2 sg_libs - Service Guard Shared Libraries Lists Service Guard shared libraries. =cut debug ' Inside CRS module, listing Service Guard shared libraries (hpux)' report sg_libs title '---+!! Service Guard Shared Libraries' title $TOC loop $dir ('/opt/nmapi/nmapi2/lib',\ '/opt/nmapi/nmapi2/lib/pa20_64',\ '/opt/nmapi/nmapi2/lib/hpux32/lib',\ '/opt/nmapi/nmapi2/lib/hpux64/lib') {prefix write '---+ From ',$dir call statDir('n',$dir) if hasOutput(true) write $TOP } if isCreated() toc '2:[[',getFile(),'][rda_report][Service Guard Shared Libraries]]' # Set the list of operating specific configuration and log files var (undef,\@ini,\@cfg,\@log) = @arg var @ini = ('/etc/inittab',\ '/sbin/init.d/init.crs',\ '/sbin/init.d/init.crsd',\ '/sbin/init.d/init.cssd',\ '/sbin/init.d/init.evmd',\ '/sbin/init.d/init.ohasd') var @cfg = ('/etc/cmcluster/cmclconfig',\ '/etc/cmcluster/cmclconfig.ascii',\ '/etc/cmcluster/cmclnodelist',\ '/etc/cmcluster/cmcluster.config',\ '/etc/nsswitch.conf') var @log = ('/var/adm/syslog/syslog.log',\ '/var/adm/clic_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 -o ',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 (with license availability limitations) =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 (on HP-UX 11.*) =item o F (on HP-UX 11.*) =item o F =item o F =item o F =item o F =item o F =item o F =item o F (on HP-UX 11.*) =item o F =item o F (on HP-UX 10.*) =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F (on HP-UX 11.*) =item o F =item o F =item o F (on HP-UX 10.*) =item o F (on HP-UX 10.*) =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.2: Roger Snowden. =item RDA 4.9: Tom Holden. =item RDA 4.16: Jaime Alcoreza, Hagen Herbst, Scott Jesse, Rick Pulliam, Sanjay Singh. =item RDA 4.18: Jaime Alcoreza. =item RDA 4.19: Jaime Alcoreza. =item RDA 4.23: 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