Friday, September 10, 2010

Trace Hardware information of your System..lshw will do the magic for us

Sometimes you learn things while watching update of your system. Some days back I saw that "lshw" was one of the items that was getting updated. So, I pulled up its man page to see what it's about...Now, there are quite a few ways to look at system information, but lshw is a handy way to look at many things at once, and will give you information that other utilities won't...It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines. If you're running an Ubuntu system, you don't have to do anything; it's already installed by default.

If you're running a Red Hat-type system, such as CentOS, StartCom, Fedora, etc., you'll need to first install the Dag Wieers/rpmforge repository. Then, use your favorite package manager to install lshw.

What It Can Show You

"lshw" will show you lots of system information. We'll just look at a few example excerpts from its output.
Here, we're looking at the introductory information in the first stanza of output. This gives a general description of the system.
Here, we're looking at information about the system's CPU.

[root@top2 ~]# lshw
top2
description: Desktop Computer
product: H8SMI
vendor: Supermicro
version: 1234567890
serial: 1234567890
width: 64 bits
capabilities: smbios-2.4 dmi-2.4 vsyscall64 vsyscall32
configuration: boot=normal chassis=desktop uuid=00020003-0004-0005-0006-000700080009

Here, we're looking at information about the system's CPU
*-cpu
description: CPU
product: Quad-Core AMD Opteron(tm) Processor 1385
vendor: Advanced Micro Devices [AMD]
physical id: 3
bus info: cpu@0
version: Quad-Core AMD Opteron(tm) Processor 1385
serial: To Be Filled By O.E.M.
slot: CPU 1
size: 2700MHz
capacity: 2700MHz
width: 64 bits
clock: 200MHz
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp x86-64 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt cpufreqThe terminology is a bit weird, with the way it outputs CPU speed as "size", but it still gets the right idea across.

Now, let's scroll down and look at memory information. You can see which slots are filled, and what kind of memory stick is in each slot. You can also see the total memory capacity of your motherboard.

*-memory:0
description: System Memory
physical id: 25
slot: System board or motherboard
size: 16GiB
*-bank:0
description: DIMM DDR2 Synchronous
product: PartNum0
vendor: Manufacturer0
physical id: 0
serial: SerNum0
slot: DIMM0
size: 4GiB
width: 64 bits

*-bank:1
description: DIMM DDR2 Synchronous
product: PartNum1
vendor: Manufacturer1
physical id: 1
serial: SerNum1
slot: DIMM1
size: 4GiB
width: 64 bits

*-bank:2
description: DIMM DDR2 Synchronous
product: PartNum2
vendor: Manufacturer2
physical id: 2
serial: SerNum2
slot: DIMM2
size: 4GiB
width: 64 bits
Actually, you'll get a few screens worth of information with just one command. You'll also see detailed information about drives, display adapters, network adapters, etc. (Note, also, that you'll need to use root privileges in order to see all available information.)

May be is a good idea to forward the output to a text file

lshw > /tmp/hwoutput.txt

You can also format it as html or xml, ie:

lshw -html > /tmp/hwhtml.html

or

lshw -xml > /tmp/hwxml.xml

If you are going to make the info public, you can sanitize the output to hide ip address, serial numbers etc.

lshw -html -sanitize > /tmp/hwhtml.html


Note that this document comes without warranty of any kind. But every effort has been made to provide the information as accurate as possible. I welcome emails from any readers with comments, suggestions, and corrections at webmaster_at admin@linuxhowto.in

Copyright © 2012 LINUXHOWTO.IN


2 comments:

  1. Also we can use dmidecode to get the system as well bios information.

    ReplyDelete
  2. There have been changes made to panic devices over the years to improve the ease of use for ADA compliance and improve the overall safety of the general public.Wolf Of Canada

    ReplyDelete