# M270NBU.def: Collects NetBackup Information # $Id: M270NBU.def,v 1.2 2012/08/17 14:24:18 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/M270NBU.def,v 1.2 2012/08/17 14:24:18 mschenke Exp $ # # Change History # 20120817 JGS Report nbsu files. =head1 NAME M270NBU - Collects NetBackup Information =head1 DESCRIPTION This module collects information about NetBackup product. =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 XPLRlib('nbu') #------------------------------------------------------------------------------ # XPLR_nbu section #------------------------------------------------------------------------------ section XPLR_nbu # Validate the execution context if !${XPLR_GLOBAL:true} return call log_run('Processing NBU sections ...') if !testDir('d','/usr/openv') return log_info('NetBackup not installed') =head2 nbu - NetBackup Gathers NetBackup information collecting the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back Collects the following related 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 =back =cut debug ' Inside NBU collection, gathering NetBackup information' # Determine the commands and files to collect var (@cmd,@fil) = ({cmd => 'TITLE',txt => '---+ NetBackup Information'}) var %lnk = () if is_pkg_installed('SYMCnetbp') {call push(@cmd,\ {cmd => 'COMMENT',nam => 'nbu/cmd/SYMCnetbp', txt => ''},\ ['nbu/cmd/support.txt',\ '/usr/openv/netbackup/bin/goodies/support/support',undef,\ '---++ NetBackup Data Collection Tool',true]) # Get a sandbox directory to capture nbsu output command var $box = cleanBox() var $job = createTemp('NBU','.sh',true) call writeTemp('NBU','cd "',$box,'"') call writeTemp('NBU','/usr/openv/netbackup/bin/support/nbsu -nozip -t') call closeTemp('NBU') var @ret = command(quote($job,'x')) call unlinkTemp('NBU') var (undef,$dir) = split('\s+',pop(@ret),3) var ($dir,@ret) = (catDir($box,$dir)) # Extract tar files at the right place. No -C available on Solaris tar cmd var $job = createTemp('TAR','.sh',true) call writeTemp('TAR','cd "',$dir,'"') call writeTemp('TAR','/usr/sbin/tar -xf *.tar >/dev/null 2>&1') call closeTemp('TAR') call command(quote($job,'x')) call unlinkTemp('TAR') # Collect all the *.txt files generated by the nbsu command loop $fil (grepDir($dir,'.*\.txt$','n')) var ($lnk{$fil}) = collectFile(concat('nbu/cmd/nbsu/',$fil),\ catFile($dir,$fil),['C',concat('nbsu (',$fil,')')]) } elsif is_pkg_installed('VRTSnetbp') call push(@cmd,\ {cmd => 'COMMENT',nam => 'nbu/cmd/VRTSnetbp', txt => ''},\ ['nbu/cmd/support.txt',\ '/usr/openv/netbackup/bin/goodies/support/support',undef,\ '---++ NetBackup Data Collection Tool',true]) elsif is_pkg_installed('SUNWnetbp') call push(@cmd,\ {cmd => 'COMMENT',nam => 'nbu/cmd/SUNWnetbp', txt => ''},\ ['nbu/cmd/support.txt',\ '/usr/openv/netbackup/bin/goodies/support',undef,\ '---++ NetBackup Data Collection Tool',true]) # Push other commands to be collected call push(@cmd,\ ['nbu/cmd/available_media.txt',\ '/usr/openv/netbackup/bin/goodies/available_media',undef,\ '---++ Show Available Media',true],\ ['nbu/cmd/bpconfig-U.txt',\ '/usr/openv/netbackup/bin/admincmd/bpconfig','-U',\ '---++ Global Configuration Attributes',true],\ ['nbu/cmd/bpgetconfig.txt',\ '/usr/openv/netbackup/bin/admincmd/bpgetconfig',undef,\ '---++ Configuration Information',true],\ ['nbu/cmd/bpsyncinfo-U.txt',\ '/usr/openv/netbackup/bin/admincmd/bpsyncinfo','-U',\ '---++ Database Backup Settings',true],\ ['nbu/cmd/get_license_key-L.features.txt',\ '/usr/openv/netbackup/bin/admincmd/get_license_key','-L features',\ '---++ License Features',true],\ ['nbu/cmd/get_license_key-L.keys.txt',\ '/usr/openv/netbackup/bin/admincmd/get_license_key','-L keys',\ '---++ License Keys',true],\ ['nbu/cmd/ls_-lartR_@usr@openv',\ '/usr/bin/ls','-lartR /usr/openv',\ '---++ File Listing'],\ {cmd => 'UNTITLE'}) # Push files and directories to be collected call push(@fil,\ ['nbu/bp.conf' ,'/usr/openv/netbackup/bp.conf'],\ ['nbu/version' ,'/usr/openv/netbackup/version'],\ ['nbu/bin' ,'/usr/openv/netbackup/bin',\ '','','notify'],\ ['nbu/bin/version' ,'/usr/openv/netbackup/bin/version'],\ ['nbu/db/Class_att_defs' ,'/usr/openv/netbackup/db/Class_att_defs'],\ ['nbu/db/IDIRSTRUCT' ,'/usr/openv/netbackup/db/IDIRSTRUCT'],\ ['nbu/db/INDEXLEVEL' ,'/usr/openv/netbackup/db/INDEXLEVEL'],\ ['nbu/db/bpenableLN.scr' ,'/usr/openv/netbackup/db/bpenableLN.scr'],\ ['nbu/db/bpenableTD.scr' ,'/usr/openv/netbackup/db/bpenableTD.scr'],\ ['nbu/db/class' ,'/usr/openv/netbackup/db/class',\ '','','^\.+$','drv'],\ ['nbu/db/class_template' ,'/usr/openv/netbackup/db/class_template',\ '','','^\.+$','drv'],\ ['nbu/db/client' ,'/usr/openv/netbackup/db/client',\ '','','^\.+$','drv'],\ ['nbu/db/config' ,'/usr/openv/netbackup/db/config',\ '','','^\.+$','drv'],\ ['nbu/db/error' ,'/usr/openv/netbackup/db/error',\ '','','^\.+$','drv'],\ ['nbu/db/failure_history' ,'/usr/openv/netbackup/db/failure_history',\ '','','^\.+$','drv'],\ ['nbu/db/images' ,'/usr/openv/netbackup/db/images',\ '','','^.*\/INDEXLEVEL$'],\ ['nbu/db/jobs' ,'/usr/openv/netbackup/db/jobs',\ '','','^\.+$','drv'],\ ['nbu/db/media' ,'/usr/openv/netbackup/db/media',\ '','','^\.+$','drv'],\ ['nbu/java' ,'/usr/openv/java',\ '','','.*conf$'],\ ['nbu/java/JBPSimple.properties','/usr/openv/java/JBPSimple.properties'],\ ['nbu/java/Launch.properties' ,'/usr/openv/java/Launch.properties'],\ ['nbu/java/Xenv' ,'/usr/openv/java/Xenv'],\ ['nbu/java/logs' ,'/usr/openv/java/logs',\ '','','^\.+$','drv'],\ ['nbu/volmgr' ,'/usr/openv/volmgr/version'],\ ['nbu/volmgr/bin/driver' ,'/usr/openv/volmgr/bin/driver',\ '','','^sg\.conf'],\ ['nbu/volmgr/bin/driver' ,'/usr/openv/volmgr/bin/driver',\ '','','^sg\.links']) # Generate the report report nbu title '---+!! NetBackup' title $TOC debug ' Inside NBU collection, collecting command outputs' call do_exec(@cmd) debug ' Inside NBU collection, collecting files' prefix {write '---+ Collected files' write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@fil) if hasOutput(true) write $TOP # Include nbsu files prefix {write '---+ NetBackup Support Utility Results' write $WRN write '|*File*|' } loop $fil (keys(%lnk)) write '|[[',$lnk{$fil},'][_blank][',$fil,']]|' if hasOutput(true) write $TOP if isCreated(true) toc '2:[[',getFile(),'][rda_report][NetBackup]]' =head1 SEE ALSO L, L =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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