# MCetc.ctl:285: Collects /etc Configuration Files # $Id: MCetc.ctl,v 1.10 2014/10/15 17:03:50 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCetc.ctl,v 1.10 2014/10/15 17:03:50 RDA Exp $ # # Change History # 20141015 LDE Improve portability. =head1 NAME EXPLORER:MCetc - Collects /etc Related Information and Configuration Files =head1 DESCRIPTION This module collects information from 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('etc') #------------------------------------------------------------------------------ # XPLR_etc section #------------------------------------------------------------------------------ section XPLR_etc # Validate the execution context call log_run('Processing ETC sections ...') =head2 etc - /etc directory related information Gathers /etc information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =back Also collects the following configuration files: =over 2 =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F<${ROOT_HOME}/.cshrc> =item o F<${ROOT_HOME}/.dtprofile> =item o F<${ROOT_HOME}/.kshrc> =item o F<${ROOT_HOME}/.login> =item o F<${ROOT_HOME}/.logout> =item o F<${ROOT_HOME}/.profile> =back =cut debug ' Inside ETC collection, gathering /etc related files and commands' pretoc '2:/etc' # List the files to collect in the different zones var $hom = field(':',5,grepFile('/etc/passwd','^root:','f')) var $etc = ${RUN.EXPLORER.D_ETC:'/etc/explorer'} var @fil = (\ ['B','etc/auto_master', '/etc/auto_master'],\ ['G','etc/bootparams', '/etc/bootparams'],\ ['B','etc/cfg/fp', '/etc/cfg/fp','','','^\.+$','nv'],\ ['B','etc/coreadm.conf', '/etc/coreadm.conf'],\ ['G','etc/cpudiagd.conf', '/etc/cpudiagd.conf'],\ ['B','etc/default', '/etc/default','','','^\.+$','nv'],\ ['B','etc/defaultdomain', '/etc/defaultdomain'],\ ['B','etc/defaultrouter', '/etc/defaultrouter'],\ ['G','etc/devices/retire_store', '/etc/devices/retire_store',true],\ ['G','etc/dfstab', '/etc/dfs/dfstab'],\ ['G','etc/sharetab', '/etc/dfs/sharetab'],\ ['G','etc/driver/drv', '/etc/driver/drv'],\ ['G','etc/driver_aliases', '/etc/driver_aliases'],\ ['G','etc/driver_classes', '/etc/driver_classes'],\ ['B','etc/dt/config', '/etc/dt/config','','','^\.+$','nv'],\ ['G','etc/dumpadm.conf', '/etc/dumpadm.conf'],\ ['B','etc/dumpdates', '/etc/dumpdates'],\ ['B','etc/ethers', '/etc/ethers'],\ ['B','etc/fcswitch.conf', '/etc/fcswitch.conf'],\ ['G','etc', '/etc','','','^hostname\.','n'],\ ['G','etc', '/etc','','','^hostname6\.','n'],\ ['B','etc/hba.conf', '/etc/hba.conf'],\ ['B','etc/hosts', '/etc/hosts'],\ ['G','etc/ibmatl.conf', '/etc/ibmatl.conf'],\ ['B','etc/inet/ipnodes', '/etc/inet/ipnodes'],\ ['G','etc/inet/ipsecinit.conf', '/etc/inet/ipsecinit.conf'],\ ['G','etc/inet/ipsecpolicy.conf','/etc/inet/ipsecpolicy.conf'],\ ['G','etc/inet/ndpd.conf', '/etc/inet/ndpd.conf'],\ ['B','etc/inet/netmasks', '/etc/inet/netmasks'],\ ['B','etc/inet/networks', '/etc/inet/networks'],\ ['G','etc/inet/ntp.client', '/etc/inet/ntp.client'],\ ['G','etc/inet/ntp.conf', '/etc/inet/ntp.conf'],\ ['G','etc/inet/ntp.server', '/etc/inet/ntp.server'],\ ['B','etc/inetd.conf', '/etc/inetd.conf'],\ ['B','etc/init.d/sysetup', '/etc/init.d/sysetup'],\ ['B','etc/inittab', '/etc/inittab'],\ ['B','etc/lu', '/etc/lu','','','^\.+$','nv'],\ ['B','etc/mnttab', '/etc/mnttab'],\ ['G','etc/name_to_major', '/etc/name_to_major'],\ ['G','etc/netconfig', '/etc/netconfig'],\ ['B','etc/nodename', '/etc/nodename'],\ ['G','etc/notrouter', '/etc/notrouter'],\ ['B','etc/nscd.conf', '/etc/nscd.conf'],\ ['B','etc/nsswitch.conf', '/etc/nsswitch.conf'],\ ['G','etc/openwin/server/etc/OWconfig','/etc/openwin/server/etc/OWconfig'],\ ['G','etc/opt/SUNWexplo', $etc,'','','(input\.txt|\.pre_SUNWexplu)$'],\ ['G','etc/opt/SUNWexplo/sunone', catDir($etc,'/sunone'),'','','^\.+$','nv'],\ ['B','etc/pam.conf', '/etc/pam.conf'],\ ['B','etc/pam.d', '/etc/pam.d','','','^\.+$','nv'],\ ['B','etc/patch', '/etc/patch','','','^\.+$','nv'],\ ['G','etc/path_to_inst', '/etc/path_to_inst'],\ ['G','etc/pooladm.conf', '/etc/pooladm.conf'],\ ['G','etc/power.conf', '/etc/power.conf'],\ ['G','etc/shells/etc_profile', '/etc/profile'],\ ['B','etc/project', '/etc/project'],\ ['B','etc/release', '/etc/release'],\ ['B','etc/resolv.conf', '/etc/resolv.conf'],\ ['B','etc/rmmount.conf', '/etc/rmmount.conf'],\ ['B','etc/rpc', '/etc/rpc'],\ ['B','etc/services', '/etc/services'],\ ['B','etc/shells/shells', '/etc/shells'],\ ['G','etc/shells/cshrc', catFile($hom,'.cshrc')],\ ['G','etc/shells/dtprofile', catFile($hom,'.dtprofile')],\ ['G','etc/shells/kshrc', catFile($hom,'.kshrc')],\ ['G','etc/shells/login', catFile($hom,'.login')],\ ['G','etc/shells/logout', catFile($hom,'.logout')],\ ['G','etc/shells/profile', catFile($hom,'.profile')],\ ['B','etc/ssh/sshd_config', '/etc/ssh/sshd_config'],\ ['B','etc/ssh/ssh_config', '/etc/ssh/ssh_config'],\ ['G','etc/ssphostname', '/etc/ssphostname'],\ ['B','etc/syslog.conf', '/etc/syslog.conf'],\ ['G','etc/system', '/etc/system'],\ ['B','etc/TIMEZONE', '/etc/TIMEZONE'],\ ['B','etc/user_attr', '/etc/user_attr'],\ ['B','etc/vfstab', '/etc/vfstab'],\ ['G','etc/X11/xorg.conf', '/etc/X11/xorg.conf'],\ ['G','etc/zones', '/etc/zones','','','^\.+$','drv'],\ ['G','var/inet', '/var/inet','','','^ndpd_state\.','n']) # Perform the collections 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('etc: RUNNING: zone ',$nam),\ concat(' Inside ETC collection, collecting from zone ',$nam)) } else var ($ttl,$pre,$exe) = ('From Global Zone') var $top = $rec->[1] report concat('etc_z_',nvl($nam,'global')) title '---+!! ',$ttl title $TOC # Collect the command outputs var @cmd = () if !$loc {call push(@cmd,\ ['etc/inet/ike/ls_-l_config',\ ${CMD.LS:'ls'},'-l /etc/inet/ike/config',\ '---+ Files on /etc/inet/ike/config']) if compare('VALID',$rec->[2],'5.11') call push(@cmd,\ '---+ Fibre Channel information',\ ['etc/fcadm_list-fcoe-ports',\ '/usr/sbin/fcadm','list-fcoe-ports',\ '---++ Fibre Channel Ports'],\ ['etc/fcinfo_logical-unit_-v',\ '/usr/sbin/fcinfo','logical-unit -v',\ '---++ Fibre Channel Logical Units']) } if ?testFile('x',catFile($top,'usr','sbin','svccfg')) {call push(@cmd,\ '---+ Core and Dump Information',\ ['etc/svccfg_s_coreadm_listprop',\ '/usr/sbin/svccfg','-s coreadm:default listprop config_params/*',\ '---++ Coreadm Information'],\ ['etc/svccfg_s_dumpadm_listprop',\ '/usr/sbin/svccfg','-s dumpadm:default listprop config_params/*',\ '---++ Dumpadm Information']) } call do_remote($pre,$exe,$top,@cmd) # Collect the 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*|' } call do_collect_rem($pre,$top,@fil) if hasOutput(true) write $TOP # Add the report to the table of content if isCreated(true) toc '3:[[',getFile(),'][rda_report][',$ttl,']]' } unpretoc =head2 Zones =for zone begin etc By default, collects information from the global zone only. When local zone collections are requested explicitly, collects /etc directory related information from the selected local zones using the following commands: =over 2 =item o C =item o C =back and the following configuration files from the selected local zones: =over 2 =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =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