# MCilmb.cfg: Collects Integrated Lights Out Manager (ILOM) Information # $Id: MCilmb.cfg,v 1.5 2013/12/20 13:40:15 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCilmb.cfg,v 1.5 2013/12/20 13:40:15 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change History # 20131220 JGS Fix spell. ############################################################################### # Setup information for Integrated Lights Out Manager (ILOM) snapshot ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ def="COL/${CUR.K_MODULE}.ILMB" dsc="Collects Integrated Lights Out Manager (ILOM) Snapshot Information" var=dsp_items,get_action exe=sdcl { "if ${RUN.EXPLORER.B_USE_ILMB} "{var ${F_CFG:'Current input file'} = ${RUN.EXPLORER.XPLR.ILMB.F_CFG} " loop $set (@{N_SET:'Ilomsnapshot archive host set'} = \ " @{RUN.EXPLORER.XPLR.ILMB.N_SET}) " {var ${T_HOST_${VAR.set}:"Host name or IP address of ilomsnapshot archive \ " host ${VAR.set}"} = ${RUN.EXPLORER.XPLR.ILMB.T_HOST_${VAR.set}} " var ${T_SECTION_${VAR.set}:"Section name to use from .explorer file at \ " archive host ${VAR.set}"} = ${RUN.EXPLORER.XPLR.ILMB.T_SECTION_${VAR.set}} " var ${T_USER_${VAR.set}:"User for connecting to ilomsnapshot archive host \ " ${VAR.set}"} = ${RUN.EXPLORER.XPLR.ILMB.T_USER_${VAR.set}} " } " var ${AUX.var} = [] "} } #------------------------------------------------------------------------------ # Settings definitions #------------------------------------------------------------------------------ [dsp_items] typ=C bef="\nDefined ilomsnapshot archive contexts:" # stopwords ilomsnapshot dsc='Display archive context for user@hosts' vis=0 exe=sdcl { "var ($nxt,@ctx,@dsp,@itm,@rsp) = (0) "keep $nxt,@ctx "if ?${N_SET} "{loop $set (@{N_SET}) " {var ($hst,$sct,$usr) = (${T_HOST_${VAR.set}},\ " ${T_SECTION_${VAR.set}},\ " ${T_USER_${VAR.set}}) " next !?$hst " var $dsc = cond(compare('eq',$hst,'-'),\ " concat($sct,' from ',$usr,' on local host'),\ " concat($sct,' from ',$usr,' at ',$hst)) " call push(@ctx,join('/',$sct,$usr,$hst)) " call push(@dsp,concat(${VAR.set},'\040\040',$dsc)) " call push(@itm,${VAR.set},$dsc) " call push(@rsp,${VAR.set},${VAR.set}) " incr $nxt " } "} "var ${T_TMP_DSP/T} = join('\012',@dsp) "var ${T_TMP_ITM/T} = join('|','0|Previous menu',@itm) "var ${T_TMP_RSP/T} = join('|','0|0',@rsp) "if ${T_TMP_DSP} " var ${AUX.inp} = ${T_TMP_DSP} } [get_action] typ=M ask=0 bef="\nSelect an action:" cas=0 dft='R' err='Invalid action' inp='Enter the selection' nam=-T_TMP_ACT val=E var=D:define,dsp_items,get_action:\ R:save:\ S:suppress,dsp_items,get_action exe=sdcl { "if ?${N_SET} "{var ${AUX.itm} = ['D'=>'Define new ilomsnapshot archive context', \ " 'S'=>'Suppress an existing ilomsnapshot archive context', \ " 'R'=>'Return'] " var ${AUX.rsp} = ['D'=>'D','S'=>'S','R'=>'R'] "} "else "{var ${AUX.itm} = ['D'=>'Define new ilomsnapshot archive context', \ " 'R'=>'Return'] " var ${AUX.rsp} = ['D'=>'D','R'=>'R'] "} } [save] typ=B dft=1 dsc='Save settings' nam=- exe=sdcl { "loop $set (@{N_SET:'Ilomsnapshot archive host set'} = @{N_SET}) "{var ${T_HOST_${VAR.set}:"Host name or IP address of ilomsnapshot archive \ " host ${VAR.set}"} = ${T_HOST_${VAR.set}} " var ${T_SECTION_${VAR.set}:"Section name to use from .explorer file at \ " archive host ${VAR.set}"} = ${T_SECTION_${VAR.set}} " var ${T_USER_${VAR.set}:"User for connecting to ilomsnapshot archive host \ " ${VAR.set}"} = ${T_USER_${VAR.set}} "} } #------------------------------------------------------------------------------ # Define a new archive context #------------------------------------------------------------------------------ [define] typ=B dft=1 dsc='Define an item' nam=- var=get_section,get_user,get_host,is_dup [get_section] typ=T dsc='Section name to use from .explorer file' err='The section name contains invalid characters' inp='Enter the ilomsnapshot section name to use from .explorer file' nam=-T_TMP_SECTION ref="^\w[\w\-\.]*$" val=E [get_user] typ=T dsc='User for connecting to the ilomsnapshot archive host' err='Bad user name' inp='Enter the user for connecting to the ilomsnapshot archive host' nam=-T_TMP_USER ref=defined(isUser(last,true)) val=E [get_host] typ=T dsc='Host name or IP address of ilomsnapshot archive host' err='Bad host name or IP address' inp="Enter the host name or IP address of an ilomsnapshot archive host, or '-' \ for local host" nam=-T_TMP_HOST ref=defined(check(last,'^-$',last,isHost(last,true))) val=E [is_dup] typ=B dsc='Validate if section/user/host is duplicated' nam=- var=true:not_unique:\ save_host,save_user,save_section exe=sdcl { "var $val = concat('^',${T_TMP_SECTION},'/',${T_TMP_USER},'/',${T_TMP_HOST},'$') "var ${AUX.dft} = grep(@ctx,$val,'f') } [not_unique] typ=C dsc='Duplicate ilomsnapshot archive context' inp='Duplicate entry' vis=0 [save_host] typ=T dft=${T_TMP_HOST} dsc="Archive host ${VAR.nxt}" nam=T_HOST_${VAR.nxt} exe=sdcl { "call push(@{N_SET},incr($nxt)) } [save_user] typ=T dft=${T_TMP_USER} dsc="Archive user ${VAR.nxt}" nam=T_USER_${VAR.nxt} [save_section] typ=T dft=${T_TMP_SECTION} dsc="Section ${VAR.nxt}" nam=T_SECTION_${VAR.nxt} #------------------------------------------------------------------------------ # Suppress an archive context #------------------------------------------------------------------------------ [suppress] typ=M bef="\nSelect an ilomsnapshot archive context to suppress:" dft="^" dsc='Select the ilomsnapshot archive context to suppress' err='Specify the item number' inp='Enter the selection' itm="${T_TMP_ITM}" mnu='<