ServDoc_0010hardware--hpux - describe the hardware of your system
$Id: ServDoc_0010hardware--hpux,v 1.11 2004/02/22 21:25:10 uherbst Exp $
ServDoc_0010hardware--hpux [-h|help] [-v|version] [--debug HW,intensity]
ServDoc_0010hardware--hpux 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--hpux,v 1.11 2004/02/22 21:25:10 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--hpux is running.', model => 'Hardware%%+Model', model_short => "output from 'model'", model_long => "", bit => 'Hardware%%+32/64 bit', bit_short => '32bit Kernel ? 64bit Hardware ?', bit_long => '', cpu => 'Hardware%%+CPU%%+Number', cpu_short => "look at 'sar -M 1 1'", cpu_long => '', cpufreq => 'Hardware%%+CPU%%+Frequency', cpufreq_short=> 'Is part of \'echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm\'', cpufreq_long => '', ram => 'Hardware%%+RAM', ram_short => 'Is part of \'echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm\'', ram_long => "The physical amount of ram in your computer.", mod => "Hardware%%+Loaded kernel modules", mod_short => "Output from 'kmsystem'", mod_long => "", io => "Hardware%%+I/O devices", io_short => "Output from 'ioscan'", io_long => "", driver => "Hardware%%+device driver", driver_short => "Output from 'lsdev'", driver_long => "", crash => "Hardware%%+System crash dump config", crash_short => "Output from 'crashconf'", crash_long => "", ); %{$options->{lang}->{de}}= ( running => 'ServDoc_0010hardware--hpux läuft jetzt.', model => 'Hardware%%+Modell', model_short => "Ausgabe von 'model'", model_long => "", bit => 'Hardware%%+32/64 bit', bit_short => '32bit Kernel ? 64bit Hardware ?', bit_long => '', cpu => 'Hardware%%+CPU%%+Anzahl', cpu_short => "Ausgabe von 'sar -M 1 1'", cpu_long => '', cpufreq => 'Hardware%%+CPU%%+Taktfrequenz', cpufreq_short=> 'Steht in \'echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm\'' . 'mit drin.', cpufreq_long => '', ram => 'Hardware%%+RAM', ram_short => 'Steht in \'echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm\'' . 'mit drin.', ram_long => "Wieviel RAM ist in ihrem Rechner installiert ?", mod => "Hardware%%+geladene Kernelmodule", mod_short => "Output from 'kmsystem'", mod_long => "", io => "Hardware%%+I/O Geräte", io_short => "Ausgabe von 'ioscan'", io_long => "", driver => "Hardware%%+Gerätetreiber", driver_short => "Ausgave von 'lsdev'", driver_long => "", crash => "Hardware%%+System crash dump config", crash_short => "Ausgabe 'crashconf'", crash_long => "", ); debug( 9, i18n_mesg("running" )); #---------------------------------------------------------------------- # Main # Platform, model report_i18n("cmd",'model','model'); my $bits = do_cmd("getconf KERNEL_BITS 2>/dev/null") || 32; my $bits_capable = do_cmd("getconf HW_CPU_SUPP_BITS 2>/dev/null") || 32; chomp ($bits); chomp ($bits_capable); report_i18n("string","bit", "HP-UX 32/64 = $bits bits\n" . " Hardware capable = $bits_capable bits"); # CPU # report_i18n("cmd",'cpu', # "sar -M 1 1 | egrep -v 'system|HP-UX|cpu|^\$' | wc -l"); my @config = `echo "selall;info;wait;infolog;view;done" | /usr/sbin/cstm"`; my @dummy; @dummy = map {s/.*Processor Speed:\s*//; $_/1000/1000 ." MHz"} grep {/Processor Speed/} @config; report_i18n("string",'cpufreq',$dummy[0]) if ($dummy[0]); # RAM # 11.x @dummy = map {s/.*Total Configured Memory\s*:\s*//; chomp;$_} grep {/Total Configured Memory/} @config; report_i18n("string","ram",$dummy[0]) if ($dummy[0]); # Which kernelmodules report_i18n("cmd","mod","kmsystem"); # Which hardware ? report_i18n('cmd','io','ioscan',UID=>0); report_i18n('cmd','driver','lsdev'); # System crash dump configuration report_i18n('cmd','crash','crashconf'); exit 0;