# $Header: emagent/sysman/admin/scripts/ecmSysData1.pl /st_emagent_10.2.0.4.2db11.2/1 2008/11/07 01:47:21 nparaddi Exp $ # # ecmSysData1.pl # # Copyright (c) 2001, 2008, Oracle and/or its affiliates.All rights reserved. # # NAME # ecmSysData1.pl # # DESCRIPTION # Collects Hardware and Software configuration data # # NOTES # # MODIFIED (MM/DD/YY) # mgoodric 05/27/05 - add -help to print usage # mgoodric 09/27/04 - code cleanup # mgoodric 03/27/04 - Add all currently supported OSNAME platforms # mgoodric 03/17/04 - Added LC_ALL=C # mgoodric 06/16/03 - fix converting Solaris timezone to JAVA timezones # mgoodric 05/28/03 - files are now OSD-specific # mgoodric 05/11/03 - added -debug tracing # mgoodric 04/07/03 - fix finding MAC address # rlal 03/16/03 - Adding OS Registerd software # rlal 02/25/03 - EM 4.0 changes for Linux # goramamo 01/21/03 - Minor error msg changes # goramamo 09/11/02 - Remove unused code # xxu 06/25/02 - remove /usr/local/bin/perl # goramamo 06/01/02 - GIT5 Changes # goramamo 05/01/02 - Added code to detect all vendor products # goramamo 04/14/02 - Added code to check pkginfo files # goramamo 03/28/02 - Added code to generte XML from files # jmansur 02/18/02 - allow for no OS kernel parameters # mgoodric 02/14/02 - Make scripts more portable # jmansur 01/23/02 - collect OS kernel parameters # goramamo 11/28/01 - Added perl module directory name as second argument # goramamo 10/15/01 - Creation # ##********************************************************* ## Arguments ##********************************************************* ## ARGV[0] - A keyword one among HARDWARE, OS_SOFTWARE, VENDOR_SOFTWARE, ALL ## - (Must be supplied) ## ARGV[1] - Directory where the user written Ptdpm*.pm modules are located. ## - (Optional) ## ARGV[2] - Directory where the saved data files for testing are saved. ## - (Optional) ## ARGV[3]..ARGV[n] - Additional options (e.g. -debug) ## - (Optional) ##********************************************************* ## PROGRAM/SUBROUTINES FLOW ##********************************************************* ## BEGIN ## getParam ## initialize ## setOutputAutoFlush ## getParam ## setDataDir ## importModules ## setupOSD ## getOSname ## checkOSSupport ## checkArgs ## callModules ## GetHardwareDetails ## getSysSummary ## appendsysXML ## getHWDetails ## appendhwXML ## GetOSDetails ## getOSSummary ## appendossumXML ## getOSConfiguration ## appendOSConfHashXML ## getMountedFileSystemDetails ## appendfsXML ## getSoftwareComponents ## appendOSHashXML ## GetVendorComponents ## getSoftwareComponents ## appendVendorHashXML ## finalize ## AUTOLOAD ## END ##********************************************************* ## MODULE CALLS ##********************************************************* use strict; use Carp; require 5.005; #require 5.6.1; use Cwd; use File::Basename; #****************************************** # Global Variables #****************************************** use constant NIL => ''; $main::COPYRIGHT = 'Copyright (c) 2001, 2005, Oracle. All rights reserved.'; $main::VERSION = '10.2.0.0'; $main::OSNAME = NIL; $main::DATADIR = NIL; $main::PROGMAIN = File::Basename::basename($0); $main::SCRIPTSDIR = File::Basename::dirname($0); $main::LIBDIR = $main::SCRIPTSDIR; $main::DEBUG = 0; $main::HELP = 0; $main::INDENT = 0; $main::ALL = 0; $main::HARDWARE = 0; $main::OS_SOFTWARE = 0; $main::VENDOR_SOFTWARE = 0; $main::OS = $^O; $main::PERL = $^X; my $noofargs = scalar(@ARGV); my @recdargs = @ARGV; my $osflag = NIL; initialize(); if ($noofargs == 0) { usage(); } else { $osflag = checkOSSupport(); if ($osflag eq 'true') { checkArgs(); callModules(); } } finalize(); ##================================================ ## SUBROUTINE DEFINITIONS ##================================================ sub usage { print <<_EOF_ $main::PROGMAIN $main::VERSION $main::COPYRIGHT Usage: $main::PROGMAIN [