ServDoc_0010hardware--solaris - describe the hardware of your system
$Id: ServDoc_0010hardware--solaris,v 1.4 2004/02/19 07:15:51 uherbst Exp $
ServDoc_0010hardware--solaris [-h|help] [-v|version] [--debug HW,intensity]
ServDoc_0010hardware--solaris describe the hardware of your system.
That should include:
The debug feature for that module is named ``HW''.
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--solaris,v 1.4 2004/02/19 07:15:51 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); debug( 9, i18n_std('running',$0)); my $h='Hardware%%+'; %{$options->{lang}->{en}}= ( model =>$h.'Hardware Model', model_short=>i18n_std('cmd','uname -mi'), model_long =>'', cpunr =>$h.'CPU%%+Number', cpunr_short=>i18n_std('cmd','psrinfo | wc -l'), cpunr_long =>'', typ =>$h.'CPU%%+Type', typ_short =>i18n_std('cmd','uname -p'), typ_long =>'', speed =>$h.'CPU%%+Speed', speed_short=>i18n_std('cmd','psrinfo -v'), speed_long =>'', ram =>$h.'RAM', ram_short =>i18n_std('cmd','prtconf | grep "Memory size"'), ram_long => '', mod =>$h.'Loaded kernel modules', mod_short =>i18n_std('cmd','modinfo'), mod_long =>'', hw =>$h.'Installed Hardware', hw_short =>i18n_std('cmd','prtconf -v'), hw_long =>'', dev =>$h.'Device Driver', dev_short =>i18n_std('cmd','sysdef -D'), dev_long =>'', conf =>$h.'System Configuration', conf_long =>'', ); %{$options->{lang}->{de}}= ( model =>$h.'Hardware Modell', model_short=>i18n_std('cmd','uname -mi'), model_long =>'', cpunr =>$h.'CPU%%+Anzahl', cpunr_short=>i18n_std('cmd','psrinfo | wc -l'), cpunr_long =>'', typ =>$h.'CPU%%+Typ', typ_short =>i18n_std('cmd','uname -p'), typ_long =>'', speed =>$h.'CPU%%+Takt', speed_short=>i18n_std('cmd','psrinfo -v'), speed_long =>'', ram =>$h.'RAM', ram_short =>i18n_std('cmd','prtconf | grep "Memory size"'), ram_long => '', mod =>$h.'Geladene Kernelmodule', mod_short =>i18n_std('cmd','modinfo'), mod_long =>'', hw =>$h.'Installierte Hardware', hw_short =>i18n_std('cmd','prtconf -v'), hw_long =>'', dev =>$h.'Device Driver', dev_short =>i18n_std('cmd','sysdef -D'), dev_long =>'', conf =>$h.'System Konfiguration', conf_long =>'', ); #---------------------------------------------------------------------- # Main # Platform, model report_i18n('cmd','model','uname -mi'); # CPU report_i18n('cmd','cpunr','psrinfo | wc -l'); report_i18n('cmd','typ','uname -p'); report_i18n('cmd','speed','psrinfo -v | grep MHz'); # RAM report_i18n('cmd','ram','prtconf | grep "Memory size"'); # Which kernelmodules report_i18n('cmd','mod','modinfo'); # Which hardware ? report_i18n('cmd','hw','prtconf -v'); report_i18n('cmd','dev','sysdef -D'); my $platform = do_cmd("uname -m"); chomp($platform); my $prtdiag="/usr/platform/" . $platform . "/sbin/prtdiag -v"; report_cmd(i18n_mesg('conf'), i18n_std('cmd',$prtdiag), i18n_mesg('conf_long'), $prtdiag); exit 0;