# MCsmf.ctl:280: Collects Solaris Service Management Facility Information # $Id: MCsmf.ctl,v 1.5 2015/10/12 13:57:30 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCsmf.ctl,v 1.5 2015/10/12 13:57:30 RDA Exp $ # # Change History # 20151007 JGS Enhance version checks. =head1 NAME EXPLORER:MCsmf - Collects Solaris Service Management Facility Information =head1 DESCRIPTION This module collects information about Solaris Service Management Facility (SMF). =cut use Mrc # Initialization var $VALIDATE = true keep $VALIDATE section begin var $ERR = '---## Associated Errors' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' var $WRN = ' * 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.' run EXPLORER:XPLRlib('smfextended') #------------------------------------------------------------------------------ # XPLR_smf section #------------------------------------------------------------------------------ section XPLR_smf # Validate the execution context call log_run('Processing SMF sections ...') if !expr('>=',get_osv(),10) return log_info('The operating system version must be 5.10 or later') pretoc '2:Service Management Facility (SMF)' # Perform the collection loop $rec (get_zones(false)) {if defined($nam = $rec->[0]) var ($ttl,$pre,$exe) = (concat('From Zone ',$nam),\ concat('zones/',$nam),\ concat('/usr/sbin/zlogin ',$nam)) else var ($ttl,$pre,$exe) = ('From Global Zone') var $top = $rec->[1] pretoc '3:',$ttl debug ' Inside SMF collection, collecting from ',nvl($nam,'global'),' zone' =for stopwords Customizations customizations =head2 Administrative Customizations Gathers the administrative customizations present using the C command. =cut if and(compare('VALID',$rec->[2],'5.11'),\ or(compare('VALID',$rec->[2],'5.11.1'),\ expr('>=',\ first(grepCommand(join(' ',$exe,'/usr/bin/pkg list -H entire'),\ '^[^\-]*\-[^\.\-]*\.(\d+)','f1')),\ 169))) {report concat('smf_svc_custom_z_',nvl($nam,'global')) do_remote($pre,$exe,$top,['sysconfig/svccfg-listcust',\ '/usr/sbin/svccfg','listcust',\ '---+ Administrative Customizations']) if isCreated(true) {write $TOP toc '4:[[',getFile(),'][rda_report][Administrative Customizations]]' } } =head2 Service Files Gathers all files from the F, F, and F directories. =cut report concat('smf_svc_files_z_',nvl($nam,'global')) prefix {write '---+!! Service Files' write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_rem($pre,$top,\ ['B','var/svc', '/var/svc', true],\ ['B','lib/svc/manifest','/lib/svc/manifest',true],\ ['B','etc/svc/profile', '/etc/svc/profile', true]) if isCreated(true) {write $TOP toc '4:[[',getFile(),'][rda_report][Service Files]]' } =head2 Log Files Gathers the log files from the F directory. =cut report concat('smf_log_files_z_',nvl($nam,'global')) prefix {write '---+!! Log Files' write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_rem($pre,$top,\ ['B','etc/svc/volatile','/etc/svc/volatile',undef,undef,'\.log$']) if isCreated(true) {write $TOP toc '4:[[',getFile(),'][rda_report][Log Files]]' } # Adjust the table of content unpretoc } # Adjust the table of content unpretoc =head2 Zones =for zone begin smfextended By default, collects information from the global zone only. When local zone collections are requested explicitly, collects the administrative customizations present in the selected local zones using the following command: =over 2 =item o C =back and the following files from the selected local zones: =over 2 =item o F =item o F =item o F =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