# RCunix.ctl: UNIX Specific Code # $Id: RCunix.ctl,v 1.5 2015/08/21 15:35:35 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/RCunix.ctl,v 1.5 2015/08/21 15:35:35 RDA Exp $ # # Change History # 20150821 MSC Improve time consistency. =head1 NAME OS:RCunix - Submodule Specific to other UNIX Operating Systems =cut use Mrc # Make the module persistent var @COMMON_SECTIONS = ('NET_ifconfig','OS_system_error_log') keep $KEEP_BLOCK,@COMMON_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 or F command. =cut section NET_ifconfig if ?nvl(testFile('x',catFile('/usr/sbin/ifconfig')),\ testFile('x',catFile('/sbin/ifconfig'))) {debug ' Inside NET module, getting network interface configuration (UNIX)' report ifconfig prefix {write '---+ Interface Configuration' write '---## Using: ifconfig -a' } call writeCommand(concat(lastCommand(),' -a')) if isCreated(true) {call validate(true) write $TOP toc '2:[[',getFile(),'][rda_report][Interface Configuration]]' } } =head1 CONTRIBUTION TO THE OS.OS MODULE =head2 system_error_log - System Error Log Collects system error log data when found and accessible. =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('/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/log/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} call validate(true) toc '2:[[',getFile(),'][rda_report][System Error Log]]' =begin credits =over 10 =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