# DCstatus.ctl:E909:Produces the Remote Data Collection Reports # $Id: DCstatus.ctl,v 1.2 2013/10/30 07:18:47 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/RDA/DCstatus.ctl,v 1.2 2013/10/30 07:18:47 RDA Exp $ # # Change History # 20130120 MSC Use the prepare interface. =head1 NAME RDA:DCstatus - Produces the Remote Data Collection Reports =head1 DESCRIPTION This module produces the remote data collection reports. =head1 REMOTE DATA COLLECTION =cut use Remote echo tput('bold'),'Processing RDA.STATUS module ...',tput('off') # Initialization if !@{COL/REMOTE.W_NODES} return var @nod = last var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Remote Data Collection' # Step description var %sta = ('-','Data collection done',\ 'I','Software installation pending',\ 'N','New',\ 'P','RDA post treatment pending',\ 'R','RDA execution pending',\ 'T','Data transfer pending',\ 'c','Installation check error',\ 'd','Remote collection disabled',\ 'i','Software installation error',\ 'n','Remote connection error',\ 'p','RDA post treatment error',\ 'r','RDA execution error',\ 't','Data transfer error') # Recover step information for aborted sessions debug ' Inside STATUS module, gathering collection status' if initSteps(true) call endSteps() =head2 overview - Node Information Gets node information. =cut debug ' Inside STATUS module, gathering node information' report overview prefix {write '---+!! Node Information' write $TOC write '---+ Node Overview' write '|*ID*|*Prefix*|*Host*|*Description*|' } loop $nod (@nod) write '|',$nod,' |',\ ${<'COL.REMOTE',$nod,'W_PREFIX'>:$nod},' |',\ ${<'COL.REMOTE',$nod,'T_HOSTNAME'>}, ' |',\ ${<'COL.REMOTE',$nod,'T_DESCRIPTION'>},' |' if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Node Information]]' # Define an extraction macro macro extract_settings {var ($typ,$skp) = @arg if grepBuffer('CFG',concat('^\[',$typ,'(\.\w+)+\]'),'f') {var ($nam) = match(last,concat('^\[',$typ,'\.(.*)\]')) while grepBuffer('CFG','^\[|^\w+=','fr') {var ($lin) = last if match($lin,'(\w+)="(.*)"') {var ($key,$val) = last next match($key,$skp) write '|',concat($nam,'.',$key),' |',encode($val),' |' } elsif match($lin,concat('^\[',$typ,'.(.*)\]')) var ($nam) = last else break } } } # Get initial properties loop $nod (@nod) {next !createBuffer('CFG','R',catFile(${OUT.P},getRemoteSetup($nod))) prefix {write '---+ Initial Settings for ',$nod write '|*Name*|*Value*|' } call extract_settings('SETUP','-') call extract_settings('TARGET','^(I_|T_TITLE$|W_CLASS$)') if hasOutput(true) write $TOP call deleteBuffer('CFG') } } =head2 results - Collected Data Gets the remote data collection results. =cut # Get all collected report packages var $flg = ${RDA.B_CASE} loop $rpt (grepDir(${OUT.D},'^RDA_','i')) {next !match($rpt,concat('^RDA_(\w+)_'),true) var $nod = uc(last) if !$flg var $rpt = lc($rpt) var $lnk{$nod} = concat('[[../remote/',$rpt,'][',encode($rpt),']]') } # Produce the report debug ' Inside STATUS module, processing the data collection results' report results prefix {write '---+ Collected Data' write '|*Node*|*Description*|*Status*|*File*|' } loop $nod (@nod) write '|',$nod,' |',${<'COL.REMOTE',$nod,'T_DESCRIPTION'>},' |',\ $sta{${<'COL.REMOTE',$nod,'T_STEP'>:'N'}},' |',\ $lnk{$nod},' |' if isCreated() toc '2:[[',getFile(),'][rda_report][Collected Data]]' =begin credits =over 10 =item RDA 4.5: Bob Caldwell. =back =end credits =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