# MCproc.ctl:212:Collects Information on Running Processes # $Id: MCproc.ctl,v 1.5 2014/07/17 12:28:38 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCproc.ctl,v 1.5 2014/07/17 12:28:38 RDA Exp $ # # Change History # 20140710 PRA Add zones documentation. =head1 NAME EXPLORER:MCproc - Collects Information on Running Processes =head1 DESCRIPTION This module collects information on running processes found in the F directory. =cut use Mrc # Initialization var $VALIDATE = true keep $VALIDATE section begin var $ERR = '---## Associated Errors' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' run EXPLORER:XPLRlib('proc') #------------------------------------------------------------------------------ # XPLR_proc section #------------------------------------------------------------------------------ section XPLR_proc # Validate the execution context call log_run('Processing PROC sections ...') pretoc '2:Running Processes from /proc' =head2 proc - Information on Running Processes Gathers information on running processes that do not belong to C class, using the following commands: =over 2 =item o C =item o C =back =cut # Collect information on processes loop $rec (get_zones(false)) {if $loc = defined($nam = $rec->[0]) {var ($ttl,$pre,$exe) = (concat('From Zone ',$nam),\ concat('zones/',$nam),\ concat('/usr/sbin/zlogin ',$nam)) call log_info(concat('proc: RUNNING: zone ',$nam),\ concat(' Inside PROC collection, collecting from zone ',$nam)) } else var ($ttl,$pre,$exe) = ('From Global Zone') var $top = $rec->[1] report concat('proc_z_',nvl($nam,'global')) title '---+!! ',$ttl title $TOC loop $pid (grepDir(catDir($top,'proc'),'^\d+$','nu')) {next !grepCommand(\ join(' ',$exe,'/usr/bin/ps','-p',$pid,'-o class= -o fname='),\ '(^\s+RT\s|\bdtlogin$|\bnskernd$)','v') call do_remote($pre,$exe,$top,\ [concat('proc/pstacks/stack.',$pid),\ '/usr/bin/pstack',$pid,\ concat('---++ Stack Trace for Process ',$pid)],\ [concat('proc/pfiles/files.',$pid),\ '/usr/bin/pfiles',$pid,\ concat('---++ Open Files in Process ',$pid)]) } if isCreated(true) toc '3:[[',getFile(),'][rda_report][',$ttl,']]' } # Adjust the table of content unpretoc =head2 Zones =for zone begin proc By default, collects information from the global zone only. When local zone collections are requested explicitly, collects information on running processes that do not belong to C class, from the selected local zones using the following commands: =over 2 =item o C =item o C =back =for zone end =head1 SEE ALSO L, L, L =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