#!/usr/bin/perl

##########################################################################
# 
# 5655-A30
# (C) Copyright International Business Machines Corp. 1990, 2010.
#
# All rights reserved.
#
##########################################################################
#
# collect.pl [fsck]
# Version 0.8 ; 2010-05-04
#
# This script collects information about your system
# and writes it to a file called "collect.data.html".
# Please review this file to assure, that no confidential
# data is transferred to IBM.
# You can view this file either with a text editor or a web-browser.
# If there is output containing confidential data, feel free to delete
# these lines. Please mark every deletion by adding a line
# like "(deleted)".
# Please do not delete any line outside of "< !-- OUTPUT -->< PRE>"
# and "< !-- OUTPUT -->< /PRE>".
# The following information is collected:
#
# 1. TSM specific information
# 1.1.  Installed TSM-Packages and prerequisite Packages and Versions
# 1.2.  TSM and prerequisite Packages installation accuracy
# 1.3.  TSM-Client Version
# 1.4.  environment variables DSM_DIR, DSM_CONFIG, DSM_LOG
# 1.5.  Content of configuration files dsm.opt and dsm.sys
# 1.6.  Content of log files dsmerror.log and dsmj.log
# 1.7.  HSM specific information
# 1.8.  GPFS specific information
#
# 2. Operating System and Hardware
# 2.1.  Version of Operating System
# 2.2.  Bitmode
# 2.3.  output of ulimit -a
# 2.4.  File system ( Space and mounted file systems)
# 2.5.  File system consistency
# 2.6.  memory usage
# 2.7.  cpu usage
# 2.8.  cpu information
# 2.9.  date of last reboot
# 2.10. processes-information
# 2.11. installed java-packages
# 2.12. java-installations and versions
# 2.13. user-information
# 2.14. ethernet card information
# 2.15. system swap area information
# 2.16. dynamic dependencies of TSM executable files
# 2.17. c++ shared library version
#
# 3. Operating System specific information
#			 AIX: List of all installed interim fixes
#			 AIX: HACMP version if installed
#      Solaris / HP-UX: List of all installed packages
#      Solaris: List of all installed patches
#      Solaris: Kernel messages
#      Solaris: Size of TSM libraries and executables + link
#      Solaris: Settings of network card(s)
#      Solaris: Non-global zones information
#      Solaris: output of cat /etc/system
#
# Version 0.2 ; 2003-04-03
# Version 0.3 ; 2003-04-24
# Version 0.4 ; 2003-04-24
# Version 0.5 ; 2003-10-29
# Version 0.6 ; 2003-11-03 added fsck parameter, modified
#               solaris commandline output
# Version 0.7 ; 2005-11-09 added GPFS output for aix+linux
# Version 0.7.1 ; 2007-03-13 added oslevel -r output for aix
#                            addes /usr/sbin/emgr -l for aix
# Version 0.8 ; 2010-05-04 added the variable @OS_SUPPORTED that
#															that contains all supported platforms
#														 added new sections:
#															ethernet card information
#															system swap area information
#															dynamic dependencies of TSM executable files
#															c++ shared library version
#															Non-global zones information (Solaris only)
#															output of cat /etc/system (Solaris only)
#														 changed name of the following sections
#															Installed TSM-Packages and Versions
#																into
#																Istalled TSM-Packages and prerequisite
#																Packages with Version information
#															TSM Packages installation accuracy
#																into
#																TSM and prerequisite Packages
#																installation accuracy
#														 added check for gskit prerequisite packages
#														 changed the following commands:
#															swlist TIVsm to swlist | grep TIVsm
#															dsmc quit 2> $ERRORFILENAME to
#																/usr/bin/dsmc quit 2> $ERRORFILENAME
#															prstat 2 1";                # > $ERRORFILENAME`
#																to prstat 2 1 2> $ERRORFILENAME
#															ifconfig -a | grep \"^hme|^qfe\" | cut -f1 -d: | uniq
#																to ifconfig -a 2> $ERRORFILENAME
#														 added to skip GPFS section if GPFS is not
#															supported
#														 added commands to list nodes in a gpfs cluster
#														 added commands to get process information
#														 added commands to get more client information
#														 added commands to read out the GPFS policies
#														 added commands to show total amout of memory
#															available
#														 added commands to show number of physical
#															processors
#														 numbred the sections
#														 marked the sample sections as comment
##########################################################################

my $VERSION = "0.8";

######################
# START: BASE SECTION 
######################

my $ERRORFILENAME = "collect.error";
my @OS_SUPPORTED = ("AIX","Linux","SunOS","HP-UX");
my $TEMPDIR = "collect_test";
my $TEMPFILENAME  = "collect.temp";
my $dsm_config;
my $dsm_dir;
my $dsm_dir_default;
my $is_slash;
my $nexttoo;
my $OSid;
my $OSname;
my @outfile;    #ALL collected information is stored in @outfile
my @outtemp;
my $r;
my $s;
my @s;

# the sub errorhandling appends the standard-error-msgs to @outfile
# it is called after running a shell-command containing the
# redirection "2> $ERRORFILENAME"
sub errorhandling{
  my $rc  = $?;
  my $return;
  if ($rc != 0) {
    push @outfile, "\n<!-- ERROR OCCURED --><PRE><font color=#ff0000>\n\n";
    push @outfile, "Return code: $rc\n";
    if(open(ERRORFILE, $ERRORFILENAME)){
      push @outfile, <ERRORFILE>;
      close(ERRORFILE);
    }
    push @outfile, "\n<!-- ERROR OCCURED --></font></PRE>\n";
  }
  return $return;
}    

print "##############################################################\n";
print "# This script will collect information about your system     #\n";
print "# and writes it to a file called \"collect.data.html\".        #\n";
print "#                                                            #\n";
print "# Please review this file to assure, that no confidential    #\n";
print "# data is transferred to IBM.                                #\n";
print "##############################################################\n";
print "\nPress ENTER to continue or type \"no\" to abort.\n>";

chop($s = <STDIN>);
if($s ne ""){
  die print "Aborted";
}

# get name of Operating System
# expected "AIX", "Linux", "SunOS", "HP-UX"
chop($OSname = `uname`);

print "found \'$OSname\'\n";

# set $OSid
SWITCH: {
	# AIX
  if ($OSname eq $OS_SUPPORTED[0]) { $OSid = 10; last SWITCH; }
	# Linux
  if ($OSname eq $OS_SUPPORTED[1]) { $OSid = 20; last SWITCH; }
	# SunOS
  if ($OSname eq $OS_SUPPORTED[2]) { $OSid = 30; last SWITCH; }
	# HP-UX
  if ($OSname eq $OS_SUPPORTED[3]) { $OSid = 40; last SWITCH; }
  die print "\n Operating System \'$OSname\' not supported!\n";
}

# append html head, copyright information and instructions to @outfile
push @outfile, "<html>\n<head>\n</head>\n<body>\n\n\n\n";

push @outfile, "\n\n\n<!-- ########################################### --> <h1>\n\n";
push @outfile, "     Copyright\n\n";
push @outfile, "<!-- ########################################### --> </h2><PRE>\n\n";

push @outfile, 

"5655-A30

(C) Copyright International Business Machines Corp. 1990, 2010.

All rights reserved.


";

push @outfile, "\n</PRE><!-- -------------- --> <hr> <!-- -------------- -->\n";
push @outfile, "\n\n\n<!-- ########################################### --> <h1>\n\n";
push @outfile, "     Instructions\n\n";
push @outfile, "<!-- ########################################### --> </h2><PRE>\n\n";

push @outfile, 

"This file contains the information about your system collected by collect.pl. Please review this file to assure, that no confidential data is transferred to IBM.

You can view this file either with a text editor or a web-browser.

All executed shell-commands and their output are listed here. If there is output containing confidential data, feel free to delete these lines.

Please mark every deletion by adding a line like \"(deleted)\". Please do not delete any line outsite of \"< !-- OUTPUT -->< PRE>\"  and \"< !-- OUTPUT -->< /PRE>\".


";

push @outfile, "\n</PRE><!-- -------------- --> <hr> <!-- -------------- -->\n";


push @outfile, "\n\n\n<!-- ########################################### -->  <h1> <a name=\"top\">\n\n";
push @outfile, "     Collected Information - Table of contents\n\n";
push @outfile, "<!-- ########################################### -->  </h1><!--\n\n";

# append table of contents for view in text editor to @outfile
push @outfile, "


TSM specific information

-> Installed TSM-Packages and prerequisite Packages with version information
-> TSM and prerequisite Packages installation accuracy
-> TSM-Client Version
-> environment variables DSM_DIR, DSM_CONFIG, DSM_LOG
-> Content of configuration files dsm.opt and dsm.sys
-> Content of log files dsmerror.log and dsmj.log
-> HSM specific information
-> GPFS specific information

Operating System and Hardware

-> Version of Operating System
-> Bitmode
-> output of ulimit -a
-> File system ( Space and mounted file systems)
-> File system consistency
-> memory usage
-> cpu usage
-> cpu information
-> date of last reboot
-> processes-information
-> installed java-packages
-> java-installations and versions
-> user-information
-> ethernet card information
-> system swap area information
-> dynamic dependencies of TSM executable files
-> c++ shared library version

Operating System specific information

-> AIX: List of all installed interim fixes
-> AIX: HACMP version if installed
-> Solaris / HP-UX: List of all installed packages
-> Solaris: List of all installed patches
-> Solaris: Kernel messages
-> Solaris: Size of TSM libraries and executables + link
-> Solaris: Settings of network card(s)
-> Solaris: Non-global zones information
-> Solaris: output of cat /etc/system

---------------------------- -->\n";

# append table of contents for view in webbrowser to @outfile
push @outfile, "\n\n<!-- ------------- The following lines are for view in browser ------------- -->\n\n";

push @outfile, "<a href=\"#TSM\">TSM specific information</a>\n";

push @outfile, "<UL>\n";
push @outfile, "<LI><a href=\"#TSM-Packages\">Installed TSM-Packages and prerequisite Packages with version information</a></LI>\n";
push @outfile, "<LI><a href=\"#TSM-Packages2\">TSM and prerequisite Packages installation accuracy</a></LI>\n";
push @outfile, "<LI><a href=\"#TSM-Client_Version\">TSM-Client Version</a></LI>\n";
push @outfile, "<LI><a href=\"#environment\">environment variables DSM_DIR, DSM_CONFIG, DSM_LOG</a></LI>\n";
push @outfile, "<LI><a href=\"#tsmconfigfiles\">Content of configuration files dsm.opt and dsm.sys</a></LI>\n";
push @outfile, "<LI><a href=\"#tsmlogfiles\">Content of log files dsmerror.log and dsmj.log</a></LI>\n";
push @outfile, "<LI><a href=\"#hsm\">HSM specific information</a></LI>\n";
push @outfile, "<LI><a href=\"#gpfs\">GPFS specific information</a></LI>\n";
push @outfile, "</UL>\n";

push @outfile, "<a href=\"#Operating_System_and_Hardware\">Operating System and Hardware</a>\n";

push @outfile, "<UL>\n";
push @outfile, "<LI><a href=\"#Version_of_Operating_System\">Version of Operating System</a></LI>\n";
push @outfile, "<LI><a href=\"#Bitmode\">Bitmode</a></LI>\n";
push @outfile, "<LI><a href=\"#output_of_ulimita\">output of ulimit -a</a></LI>\n";
push @outfile, "<LI><a href=\"#File_system1\">File system ( Space and mounted file systems)</a></LI>\n";
push @outfile, "<LI><a href=\"#File_system_consistency\">File system consistency</a></LI>\n";
push @outfile, "<LI><a href=\"#memory_usage\">memory usage</a></LI>\n";
push @outfile, "<LI><a href=\"#cpu_usage\">cpu usage</a></LI>\n";
push @outfile, "<LI><a href=\"#cpu_information\">cpu information</a></LI>\n";
push @outfile, "<LI><a href=\"#date_of_last_reboot\">date of last reboot</a></LI>\n";
push @outfile, "<LI><a href=\"#processes-information\">processes-information</a></LI>\n";
push @outfile, "<LI><a href=\"#java1\">installed java-packages</a></LI>\n";
push @outfile, "<LI><a href=\"#java2\">java-installations and versions</a></LI>\n";
push @outfile, "<LI><a href=\"#user-information\">user-information</a></LI>\n";
push @outfile, "<LI><a href=\"#ethernet_card_information\">ethernet card information</a></LI>\n";
push @outfile, "<LI><a href=\"#system_swap_area_information\">system swap area information</a></LI>\n";
push @outfile, "<LI><a href=\"#dynamic_dependencies_of_TSM_executable_files\">dynamic dependencies of TSM executable files</a></LI>\n";
push @outfile, "<LI><a href=\"#c++_shared_library_version\">c++ shared library version</a></LI>\n";
push @outfile, "</UL>\n";

push @outfile, "<a href=\"#Operating_System_specific_information\">Operating System specific information</a>\n";

push @outfile, "</a>\n";

push @outfile, "<UL>\n";
push @outfile, "<LI><a href=\"#list_of_all_installed_interim_fixes\">AIX: List of all installed interim fixes</a></LI>\n";
push @outfile, "<LI><a href=\"#HACMP_version_if_installed\">AIX: HACMP version if installed</a></LI>\n";
push @outfile, "<LI><a href=\"#list_of_all_installed_packages\">Solaris / HP: List of all installed packages</a></LI>\n";
push @outfile, "<LI><a href=\"#list_of_all_installed_patches\">Solaris: List of all installed patches</a></LI>\n";
push @outfile, "<LI><a href=\"#kernel_messages\">Solaris: Kernel messages</a></LI>\n";
push @outfile, "<LI><a href=\"#Size_of_TSM_libraries_and_executables_link\">Solaris: Size of TSM libraries and executables + link</a></LI>\n";
push @outfile, "<LI><a href=\"#Settings_of_network_cards\">Solaris: Settings of network card(s)</a></LI>\n";
push @outfile, "<LI><a href=\"#Non_global_zones_information\">Solaris: Non-global zones information</a></LI>\n";
push @outfile, "<LI><a href=\"#output_of_cat__etc_system\">Solaris: output of cat /etc/system</a></LI>\n";
push @outfile, "</UL>\n";

push @outfile, "\n<!-- -------------- --> <hr> <!-- -------------- -->\n";

####################
# END: BASE SECTION
####################

##########################
# START: COLLECT SECTIONS
##########################

#********************************
#********************************
#*  1. TSM specific information
#********************************
#********************************

push @outfile, "\n\n\n\n<!-- ########################################### --> <a name=\"TSM\"> <h1>\n\n";
push @outfile, "     TSM specific information\n\n";
push @outfile, "<!-- ########################################### -->  </h1>\n\n";

#************************************************************************************
#*  1.1.  Installed TSM-Packages and prerequisite Packages with version information
#************************************************************************************

##########################################################################
# append all installed TSM-Packages and prerequisite Packages to @outfile
##########################################################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"TSM-Packages\"> <h2>\n\n";
push @outfile, "     Installed TSM-Packages and prerequisite Packages and Versions\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting installed TSM-Packages and prerequisite Packages...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lslpp -L '*[Tt][Ss][Mm].[Cc][Ll][Ii][Ee][Nn][Tt]*'\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, ` lslpp -L '*[Tt][Ss][Mm].[Cc][Ll][Ii][Ee][Nn][Tt]*'`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lslpp -L '[Gg][Ss][Kk][Ii][Tt]*'\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, ` lslpp -L '[Gg][Ss][Kk][Ii][Tt]*'`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: rpm -qa | grep TIVsm\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    @outtemp = `rpm -qa | grep TIVsm`;
    push @outfile, "@outtemp\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
    foreach $s (@outtemp){
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: rpm -qi $s\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `rpm -qi $s`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
	
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: rpm -qa | grep gsk\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    @outtemp = `rpm -qa | grep gsk`;
    push @outfile, "@outtemp\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
    foreach $s (@outtemp){
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: rpm -qi $s\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `rpm -qi $s`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
    
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: pkginfo -x (Note: only the TIV-packages were added to output-file)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # the following command shows all installed packages
    # there are two lines per package.
    # in the second line you can find the version
    @outtemp = `pkginfo -x`;
    # append every line containing TIVsm and the following line (=version) to @outtemp
    $nexttoo = "";
    foreach $s (@outtemp){
      if($nexttoo){
        push @outfile, $s;
        $nexttoo = 0;
      }
      elsif($s =~ /TIVsm/){
        push @outfile, $s;
				$nexttoo = 1;
      }
    }  
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: pkginfo | grep TIVsm (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    @outtemp = `pkginfo | grep TIVsm`;    
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
    foreach $s (@outtemp){
      $s = (split(' ', $s))[1];
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: pkginfo -l $s\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `pkginfo -l $s`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
	
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: pkginfo -x | grep gsk\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    @outtemp = `pkginfo -x | grep gsk`;
    push @outfile, "@outtemp\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
		foreach $s (@outtemp){
			$s = (split(' ', $s))[0];
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: pkginfo -l $s\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `pkginfo -l $s`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		}
		
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swlist | grep TIVsm\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swlist | grep TIVsm`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swlist | grep gsk\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swlist | grep gsk`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		last SWITCH;
  }
}

print "...Done\n";

#**************************************************************
#*  1.2.  TSM and prerequisite Packages installation accuracy
#**************************************************************

################ä########################################################
# append TSM and prerequisite Packages installation accuracy to @outfile
#########################################################################

push @outfile, "\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"TSM-Packages2\"> <h2>\n\n";
push @outfile, "     TSM and prerequisite Packages installation accuracy\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "checking TSM and prerequisite Packages installation accuracy...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  lslpp -f '*[Tt][Ss][Mm].[Cc][Ll][Ii][Ee][Nn][Tt]*' 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, ` lslpp -f '*[Tt][Ss][Mm].[Cc][Ll][Ii][Ee][Nn][Tt]*' 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  lslpp -f '[Gg][Ss][Kk][Ii][Tt]*' 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, ` lslpp -f '[Gg][Ss][Kk][Ii][Tt]*' 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: rpm -qa | grep TIVsm  (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    @outtemp = `rpm -qa | grep TIVsm`;
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
    foreach $s (@outtemp){
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: rpm -V $s\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `rpm -V $s`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
	
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: rpm -qa | grep gsk (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    @outtemp = `rpm -qa | grep gsk`;
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
    foreach $s (@outtemp){
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: rpm -V $s\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `rpm -V $s`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
    
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: pkginfo | grep TIVsm (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    @outtemp = `pkginfo | grep TIVsm`;
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
    foreach $s (@outtemp){
      $s = (split(' ', $s))[1];
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: pkgchk $s 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `pkgchk $s 2> $ERRORFILENAME`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
	
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: pkginfo -x | grep gsk (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    @outtemp = `pkginfo -x | grep gsk`;
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
    foreach $s (@outtemp){
      $s = (split(' ', $s))[0];
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: pkgchk $s 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `pkgchk $s 2> $ERRORFILENAME`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    }
   
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swlist -l file TIVsm* 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swlist -l file TIVsm* 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swlist -l file gsk* 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swlist -l file gsk* 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
    last SWITCH;
  }
}

print "...Done\n";

#*****************************
#*  1.3.  TSM-Client Version
#*****************************

####################################
# append Client-Version to @outfile
####################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"TSM-Client_Version\"> <h2>\n\n";
push @outfile, "     TSM-Client Version\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting TSM BA Client Version...\n";

	`mkdir $TEMPDIR`;
	`cd $TEMPDIR`;
	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: /usr/bin/dsmc quit 2> $ERRORFILENAME (Note: The directory $TEMPDIR was created and was removed afterwards)\n";
  push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

  push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
  push @outfile, `/usr/bin/dsmc quit 2> $ERRORFILENAME`."\n";
	`cd ..`;
  `rm -r $TEMPDIR`;
  push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	errorhandling();
  push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

#*************************************************************
#*  1.4.  environment variables DSM_DIR, DSM_CONFIG, DSM_LOG
#*************************************************************

########################################################################
# append environment variables DSM_DIR, DSM_CONFIG, DSM_LOG to @outfile
########################################################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"environment\"> <h2>\n\n";
push @outfile, "     environment variables DSM_DIR, DSM_CONFIG, DSM_LOG\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting environtment variables DSM_OPT, DSM_CONFIG, DSM_LOG...\n";

	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing (Perl): \$ENV{'DSM_CONFIG'}\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, "$ENV{'DSM_CONFIG'}\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing (Perl): \$ENV{'DSM_DIR'}\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, "$ENV{'DSM_DIR'}\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing (Perl): \$ENV{'DSM_LOG'}\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, "$ENV{'DSM_LOG'}\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

#*************************************************************
#*  1.5.  Content of configuration files dsm.opt and dsm.sys
#*************************************************************

#################################
# content of dsm.opt and dsm.sys
#################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"tsmconfigfiles\"> <h2>\n\n";
push @outfile, "     Content of configuration files dsm.opt and dsm.sys\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

# save values of $ENV{'DSM_CONFIG'} and $ENV{'DSM_DIR'} in $dsm_config and $dsm_dir
# if these variables are empty, fill them with default values according to OS

# set default values
SWITCH: {
  if ($OSid == 10 ){                  # AIX
    $dsm_dir_default = "/usr/tivoli/tsm/client/ba/bin";
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    $dsm_dir_default = "/opt/tivoli/tsm/client/ba/bin";
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    $dsm_dir_default = "/opt/tivoli/tsm/client/ba/bin";
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    $dsm_dir_default = "/opt/tivoli/tsm/client/ba/bin";
    last SWITCH;
  }
}  
	
$dsm_config = $ENV{'DSM_CONFIG'};
$dsm_dir    = $ENV{'DSM_DIR'};
  
if($dsm_dir eq ""){
  $dsm_dir = $dsm_dir_default;
}

if($dsm_config eq ""){
  $dsm_config = "$dsm_dir/dsm.opt";
} 

# append the content of dsm.opt ($dsm_config) to @outfile
print "reading content of configuration file \"dsm.opt\"...\n";

    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat $dsm_config 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat $dsm_config 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

# append the content of file $dsm_dir/dsm.sys to @outfile
print "reading content of configuration file \"dsm.sys\"...\n";

    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat $dsm_dir/dsm.sys 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat $dsm_dir/dsm.sys 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

#*********************************************************
#*  1.6.  Content of log files dsmerror.log and dsmj.log
#*********************************************************

#######################################
# content of dsmerror.log and dsmj.log
#######################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"tsmlogfiles\"> <h2>\n\n";
push @outfile, "     Content of log files dsmerror.log and dsmj.log\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

# append the content of $dsm_dir/dsmerror.log to @outfile
print "reading content of log file \"$dsm_dir/dsmerror.log\"...\n";

    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat $dsm_dir/dsmerror.log 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat $dsm_dir/dsmerror.log 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

# append the content of file $dsm_dir/dsmj.log to @outfile
print "reading content of log file \"$dsm_dir/dsmj.log\"...\n";

    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat $dsm_dir/dsmj.log 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat $dsm_dir/dsmj.log 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

# if $dsm_dir equals $dsm_dir_default, skip the next two commands
if($dsm_dir ne $dsm_dir_default){
  # append the content of $dsm_dir_default/dsmerror.log to @outfile
  print "reading content of default log file \"$dsm_dir_default/dsmerror.log\"...\n";

    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat $dsm_dir_default/dsmerror.log 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat $dsm_dir_default/dsmerror.log 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
 
  print "...Done\n";
  
  # append the content of $dsm_dir_default/dsmj.log to @outfile
  print "reading content of default log file \"$dsm_dir_default/dsmj.log\"...\n";

    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat $dsm_dir_default/dsmj.log 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat $dsm_dir_default/dsmj.log 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

  print "...Done\n";
}

#***********************************
#*  1.7.  HSM specific information
#***********************************

###############################################
## append HSM specific information to @outfile
###############################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"hsm\"> <h2>\n\n";
push @outfile, "     HSM specific information \n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting HSM specific information...\n";

	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: dsmmigquery 2>&1\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, `dsmmigquery 2>&1`."\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

	# return code: "command not found" or ($?==127) or ($?==256)
	if(($?==-1) or ($?==32512) ){
		push @outfile, "It seems like HSM is not installed!\n";
	}else{
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  dsmmigfs q -detail 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `dsmmigfs q -detail 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: dsmmigfs q -f  2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `dsmmigfs q -f  2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: dsmdf  2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `dsmdf  2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ls -lR /etc/adsm/SpaceMan  2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ls -lR /etc/adsm/SpaceMan  2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: dsmmigquery -o 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `dsmmigquery -o 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: dsmmigquery -mgmt -detail 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `dsmmigquery -mgmt -detail 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	}

print "...Done\n";

#************************************
#*  1.8.  GPFS specific information
#************************************

################################################
## append GPFS specific information to @outfile
################################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"gpfs\"> <h2>\n\n";
push @outfile, "     GPFS specific information \n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting GPFS specific information...\n";

	# GPFS is not supported and GPFS specific information can be skipped
	if (($OSid == 30) or ($OSid == 40)){
		push @outfile, "= Skipped =\n";
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		print "...Skipped\n";
	}
	else{
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
		push @outfile, "Executing: /usr/lpp/mmfs/bin/mmfsadm dump version  2> $ERRORFILENAME\n";
		push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

		push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
		push @outfile, `/usr/lpp/mmfs/bin/mmfsadm dump version  2> $ERRORFILENAME`."\n";
		push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		if(($?==-1) or ($?==32512) ){ # return code: "command not found" or ($?==127) or ($?==256)
			# do nothing
		}else{
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: /usr/lpp/mmfs/bin/mmlscluster 2>&1\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `/usr/lpp/mmfs/bin/mmlscluster 2>&1`."\n";   # >&1
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing:  /usr/lpp/mmfs/bin/mmlsconfig 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `/usr/lpp/mmfs/bin/mmlsconfig 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: /usr/lpp/mmfs/bin/mmfsadm dump dmapi  2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `/usr/lpp/mmfs/bin/mmfsadm dump dmapi  2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

			
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: /usr/lpp/mmfs/bin/mmgetstate -a  2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	
			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `/usr/lpp/mmfs/bin/mmgetstate -a  2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: ps -ef | grep mm 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	
			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ps -ef | grep mm 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: ps -ef | grep dsm 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	
			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ps -ef | grep dsm 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: dsmc query systeminfo -console 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	
			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `dsmc query systeminfo -console 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

			
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: mmlsconfig | grep /dev 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	
			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `mmlsconfig | grep /dev 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
			# getting names of the existing filesystems
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: mmlsconfig | grep /dev (Note: the output is not added to outfile but processed by the script) \n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n\n";
			@outtemp = `mmlsconfig | grep /dev`;
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
			foreach $s (@outtemp){
				chomp $s;
				push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
				push @outfile, "Executing: mmlspolicy $s -L 2> $ERRORFILENAME\n";
				push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	
				push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
				push @outfile, `mmlspolicy $s -L 2> $ERRORFILENAME`."\n";
				push @outfile, "\n<!-- OUTPUT --></PRE>\n";
				errorhandling();
				push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			}
			
			if ($OSid == 10 ){                  # AIX
				push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
				push @outfile, "Executing: lslpp -l | grep gpfs  2> $ERRORFILENAME\n";
				push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

				push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
				push @outfile, `lslpp -l | grep -E \"mmfs|gpfs\"  2> $ERRORFILENAME`."\n";
				push @outfile, "\n<!-- OUTPUT --></PRE>\n";
				errorhandling();
				push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			}
			if ($OSid == 20){                  # Linux
				push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
				push @outfile, "Executing: rpm -qa | grep gpfs   2> $ERRORFILENAME\n";
				push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

				push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
				push @outfile, `rpm -qa | grep gpfs   2> $ERRORFILENAME`."\n";
				push @outfile, "\n<!-- OUTPUT --></PRE>\n";
				errorhandling();
				push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			}
		}

	print "...Done\n";
}

#**************************************
#**************************************
#**  2. Operating System and Hardware
#**************************************
#**************************************

push @outfile, "\n\n\n<!-- ########################################### --> <a name=\"Operating_System_and_Hardware\"><h1>\n\n";
push @outfile, "     Operating System and Hardware\n\n";
push @outfile, "<!-- ########################################### -->  </h1>\n\n";

#**************************************
#*  2.1.  Version of Operating System
#**************************************

####################################
# append OS information to @outfile
####################################

push @outfile, "\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  <a name=\"Version_of_Operating_System\"> <h2>\n\n";
push @outfile, "     Version of Operating System\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting OS information...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: uname -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `uname -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: oslevel -s\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `oslevel -s`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: oslevel\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `oslevel`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: uname -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `uname -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat /etc/issue\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat /etc/issue`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: uname -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `uname -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat /etc/release\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat /etc/release`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: uname -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `uname -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: model\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `model`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
   
    last SWITCH;
  }
}

print "...Done\n";

#******************
#*  2.2.  Bitmode
#******************

##############################
# append bit mode to @outfile
##############################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"Bitmode\"> <h2>\n\n";
push @outfile, "     Bitmode\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting bit mode...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ls -la / (Note: the output is not added to outfile but processed by the script) \n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n";
    @outtemp = `ls -la /`;
    foreach $s (@outtemp){
      if($s =~ /unix ->/){
				chop($s);
				if(substr($s,-2) eq "64") {
					push @outfile, "64 Bit\n";
				}
				elsif( (substr($s,-2) eq "mp") or (substr($s,-2) eq "up") ) {
					push @outfile, "32 Bit\n";
				}
				else {
					push @outfile, "(unknown)\n";
				};
      } 
    }
		push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		last SWITCH;
	}
	if ($OSid == 20){                  # Linux
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
		push @outfile, "Executing: getconf LONG_BIT\n";
		push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

		push @outfile, "\n<!-- OUTPUT --><PRE>\n";
		push @outfile, `getconf LONG_BIT`."\n";
		push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		last SWITCH;
	}
	if ($OSid == 30){                  # SunOS
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n";
		push @outfile, "Executing: isainfo -b\n";
		push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

		push @outfile, "\n<!-- OUTPUT --><PRE>\n";
		push @outfile, `isainfo -b`."\n";
		push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
   
		last SWITCH;
	}
	if ($OSid == 40){                  # HP-UX
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n";
		push @outfile, "Executing: getconf KERNEL_BITS\n";
		push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

		push @outfile, "\n<!-- OUTPUT --><PRE>\n";
		push @outfile, `getconf KERNEL_BITS`."\n";
		push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
   
		last SWITCH;
	}
}

print "...Done\n";

#********************************
#*  2.3.  output of "ulimit -a"
#********************************

#########################################################
# append information returned by "ulimit -a" to @outfile
#########################################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"output_of_ulimita\"> <h2>\n\n";
push @outfile, "     output of \"ulimit -a\"\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting information returned by \'ulimit -a\'...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ulimit -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ulimit -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ulimit -a >&1\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    
    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ulimit -a >&1`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ulimit -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ulimit -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ulimit -a\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ulimit -a`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
}

print "...Done\n";

#********************************************************
#*  2.4.  File system ( Space and mounted file systems)
#********************************************************

#######################################################
# append information about the file system to @outfile
#######################################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"File_system1\"> <h2>\n\n";
push @outfile, "     File system ( Space and mounted file systems)\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "reading file system information...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: df -k 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `df -k 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: mount 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `mount 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: df -k 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `df -k 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: mount 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `mount 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: df -k 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `df -k 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: mount -p 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `mount -p 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: df -b 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `df -b 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: df> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `df 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: mount 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `mount 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
}

print "...Done\n";

#**********************************
#*  2.5.  File system consistency
#**********************************

#############################################
# append File system consistency to @outfile
#############################################

push @outfile, "\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"file_system_consistency\"> <h2>\n\n";
push @outfile, "     File system consistency\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "checking file system consistency...\n";

# decide whether to skip fsck or not
if ($ARGV[0]=~/fsck/i) {$s="n";} else {$s="y";}
if(($s eq "n") or ($s eq "no") or ($s eq "N")){
  SWITCH: {
    if ($OSid == 10 ){                  # AIX
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: fsck -n 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    
      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `fsck -n 2> $ERRORFILENAME`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
      last SWITCH;
    }
    if ($OSid == 20){                  # Linux
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: fsck -AN 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `fsck -AN 2> $ERRORFILENAME`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
      last SWITCH;
    }
    if ($OSid == 30){                  # SunOS
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: fsck -N 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `fsck -N 2> $ERRORFILENAME`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
      last SWITCH;
    }
    if ($OSid == 40){                  # HP-UX
      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: fsck -N 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

      push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      push @outfile, `fsck -N 2> $ERRORFILENAME`."\n";
      push @outfile, "\n<!-- OUTPUT --></PRE>\n";
      errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
      
      last SWITCH;
    }
  }

  print "...Done\n";
}
else{
  push @outfile, "= Skipped =\n";
  push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
  print "...Skipped\n";
}


#***********************
#*  2.6.  memory usage
#***********************

##################################
# append memory usage to @outfile
##################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"memory_usage\"> <h2>\n\n";
push @outfile, "     memory usage\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting memory usage...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: svmon 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `svmon 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: free\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `free`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat /proc/meminfo\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat /proc/meminfo`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: prstat 2 1 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `prstat 2 1 2> $ERRORFILENAME`;
    push @outfile, "\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: prtconf | grep Mem 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `prtconf | grep Mem 2> $ERRORFILENAME`;
    push @outfile, "\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: top -d 1 -f $TEMPFILENAME (Note: output was modified by script and collect.temp was removed afterwards)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    `top -d 1 -f $TEMPFILENAME`;
    if(open(TEMPFILE, $TEMPFILENAME)){
      foreach $s (<TEMPFILE>){
        if($s =~ /Memory/){
          push @outfile, $s;
					last;
        } 
      }
      close(TEMPFILE);
    }
    `rm $TEMPFILENAME 2> /dev/null`;
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swapinfo 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swapinfo 2> $ERRORFILENAME`;
    push @outfile, "\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
	last SWITCH;
  }
}

print "...Done\n";

#********************
#*  2.7.  cpu usage
#********************

##############################
# append cpu usage to outfile
##############################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"cpu_usage\"> <h2>\n\n";
push @outfile, "     cpu usage\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting cpu usage...\n";

	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: uptime\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, `uptime`."\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

#**************************
#*  2.8.  cpu information
#**************************

#####################################
# append cpu-information to @outfile
#####################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"cpu_information\"> <h2>\n\n";
push @outfile, "     cpu information\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting cpu-information...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lsdev -Cc processor 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `lsdev -Cc processor 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lsdev -Cc processor | grep Processor | wc -l 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `lsdev -Cc processor | grep Processor | wc -l 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat /proc/cpuinfo 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat /proc/cpuinfo 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: cat /proc/cpuinfo | grep processor | wc -l 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `cat /proc/cpuinfo | grep processor | wc -l 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: psrinfo -v";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `psrinfo -v`;
    push @outfile, "\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: psrinfo -pv";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `psrinfo -pv`;
    push @outfile, "\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ioscan -fnC processor 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ioscan -fnC processor 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ioscan -fnC processor | grep processor | wc -l 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ioscan -fnC processor | grep processor | wc -l 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
}

print "...Done\n";

#******************************
#*  2.9.  date of last reboot
#******************************

#########################################
# append date of last reboot to @outfile
#########################################

push @outfile, "\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"date_of_last_reboot\"> <h2>\n\n";
push @outfile, "     date of last reboot\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting date of last reboot...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: who -b\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `who -b`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: uptime\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `uptime`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: who -b\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `who -b`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: who -b\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `who -b`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
}

print "...Done\n";

#********************************
#*  2.10. processes-information
#********************************

###########################################
# append processes-information to @outfile
###########################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"processes-information\"> <h2>\n\n";
push @outfile, "     processes-information\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting processes-information...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ps -ef\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ps -ef`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ps -ef\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ps -ef`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: top -n 1 -b\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `top -n 1 -b`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ps -ef\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ps -ef`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ps -ef\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `ps -ef`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

   
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: top -d 1 -n 500 -f $TEMPFILENAME  (Note: $TEMPFILENAME was removed afterwards)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
      `top -d 1 -n 500 -f $TEMPFILENAME`;
    
      if(open(TEMPFILE, $TEMPFILENAME)){
        push @outfile, <TEMPFILE>;
        close(TEMPFILE);
      }
      `rm $TEMPFILENAME 2> /dev/null`;
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
   
    last SWITCH;
  }
}

print "...Done\n";

#**********************************
#*  2.11. installed java-packages
#**********************************

#############################################
# append installed java-packaces to @outfile
#############################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"java1\"> <h2>\n\n";
push @outfile, "     installed java-packages\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting installed java-packages...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lslpp -l '*[Jj[Aa][Vv][Aa]*'\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `lslpp -l '*[Jj[Aa][Vv][Aa]*'`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: rpm -qa | grep [Jj][Aa][Vv][Aa]\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `rpm -qa | grep [Jj][Aa][Vv][Aa]`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
 if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: pkginfo -x (Note: only the java-packages were added to output-file)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # the following command shows all installed packages
    # there are two lines per package.
    # in the second line you can find the version
    @outtemp = `pkginfo -x`;
    # append every line containing java (not case-sensitive) and the following line to @outtemp
    $nexttoo = "";
    foreach $s (@outtemp){
      if($nexttoo){
        push @outfile, $s;
        $nexttoo = 0;
      }
      elsif($s =~ /[Jj][Aa][Vv][Aa]/){
        push @outfile, $s;
				$nexttoo = 1;
      }
    }
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swlist | grep [Jj][Aa][Vv][Aa]\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swlist | grep [Jj][Aa][Vv][Aa]`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    last SWITCH;
  }
}

print "...Done\n";

#*****************************************
#*  2.12. java-installations and version
#*****************************************

#####################################################
# append java-installations and versions to @outfile
#####################################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"java2\"> <h2>\n\n";
push @outfile, "     java-installations and versions\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting java-versions...\n";

	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: java -version 2>&1\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, `java -version 2>&1`."\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

	
	# find all files named "java" in directorys /usr/java*
	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: find /usr/java* -name java (Note: the output is not added to outfile but processed by the script)\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
	@outtemp = `find /usr/java* -name java`;
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


	foreach $s (@outtemp){
		chop($s);
		# execute only, if there is /bin/java in path
		if($s =~ /bin\/java/){
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: $s -version 2>&1\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `$s -version 2>&1`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		}
	}

print "...Done\n";

#***************************
#*  2.13. user-information
#***************************

######################################
# append user-information to @outfile
######################################

push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"user-information\"> <h2>\n\n";
push @outfile, "     user-information\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting user-information...\n";

	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: cat /etc/passwd\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, `cat /etc/passwd`."\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

	push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
	push @outfile, "Executing: cat /etc/group\n";
	push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

	push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
	push @outfile, `cat /etc/group`."\n";
	push @outfile, "\n<!-- OUTPUT --></PRE>\n";
	push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

print "...Done\n";

#************************************
#*  2.14. ethernet card information
#************************************

###############################################
# append ethernet card information to @outfile
###############################################

push @outfile, "\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  <a name=\"ethernet_card_information\"> <h2>\n\n";
push @outfile, "     ethernet card information\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting ethernet card information...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: netstat -v 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `netstat -v 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ifconfig 2>$ERRORFILENAME (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
		@outtemp = `ifconfig 2>$ERRORFILENAME`;
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


		foreach $s (@outtemp){
			if ($s =~ /eth/){
				$s = (split(' ', $s))[0];
				push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
				push @outfile, "Executing: ethtool $s 2> $ERRORFILENAME\n";
				push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

				push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
				push @outfile, `ethtool $s 2> $ERRORFILENAME`."\n";
				push @outfile, "\n<!-- OUTPUT --></PRE>\n";
				errorhandling();
				push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			}
		}
		
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: /usr/sbin/dladm show-dev 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/sbin/dladm show-dev 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: kstat -p :::link_duplex :::ifspeed 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `kstat -p :::link_duplex :::ifspeed 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
  
    last SWITCH;
  }
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lanscan -p 2>$ERRORFILENAME (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
		@outtemp = `lanscan -p 2>$ERRORFILENAME`;
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


		foreach $s (@outtemp){
			chomp($s);
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: lanadmin -x $s 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `lanadmin -x $s 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
  }
  last SWITCH;
  }
}

print "...Done\n";

#***************************************
#*  2.15. system swap area information
#***************************************

##################################################
# append system swap area information to @outfile
##################################################

push @outfile, "\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  <a name=\"system_swap_area_information\"> <h2>\n\n";
push @outfile, "     system swap area information\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "getting system swap area information...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: lsps -a 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `lsps -a 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  top -n 1 | grep Swap 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `top -n 1 -b | grep Swap 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  swapon -s 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swapon -s 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swap -s 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swap -s 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
  
	
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swap -l 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swap -l 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	
    last SWITCH;
  }	
	if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: swapinfo -t 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `swapinfo -t 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
		errorhandling();
    push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
  
    last SWITCH;
  }
	
}

print "...Done\n";

#*******************************************************
#*  2.16. dynamic dependencies of TSM executable files
#*******************************************************

##################################################################
# append dynamic dependencies of TSM executable files to @outfile
##################################################################

push @outfile, "\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  <a name=\"dynamic_dependencies_of_TSM_executable_files\"> <h2>\n\n";
push @outfile, "     dynamic dependencies of TSM executable files\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "checking dynamic dependencies of TSM executable files...\n";

SWITCH: {
  if ($OSid == 10){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmc 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmc 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmcad 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmcad 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmagent 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmagent 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmadmc 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmadmc 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmtca 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmtca 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
  if (($OSid == 20) or ($OSid == 30)){                  # Linux, SunOS
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmc 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmc 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmcad 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmcad 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmagent 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmagent 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmadmc 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmadmc 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/bin/ldd /usr/bin/dsmtca 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/bin/ldd /usr/bin/dsmtca 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
	if ($OSid == 40){                  # HP-UX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/ccs/bin/ldd /usr/bin/dsmc 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/ccs/bin/ldd /usr/bin/dsmc 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/ccs/bin/ldd /usr/bin/dsmcad 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/ccs/bin/ldd /usr/bin/dsmcad 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/ccs/bin/ldd /usr/bin/dsmagent 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/ccs/bin/ldd /usr/bin/dsmagent 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/ccs/bin/ldd /usr/bin/dsmadmc 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/ccs/bin/ldd /usr/bin/dsmadmc 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
		
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  /usr/ccs/bin/ldd /usr/bin/dsmtca 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `/usr/ccs/bin/ldd /usr/bin/dsmtca 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		
    last SWITCH;
  }
}

print "...Done\n";

#*************************************
#*  2.17. c++ shared library version
#*************************************

################################################
# append c++ shared library version to @outfile
################################################

push @outfile, "\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  <a name=\"c++_shared_library_version\"> <h2>\n\n";
push @outfile, "     c++ shared library version\n\n";
push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

print "checking c++ shared library version...\n";

SWITCH: {
  if ($OSid == 10 ){                  # AIX
    push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing:  what /usr/lib/libC.a | grep Version | head -1 2> $ERRORFILENAME\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    push @outfile, `what /usr/lib/libC.a | grep Version | head -1 2> $ERRORFILENAME`."\n";
    push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    		
    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: /usr/bin/ldd /usr/bin/dsmc | grep c++ 2> $ERRORFILENAME (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
		@outtemp = `/usr/bin/ldd /usr/bin/dsmc | grep c++ 2> $ERRORFILENAME`;
		errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


		foreach $s (@outtemp){
			$s = (split(' ', $s))[0];
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: ls -l /usr/lib/ | grep $s 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ls -l /usr/lib/ | grep $s 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		}

    last SWITCH;
  }
	if ($OSid == 30){                  # SunOS
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: ls /usr/lib/ | egrep 'libCrun|libCstd' 2> $ERRORFILENAME (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
		@outtemp = `ls /usr/lib/ | egrep 'libCrun|libCstd' 2> $ERRORFILENAME`;
		errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


		foreach $s (@outtemp){
			chomp($s);
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: /usr/ccs/bin/mcs -p /usr/lib/$s | grep RELEASE 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `/usr/ccs/bin/mcs -p /usr/lib/$s | grep RELEASE 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
		}
		
    last SWITCH;
  }
	if ($OSid == 40){                  # HP-UX
		push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    push @outfile, "Executing: /usr/ccs/bin/ldd /usr/bin/dsmc | egrep 'libc.|libcl.|libCsup.|libstream.' 2> $ERRORFILENAME (Note: the output is not added to outfile but processed by the script)\n";
    push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
    @outtemp = `/usr/ccs/bin/ldd /usr/bin/dsmc | egrep 'libc.|libcl.|libCsup.|libstream.' 2> $ERRORFILENAME`;
		errorhandling();
		push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

		# in the different HP versions the libraries and their links are displayed differently
		# find out in which way the libraries are displayed
		$r = "";
		foreach $s (@outtemp){
			@s = split(' ', $s);
			foreach $s (@s){
				# if it's the first element
				if ($r eq ""){
					$r = $s;
					# if the first element contains a slash
					if ($r =~ /\//){
						$is_slash = 1;
						push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
						push @outfile, "Executing: what $s 2> $ERRORFILENAME\n";
						push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

						push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
						push @outfile, `what $s 2> $ERRORFILENAME`."\n";
						push @outfile, "\n<!-- OUTPUT --></PRE>\n";
						errorhandling();
						push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
					}
					else{
						$is_slash = 0;
					}
				}
				else{
					# ignore the linksymbol =>
					if ($is_slash and $s !~ /\>/){
						if($r =~ /\//){
							# could be set to any string that isn't empty and doesn't contain a slash
							$r = "nothing";
						}
						else{
							$r = $s;
							push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
							push @outfile, "Executing: what $s 2> $ERRORFILENAME\n";
							push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

							push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
							push @outfile, `what $s 2> $ERRORFILENAME`."\n";
							push @outfile, "\n<!-- OUTPUT --></PRE>\n";
							errorhandling();
							push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
						}
					}
					else{
						if ($s =~ /\//){
							push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
							push @outfile, "Executing: what $s 2> $ERRORFILENAME\n";
							push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

							push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
							push @outfile, `what $s 2> $ERRORFILENAME`."\n";
							push @outfile, "\n<!-- OUTPUT --></PRE>\n";
							errorhandling();
							push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
						}
					}
				}
			}	
		}

    last SWITCH;
  }
}

print "...Done\n";

#**********************************************
#**********************************************
#** 3.  Operation System specific information
#**********************************************
#**********************************************

push @outfile, "\n\n\n\n<!-- ########################################### --> <a name=\"Operating_System_specific_information\"><h1>\n\n";
push @outfile, "     Operation System specific information\n\n";
push @outfile, "<!-- ########################################### -->  </h1>\n\n";

#####################################################################################
# the following lines collect different information depending on which OS is running
#####################################################################################

SWITCH: {
  if ($OSid == 10 ){                  # AIX
		push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"list_of_all_installed_interim_fixes\"> <h2>\n\n";
    push @outfile, "     list of all installed interim fixes\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";
    
		print "getting list of all installed interim fixes...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: /usr/sbin/emgr -l\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `/usr/sbin/emgr -l`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";
    
    push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"HACMP_version_if_installed\"> <h2>\n\n";
    push @outfile, "     HACMP version if installed\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";
    
		print "getting HACMP version if installed...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: lslpp -l cluster.license 'rsct.*.hacmp'\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `lslpp -l cluster.license \'rsct.*.hacmp\' 2>&1`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";

    last SWITCH;
  }
  if ($OSid == 20){                  # Linux
    push @outfile, "No $OSname specific information is needed.\n";
    push @outfile, "\n<!-- -------------- --> <br> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    # nothing to do

    last SWITCH;
  }
  if ($OSid == 30){                  # SunOS
    push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"list_of_all_installed_packages\"> <h2>\n\n";
    push @outfile, "     list of all installed packages\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "getting list of all installed packages...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: pkginfo -x\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `pkginfo -x`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";

			push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"list_of_all_installed_patches\"> <h2>\n\n";
			push @outfile, "     list of all installed patches\n\n";
			push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "getting list of all installed patches...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: patchadd -p\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `patchadd -p`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";

    push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"kernel_messages\"> <h2>\n\n";
    push @outfile, "     kernel messages\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "reading kernel messages...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: cat /var/adm/messages*\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `cat /var/adm/messages*`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";

    push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"Size_of_TSM_libraries_and_executables_link\"> <h2>\n\n";
    push @outfile, "     Size of TSM libraries and executables + link\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "reading size of TSM libraries and executables...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: ls -lR /opt/tivoli/tsm/client\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ls -lR /opt/tivoli/tsm/client`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";

    print "checking links to TSM...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: ls -l /usr/lib/libApiDS.so 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ls -l /usr/lib/libApiDS.so 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";


			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: ls -l /usr/lib/sparcv9/libApiDS64.so 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ls -l /usr/lib/sparcv9/libApiDS64.so 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";

    push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"Settings_of_network_cards\"> <h2>\n\n";
    push @outfile, "     Settings of network card(s)\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "checking settings of network card(s)...\n";

      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: ifconfig -a 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `ifconfig -a 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			
		print "...Done\n";
  
		push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"Non_global_zones_information\"> <h2>\n\n";
    push @outfile, "     Non-global zones information\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "getting non-global zones information...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing:  zoneadm list -cpi 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `zoneadm list -cpi 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

			
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing:  zonename 2> $ERRORFILENAME\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `zonename 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			
			
			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing:  zoneadm list -c 2> $ERRORFILENAME (Note: the output is not added to outfile but processed by the script)\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";
			# get names of the non-global zones
			@outtemp = `zoneadm list -c 2> $ERRORFILENAME`;
			errorhandling();
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			
			foreach $s (@outtemp){
			chomp($s);
				if ($s !~ /global/){
					push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
					push @outfile, "Executing: zonecfg -z $s info 2> $ERRORFILENAME\n";
					push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

					push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
					push @outfile, `zonecfg -z $s info 2> $ERRORFILENAME`."\n";
					push @outfile, "\n<!-- OUTPUT --></PRE>\n";
					errorhandling();
					push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
				}
			}
			
    print "...Done\n";
		
		push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"output_of_cat_etc_system\"> <h2>\n\n";
    push @outfile, "     output of cat /etc/system\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "getting output of cat /etc/system...\n";

      push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
      push @outfile, "Executing: cat /etc/system 2> $ERRORFILENAME\n";
      push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `cat /etc/system 2> $ERRORFILENAME`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			errorhandling();
      push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
			
		print "...Done\n";
    
		last SWITCH;
	}
  if ($OSid == 40){                  # HP-UX
    push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"list_of_all_installed_packages\"> <h2>\n\n";
    push @outfile, "     list of all installed packages\n\n";
    push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

    print "getting list of all installed packages...\n";

			push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
			push @outfile, "Executing: swlist\n";
			push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

			push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
			push @outfile, `swlist`."\n";
			push @outfile, "\n<!-- OUTPUT --></PRE>\n";
			push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";

    print "...Done\n";
  
    last SWITCH;
  }
}

########################
# END: COLLECT SECTIONS
########################


#######################
# START: FINAL SECTION
#######################

########################################
# write @outfile to file "collect.data"
########################################

print "writing information to file \"collect.data.html\"...\n";

	# collect.data.html should renamed to collect.data.$OSname.html for testing purposes
	open(OUTFILE, ">collect.data.html") or die print "file error!\n";
	print OUTFILE @outfile;
	close(OUTFILE);

print "...Done\n";


# remove temporary errorfile
print "removing temporary file \"$ERRORFILENAME\"...\n";
	`rm $ERRORFILENAME 2> /dev/null`;
print "...Done\n";

print "Complete!\n";


#####################
# END: FINAL SECTION
#####################

exit 0;

###################################
#                    END OF SCRIPT
###################################


# # the following lines are samples how to extend the script

# # sample for a universal collect section

# #*****************************************************
# #*  <section number>.<subsection number>.  < topic >
# #*****************************************************

# ###############################################
# # append information about <topic> to @outfile
# ###############################################

# push @outfile, "\n\n\n\n<!-- +++++++++++++++++++++++++++++++++++++++++++ --> <a name=\"topic\"> <h2>\n\n";
# push @outfile, "     < topic >\n\n";
# push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

# print "getting information about <topic>...\n";

    # push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    # push @outfile, "Executing: command\n";
    # push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    # push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # push @outfile, `command`."\n";
    # push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    # push @outfile, "\n<!-- -------------- --> <hr> <!-- -------------- -->\n";

# print "...Done\n";

# # END: sample for a universal collect section

# # sample for a special collect section

# #***************************************************
# #*  <section number>.<subsection number>.  <topic>
# #***************************************************

# ###############################################
# # append information about <topic> to @outfile
# ###############################################

# push @outfile, "\n<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  <h2>\n\n";
# push @outfile, "     <topic>\n\n";
# push @outfile, "<!-- +++++++++++++++++++++++++++++++++++++++++++ -->  </h2>\n";

# push @outfile, "\n== <topic> ==\n\n";

# print "getting information about <topic>...\n";

# SWITCH: {
  # if ($OSid == 10 ){                  # AIX
    # push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    # push @outfile, "Executing: command 2> $ERRORFILENAME\n";
    # push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    # push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # push @outfile, `command 2> $ERRORFILENAME`."\n";
    # push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    # errorhandling();
    # push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    # last SWITCH;
  # }
  # if ($OSid == 20){                  # Linux
    # push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    # push @outfile, "Executing: command 2> $ERRORFILENAME\n";
    # push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    # push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # push @outfile, `command 2> $ERRORFILENAME`."\n";
    # push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    # errorhandling();
    # push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    # last SWITCH;
  # }
  # if ($OSid == 30){                  # SunOS
    # push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    # push @outfile, "Executing: command 2> $ERRORFILENAME\n";
    # push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    # push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # push @outfile, `command 2> $ERRORFILENAME`."\n";
    # push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    # errorhandling();
    # push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
    
    # last SWITCH;
  # }
  # if ($OSid == 40){                  # HP-UX
    # push @outfile, "\n<!-- COMMAND --><PRE><b>\n\n";
    # push @outfile, "Executing: command 2> $ERRORFILENAME\n";
    # push @outfile, "\n<!-- COMMAND --></b></PRE>\n";

    # push @outfile, "\n<!-- OUTPUT --><PRE>\n\n";
    # push @outfile, `command 2> $ERRORFILENAME`."\n";
    # push @outfile, "\n<!-- OUTPUT --></PRE>\n";
    # errorhandling();
    # push @outfile, "\n<!-- -------------- --> <a href=\"#top\">[Jump to top]</a><hr> <!-- -------------- -->\n";
	 
    # last SWITCH;
  # }
# }

# print "...Done\n";

# # END: sample for a special collect section




