# MCptch.ctl:205:Collects Installed Patches Information # $Id: MCptch.ctl,v 1.6 2014/11/07 18:38:29 RDA Exp $ # ARCS:$Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCptch.ctl,v 1.6 2014/11/07 18:38:29 RDA Exp $ # # Change History # 20141106 PRA Add commands documentation. =head1 NAME EXPLORER:MCptch - Collects Installed Patches Information =head1 DESCRIPTION This module collects information about installed patches. =cut use Mrc # Initialization var @COMMON_SECTIONS=('XPLR_all') var $VALIDATE = true keep $VALIDATE,@COMMON_SECTIONS section begin var $ERR = '---## Associated Errors' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' run EXPLORER:XPLRlib('patch') # ----------------------------------------------------------------------------- # XPLR_patch section # ----------------------------------------------------------------------------- section XPLR_patch # Validate the execution context if !${OS.solaris} return call log_run('Processing PTCH sections ...') =head2 Installed Patches Information Gathers information about the patches installed using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =back =cut pretoc '2:Installed Patches' # Perform the collection loop $rec (get_zones(true)) {if defined($nam = $rec->[0]) {var ($ttl,$pre,$exe) = (concat('From Zone ',$nam),\ concat('zones/',$nam),\ concat('/usr/sbin/zlogin ',$nam)) call log_info(concat('patch: RUNNING: zone ',$nam),\ concat(' Inside PTCH collection, collecting from zone ',$nam,\ ' (can take time)')) } else var ($nam,$ttl,$pre,$exe) = ('global','From Global Zone') var $top = $rec->[1] # Determine what to collect var ($cmd,@cmd,%tbl) = () if ?testFile('f',catFile($top,'/usr/bin/showrev')) {call push(@cmd,\ ['patch+pkg/showrev',\ '/usr/bin/showrev',undef,\ '---+ Machine and Software Revision'],\ ['patch+pkg/showrev-p',\ '/usr/bin/showrev','-p',\ '---+ Applied Patches']) var $cmd = join(' ',$exe,'/usr/bin/showrev -p') } elsif ?testFile('f',catFile($top,'/usr/sbin/patchadd')) {call push(@cmd,\ ['patch+pkg/patchadd-p',\ '/usr/sbin/patchadd','-p',\ '---+ Applied Patches']) var $cmd = join(' ',$exe,'/usr/sbin/patchadd -p') } # Get the patch list if ?$cmd {loop $ptc (grepCommand($cmd,'^Patch\S*\s+(\S+)','1')) var $tbl{$ptc} = $ptc call push(@cmd,\ {cmd => 'HASH',\ nam => 'patch+pkg/patch-list',\ tbl => \%tbl,\ ttl => '---+ Patch List'}) } # Add the directory listings if ?testFile('d',catFile($top,'/var/sadm/patch')) call push(@cmd,\ ['patch+pkg/patch_date',\ '/usr/bin/ls','-l /var/sadm/patch',\ '---+ Contents of /var/sadm/patch Directory'],\ ['patch+pkg/patch_listing',\ '/usr/bin/ls','-almtr /var/sadm/patch',\ '---+ Detailed Contents of /var/sadm/patch Directory',true]) # Produce the report if @cmd {report concat('ptch_z_',$nam) title '---+!! ',$ttl title $TOC call do_remote($pre,$exe,$top,@cmd) if isCreated(true) toc '3:[[',getFile(),'][rda_report][',$ttl,']]' } } # Adjust the table of content unpretoc =head2 Zones =for zone begin patch Collects information about the patches installed in the global zone. Unless local zone collections are disabled, collects information about the patches installed in the selected local zones. =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