# MCsn.ctl:220:Collects Chassis Serial Number # $Id: MCsn.ctl,v 1.10 2015/08/31 14:06:16 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCsn.ctl,v 1.10 2015/08/31 14:06:16 RDA Exp $ # # Change History # 20150828 JGS Share the SMS user setting. =head1 NAME EXPLORER:MCsn - Collects Chassis Serial Number =head1 DESCRIPTION This module collects the system chassis serial number. =cut use Explorer 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('platform_serial') run EXPLORER:SNinfo() #------------------------------------------------------------------------------ # XPLR_platform_serial section #------------------------------------------------------------------------------ section XPLR_platform_serial # Validate the execution context call log_run('Processing SN sections ...') =head2 sn_chassis - Chassis Serial Number Gathers system chassis serial number using the F command from the Explorer distribution. =cut if ?$pgm = get_bin_tool('serial_finder') {debug ' Inside SN collection, gathering chassis serial number' report sn_chassis title '---+!! Chassis Serial Number' title $TOC call do_exec(\ ['sysconfig/chassis_serial',\ $pgm,undef,\ '---+ Chassis Serial Number',\ {out=>{tag=>'_sn_serial_finder_'}}]) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Chassis Serial Number]]' } else call log_info('No Explorer software found') =for stopwords dmidecode =head2 sn_dmidecode - dmidecode Information Gathers system information using the F command. =cut if ?$pgm = $[XPL]->has_dmidecode {debug ' Inside SN collection, gathering dmidecode information' var ($nam,$opt) = ('sysconfig/dmidecode') if grepCommand(concat(quote($pgm),' -V 2>/dev/null'),'^\s*(\d+(\.\d+)*)$','f1') {if compare('valid',first,'2.7') var ($nam,$opt) = ('sysconfig/dmidecode_-t_system','-t system') } report sn_dmidecode title '---+!! Dmidecode Information' title $TOC call do_exec(\ [$nam,\ $pgm,$opt,\ '---+ Dmidecode Information',\ {out=>{tag=>'_sn_dmidecode_'}}]) if isCreated(true) toc '2:[[',getFile(),'][rda_report][dmidecode Information]]' } else call log_info('No dmidecode software found') =head2 sn_serials - Serial Numbers Reports the serial numbers retrieved from well-known sources. =cut report sn_serials title '---+!! Serial Numbers' prefix {call beginBlock(false) call addBlock('E','D','sysconfig/serials') } var $hsh = get_all_serials() loop $key (keys($hsh)) write '|*',$key,'*|',$hsh->{$key},' |' if isCreated(true) {call endBlock() toc '2:[[',getFile(),'][rda_report][Serial Numbers]]' } #------------------------------------------------------------------------------ # Input section #------------------------------------------------------------------------------ section input if ?isUser(${ENV.EXP_SMSUSER},true) {var ${RUN.EXPLORER.XPLR.T_SMS_USER} = last var ${RUN.EXPLORER.B_USE_SN} = true } =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