# RChpux.ctl: HPUX Specific Multi-run Collection Code # $Id: RChpux.ctl,v 1.5 2015/08/21 15:35:34 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/RChpux.ctl,v 1.5 2015/08/21 15:35:34 RDA Exp $ # # Change History # 20150821 MSC Improve time consistency. =head1 NAME OS:RChpux - Submodule Specific to the HP-UX Operating System =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 and F commands. When F is not available, it collects the information using the F and F commands. =cut section NET_ifconfig debug ' Inside NET module, getting network interface configuration (hpux)' if ?testFile('x','/usr/sbin/ifconfig') {report ifconfig title '---+ Interface Configuration' if ?testFile('x','/usr/sbin/nwmgr') {prefix write '---## Using: nwmgr | cut -d" " -f1 | xargs -n1 ifconfig' call writeCommand('/usr/sbin/nwmgr | \ /usr/bin/cut -d" " -f1 | \ /usr/bin/xargs -n1 /usr/sbin/ifconfig') } elsif ?testFile('x','/usr/sbin/lanscan') {prefix write '---## Using: lanscan -i | cut -d" " -f1 | xargs -n1 ifconfig' call writeCommand('/usr/sbin/lanscan -i | \ /usr/bin/cut -d" " -f1 | \ /usr/bin/xargs -n1 /usr/sbin/ifconfig') } 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. =cut section OS_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/syslog/syslog.log') {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.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