# RCsunos.ctl: Solaris Specific Multi-run Collection Code # $Id: RCsunos.ctl,v 1.7 2015/08/21 15:35:35 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/RCsunos.ctl,v 1.7 2015/08/21 15:35:35 RDA Exp $ # # Change History # 20150821 MSC Improve time consistency. =head1 NAME OS:RCsunos - Submodule Specific to the Solaris Operating System =cut use Mrc # Make the module persistent var @COMMON_SECTIONS = ('NET_ifconfig','OS_system_error_log') var @ROOT_SECTIONS = ('NET_aggregation','NET_driver','OS_mpo') keep $KEEP_BLOCK,@COMMON_SECTIONS,@ROOT_SECTIONS # Initialization import $TOC,$TOP keep $TOC,$TOP =head1 CONTRIBUTION TO THE OS.NET MODULE =head2 ifconfig - Interface Configuration Gets the network interface configuration using the F command. =cut section NET_ifconfig if ?testFile('x','/sbin/ifconfig') {debug ' Inside NET module, getting network interface configuration (solaris)' report ifconfig prefix {write '---+ Interface Configuration' write '---## Using: ifconfig -a' } call writeCommand('/sbin/ifconfig -a') if isCreated(true) {call validate(true) write $TOP toc '2:[[',getFile(),'][rda_report][Interface Configuration]]' } } =head2 aggregation - Link Aggregation Gets the network link aggregation data using the F command. =cut section NET_aggregation if ?testFile('x','/usr/sbin/dladm') {debug ' Inside NET module, getting network link aggregation information' macro exec_dladm {var ($ttl,$arg) = @arg import $TOP keep $TOP prefix {write '---++ ',$ttl write '---## Using: dladm ',$arg } call writeCommand(concat('/usr/sbin/dladm ',$arg)) if hasOutput(true) write $TOP } report aggregation title '---+!! Link Aggregation' title $TOC call exec_dladm('Link Aggregation Configuration','show-link') call exec_dladm('Link Aggregation Devices','show-dev') call exec_dladm('Link Aggregation Properties','show-aggr') call exec_dladm('Link Aggregation Link Properties','show-linkprop') if isCreated() {call validate(true) toc '2:[[',getFile(),'][rda_report][Link Aggregation]]' } } =head2 driver - Driver Configuration Parameters Collects F driver configuration parameters using the F command. =cut section NET_driver if ?testFile('x','/usr/sbin/ndd') {debug ' Inside NET module, getting driver configuration parameters (solaris)' macro exec_ndd {var ($ttl,$arg) = @arg import $TOP keep $TOP prefix {write '---++ ',$ttl write '---## Using: ndd -get /dev/hme ',$arg } call writeCommand(concat('/usr/sbin/ndd -get /dev/hme ',$arg)) if hasOutput(true) write $TOP } report driver title '---+!! /dev/hme Driver Configuration Parameters' title $TOC call exec_ndd('Link Status','link_status') call exec_ndd('Link Speed', 'link_speed') call exec_ndd('Link Mode', 'link_mode') if isCreated(true) {call validate(true) toc '2:[[',getFile(),'][rda_report][Driver Configuration Parameters]]' } } =head1 CONTRIBUTION TO THE OS.OS MODULE =head2 mpo - Memory Placement Optimization Collects memory placement optimization information. =cut section OS_mpo debug ' Inside OS module, getting memory placement optimization information' report mpo write '---+!! Memory Placement Optimization' write $TOC write '---+ Number of lgroups' write '---## Using: echo nlgrps/X | mdb -k' call writeCommand('/usr/bin/echo nlgrps/X | /usr/bin/mdb -k') write $TOP write '---+ Default Memory Allocation Policy' write '---## Using: echo lgrp_mem_default_policy/X | mdb -k' call writeCommand('/usr/bin/echo lgrp_mem_default_policy/X | /usr/bin/mdb -k') write $TOP if isCreated(true) {call validate(true) toc '2:[[',getFile(),'][rda_report][Memory Placement Optimization]]' } =head2 system_error_log - System Error Log Collects system error log data. =cut section OS_system_error_log debug ' Inside OS module, getting system error log' report system_error_log write '---+!! System Error Log Data' write $TOC write '---+ Using: dmesg | tail -1000' call loadCommand('/usr/bin/dmesg 2>&1',true,1,-1000) call writeLastFile() write $TOP write '---+ Contents of System Log File' output => d,'system.log' if ?$fil = testFile('fr','/var/adm/messages') {if $lim = ${N_TAIL} write ' * Last ',$lim,' log file lines collected' write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present risks. \ To prevent them, access the file outside the browser or use \ the link to save them and use an adequate viewer.' write '|*File Name*| *Size*|*Last Modified Date*|' if $lim call ${CUR.O_LAST}->write_tail($fil,$lim) else call ${CUR.O_LAST}->write_data($fil) write '|[[',${CUR.O_LAST}->get_raw(true),'][_blank][',encode($fil),']]| ',\ getSize($fil),'|',getLastModify($fil,''),' |' } elsif ?testFile('e',$fil) {write 'Unable to read ',encode($fil),'%BR%\ May be file permission problem.%BR%\ Permissions are:%BR%' call statFile('b',$fil) write 'User: ',id(),'%BR%' } else write $fil,' does not exist%BR%' write $TOP end ${CUR.O_LAST} if isCreated(true) {call validate(true) toc '2:[[',getFile(),'][rda_report][System Error Log]]' } =begin credits =over 10 =item RDA 4.25: Jaime Alcoreza. =item RDA 4.29: Pierre Lecomte. =item RDA 8.01: Pierre Lecomte. =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