# MCsmb.ctl:214:Collects Samba Information # $Id: MCsmb.ctl,v 1.4 2015/05/29 11:41:06 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCsmb.ctl,v 1.4 2015/05/29 11:41:06 RDA Exp $ # # Change History # 20131126 MSC Improve the documentation. =head1 NAME EXPLORER:MCsmb - Collects Samba Information =head1 DESCRIPTION This module collects information about Samba (on Oracle Solaris 9 and later). =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('smb') #------------------------------------------------------------------------------ # XPLR_smb section #------------------------------------------------------------------------------ section XPLR_smb # Validate the execution context call log_run('Processing SMB sections ...') if !expr('>=',$ver = get_osv(),9) return log_info('The operating system version must be 5.9 or later') pretoc '2:Samba Information' =head2 smb_cmd - Commands Gathers the Samba parameter information using the following commands: =over 2 =item o C =item o C =back =cut debug ' Inside SMB collection, gathering Samba parameters' report smb_cmd title '---+!! Samba Commands' title $TOC call do_exec(['usr/sfw/testparm-s',\ '/usr/sfw/bin/testparm','-s',\ '---+ testparm -s Information'],\ ['usr/sfw/testparm-sv',\ '/usr/sfw/bin/testparm','-sv',\ '---+ testparm -sv Information']) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Commands]]' =head2 smb_config_files - Configuration Files Gathers the C configuration file from either F directory or F directory depending upon the operating system version and patches installed. =cut debug ' Inside SMB collection, gathering configuration files' report smb_config_files prefix {write '---+!! Configuration Files' 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 Path*| *Size*|*Last Modified Date*|' } var $cfg = undef if expr('>',$ver,10) var $cfg = ['etc/samba/smb.conf','/etc/samba/smb.conf'] elsif compare('eq',$arc = get_arc(),'sparc') {if expr('==',$ver,10) {if or(check_patch('146363','01'),check_patch('119757','20')) var $cfg = ['etc/samba/smb.conf','/etc/samba/smb.conf'] else var $cfg = ['etc/sfw/smb.conf','/etc/sfw/smb.conf'] } elsif expr('==',$ver,9) {if !or(check_patch('146363','01'),check_patch('119757','20')) var $cfg = ['etc/sfw/smb.conf','/etc/sfw/smb.conf'] } } elsif compare('eq',$arc,'i386') {if expr('==',$ver,10) {if or(check_patch('146364','01'),check_patch('119757','20')) var $cfg = ['etc/samba/smb.conf','/etc/samba/smb.conf'] else var $cfg = ['etc/sfw/smb.conf','/etc/sfw/smb.conf'] } elsif expr('==',$ver,9) {if !or(check_patch('146364','01'),check_patch('119757','20')) var $cfg = ['etc/sfw/smb.conf','/etc/sfw/smb.conf'] } } if ?$cfg call do_collect_fil($cfg) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Configuration Files]]' } =head2 smb_log_files - Log Files Gathers the log files from the F directory. =cut debug ' Inside SMB collection, gathering log files' report smb_log_files prefix {write '---+!! Log Files' 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 Path*| *Size*|*Last Modified Date*|' } call do_collect_dir('var/samba/log','/var/samba/log') if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Log Files]]' } unpretoc =head1 SEE ALSO 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