ServDoc_0010hardware--aix

Code Index:



NAME

ServDoc_0010hardware--aix - describe the hardware of your system


VERSION

$Id: ServDoc_0010hardware--aix,v 1.8 2003/08/12 20:18:19 uherbst Exp $


SYNOPSIS

ServDoc_0010hardware--aix [-h|help] [-v|version] [--debug HW,intensity]


DESCRIPTION

ServDoc_0010hardware--aix describe the hardware of your system.

That should include:

CPU
How many, how fast, what types ?

RAM
How many ?

Server-Typ
What model ?

IO-Controller, Disks
Which network cards ? How fast ?


OPTIONS

-h|help
This help.

-v|version
Version

--debug HW,intensity
Turn on Debugging for that module.

The debug feature for that module is named ``HW''.


AUTHORS

Ulrich Herbst <Ulrich.Herbst@gmx.de>


#!/usr/bin/perl -w

#----------------------------------------------------------------------

# standard perl modules
use strict;                       # print error about unknown variables ...
use English;                      # long internal variable names;
use FindBin;                      # In which directory is ServDoc itself ?
                                  # There has to be the module and the lib dir!
use lib $FindBin::Bin. "/lib";    # Here are the ServDoc-perl-modules
use vars qw($options);

# our own perl modules
use ServDoc;

#----------------------------------------------------------------------

$options->{Version} = '$Id: ServDoc_0010hardware--aix,v 1.8 2003/08/12 20:18:19 uherbst Exp $';

# We need the cmdline to call the modules with the same debug options.
$options->{cmdline} = join " ", @ARGV;

sub debug { ServDoc_debug( "HW", $options, shift, shift ); }

$options = &process_cmdline($options);

%{$options->{lang}->{en}}=
  (
   running         => 'ServDoc_0010hardware--aix is running',

   platform        => 'Hardware%%+Hardware Platform',
   platform_short  => "Output from 'bootinfo-T'",
   platform_long   => '',

   arch            => 'Hardware%%+Architecture/Implementation',
   arch_short      => "Output from 'lscfg | egrep\"Architecture|Implementation\"'",
   arch_long       => '',

   cpu             => 'Hardware%%+CPU%%+Number',
   cpu_short       => "You can get number of cpus with 'lscfg | grep proc'",
   cpu_long        => '',

   cputyp          => 'Hardware%%+CPU%%+Type',
   cputyp_short    => 
   "You can get the type of your cpu(s) with 'lsattr -E -l proc0'",
   cputyp_long     => 
   'But: on Systems with LPARs (eg the Regatta) is proc0 on just one LPAR '.
   'a valid device. In this case you have to look for a procx-device '.
   "with 'lscfg | grep proc' (yes, ServDoc does that for you!)",

   ram             => 'Hardware%%+RAM',
   ram_short       => "You can get the amount of ram with 'bootinfo -r'",
   ram_long        => "The physical amount of ram in your computer.",
   ram_out         => "%i MByte",

   mod             => 'Hardware%%+Loaded kernel extensions',
   mod_short       => 
   "You can get a list of the loaded kernelextensions with 'genkex'",
   mod_long        => "",

   hw              => "Hardware%%+Installed Hardware",
   hw_short        => 
   "You can get a list of your installed hardware with 'lscfg -pv'",
   hw_long         => "",

   dump            => 'Hardware%%+Sysdumpdevice',
   dump_short      => "'sysdumpdev -l' shows your actual sysdumpdevice",
   dump_long       => "",
  );
%{$options->{lang}->{de}}=
  (
   running         => 'ServDoc_0010hardware--aix startet jetzt.',
   platform        => 'Hardware%%+Hardware Plattform',
   platform_short  => "Ausgabe von 'bootinfo-T'",
   platform_long   => '',

   arch            => 'Hardware%%+Architektur/Implementierung',
   arch_short      => "Ausgabe von 'lscfg | egrep\"Architecture|Implementation\"'",
   arch_long       => '',

   cpu             => 'Hardware%%+CPU%%+Anzahl CPUs',
   cpu_short       => "'lscfg | grep proc' listet alle CPUs auf.",
   cpu_long        => '',

   cputyp          => 'Hardware%%+CPU%%+CPU-Typ',
   cputyp_short    => 
   "'lsattr -E -l proc0' zeigt den CPU-Typ an.",
   cputyp_long     => 
   'Allerdings ist bei partionierbaren Systemen (Regatta usw.) nur auf '.
   "einer LPAR ein Ger&auml;t proc0 vorhanden. GGf. ist hier mit " .
   "'lscfg | grep proc' das entsprechende Device zu ermitteln " .
   "(ja, ServDoc macht das automatisch!)",

   ram             => 'Hardware%%+RAM',
   ram_short       => "'bootinfo -r' zeigt die RAM-Gr&ouml;sse an.",
   ram_long        => "Wieviel RAM ist in ihrem Rechner installiert ?",
   ram_out         => "%i MByte",

   mod             => 'Hardware%%+geladene Kernel-Erweiterungen',
   mod_short       => 
   "'genkex' zeigt die geladenen Kernel-Module an",
   mod_long        => "",

   hw              => "Hardware%%+Installierte Hardware",
   hw_short        => 
   "'lscfg -pv' zeigt die erkannte Hardware an",
   hw_long         => "",

   dump            => 'Hardware%%+Sysdumpdevice',
   dump_short      => "'sysdumpdev -l' zeigt das aktuelle Sysdumpdevice an.",
   dump_long       => "",
  );

debug( 9, i18n_mesg('running'));

#----------------------------------------------------------------------

# Main

# Platform, model
report_i18n('cmd','platform',
	    "bootinfo -T",UID=>0
	   );
report_i18n('cmd','arch',
	    "lscfg | egrep \"Architecture|Implementation\""
	   );

# CPU
# lsattr -E -l proc0 doesn't eg work for a regatta because
# just one LPAR has proc0, the other LPARs have bigger numbers.
my @procs = map {s/.*(proc\d+).*/$1/;$_} 
            grep /proc\d/, 
            split /\n/,do_cmd("lscfg -v");
report_i18n('string','cpu',
	    $#procs+1);
report_i18n('cmd','cputyp',
	    "lsattr -E -l $procs[0] | grep type | awk '{print \$2}'");

# RAM
my $ram = do_cmd("bootinfo -r",0);
if ($ram) {
  $ram = $ram / 1024;
  report_i18n('string','ram',
	      i18n_mesg('ram_out',$ram)
	     );
}

# Which kernelmodules
report_i18n('cmd','mod','genkex');

# Which hardware ?
report_i18n('cmd','hw',
	    "lscfg -pv");

# Sysdumpdevice
report_i18n('cmd','dump',
	    "sysdumpdev -l",UID=>0);
exit 0;