본문 바로가기

Linux

[Linux] 리눅스 서버 하드웨어 정보 확인 프로그램

리눅스 서버를 항상 만지고 있지만, 언제나 불만인건 이놈의 OS는 어디다 HW의 정보를 쳐박아 두는지 확인을 못한다는거였다..

리눅스의 경우 HW의 특성을 타기때문에 여러대의 서버를 관리하는 입장에서는 HW 정보를 확실히 알아두고 그에 따른 A/S용 OS디스크를 만들어 놔야 하기에 -_-  HW정보는 꼭 필요했다..

머 미리 준비할꺼였다면, 설치할때부터 HW정보를 확인하면 되겠지만, 이미 서비스가 되고 있는 서버들을 끄고 확인할수는 없기에 Linux 상에서 정보를 찾아야만 했당..

그런 나에게 빛이되준 프로그램이 하나 있었으니..

바로 LSHW 라는 프로그램이다...

사용법은 아주 간단하다..

RPM으로된 LSHW를 깔고 쉘상에서 lshw만 쳐주면 정보들이 나온다..

================
     INSTALL
================
homepage : http://ezix.org/project/wiki/HardwareLiSter

위 홈페이지에 들어가 자신의 서버에 맞는 RPM 패키지 또는 소스를 다운받아 설치를 시작합니다.

* unpack the source code :
  tar xvfz lshw-release.tar.gz

* Compile it :
cd lshw-release
make

#GUI 모드로 사용하고자 할 경우 아래와 같이 make 합니다.
make gui

* RPM Package Build
rpmbuild -ta lshw-release.tar.gz

#GUI 모드로 사용하고자 할 경우 아래와 같이 RPMBuild 합니다.
rpmbuild -ta --with gui lshw-release.tar.gz

※ 설치시 libstdc++ 관련 라이브러리가 필요 할 수 있습니다.

================
     USAGE
================
Hardware Lister (lshw) - B.02.09
usage: lshw [-format] [-options ...]
      lshw -version
       -version        print program version (B.02.09)
format can be
       -html           output hardware tree as HTML
       -xml            output hardware tree as XML
       -short          output hardware paths
       -businfo        output bus information
options can be
       -class CLASS    only show a certain class of hardware
       -C CLASS        same as '-class CLASS'
       -disable TEST   disable a test (like pci, isapnp, cpuid, etc. )
       -enable TEST    enable a test (like pci, isapnp, cpuid, etc. )


사용법은 간단합니다.
rpm 또는 소스 설치후 쉘 상에서 lshw 를 실행하면 해당 리눅스 시스템의 HW 정보가 나오게 되어 있습니다. 이를 xml이나 html로 내보내기 할 수도 있습니다.

* EX 1)
[root@www sbin]# lshw -short

H/W path       Device  Class      Description
=============================================
                      system     Computer
/0                     bus        D845GRG
/0/0                   memory     64KB BIOS
/0/4                   processor  Intel(R) Pentium(R) 4 CPU 1.80GHz
/0/4/5                 memory     8KB L1 cache
/0/4/6                 memory     512KB L2 cache
/0/2f                  memory     512MB System Memory
/0/2f/0                memory     512MB DIMM DDR Synchronous 266 MHz (3.8 ns)
/0/2f/1                memory     DIMM DDR Synchronous 266 MHz (3.8 ns) [empty]
/0/100                 bridge     82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface
/0/100/2               display    82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device
/0/100/1d              bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
/0/100/1d/1    usb2    bus        UHCI Host Controller
/0/100/1d.1            bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2
/0/100/1d.1/1  usb3    bus        UHCI Host Controller
/0/100/1d.2            bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3
/0/100/1d.2/1  usb4    bus        UHCI Host Controller
/0/100/1d.7            bus        82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
/0/100/1d.7/1  usb1    bus        EHCI Host Controller
/0/100/1e              bridge     82801 PCI Bridge
/0/100/1e/8    eth0    network    82801DB PRO/100 VE (LOM) Ethernet Controller
/0/100/1f              bridge     82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge
/0/100/1f.1            storage    82801DB (ICH4) IDE Controller
/0/100/1f.3            bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller


* EX 2)
[root@www sbin]# lshw -businfo

Bus info          Device  Class      Description
================================================
                         system     Computer
                         bus        D845GRG
                         memory     64KB BIOS
cpu@0                     processor  Intel(R) Pentium(R) 4 CPU 1.80GHz
                         memory     8KB L1 cache
                         memory     512KB L2 cache
                         memory     512MB System Memory
                         memory     512MB PartNum1
                         memory     PartNum2
pci@0000:00:00.0          bridge     82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface
pci@0000:00:02.0          display    82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device
pci@0000:00:1d.0          bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
usb@2             usb2    bus        UHCI Host Controller
pci@0000:00:1d.1          bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2
usb@3             usb3    bus        UHCI Host Controller
pci@0000:00:1d.2          bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3
usb@4             usb4    bus        UHCI Host Controller
pci@0000:00:1d.7          bus        82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
usb@1             usb1    bus        EHCI Host Controller
pci@0000:00:1e.0          bridge     82801 PCI Bridge
pci@0000:01:08.0  eth0    network    82801DB PRO/100 VE (LOM) Ethernet Controller
pci@0000:00:1f.0          bridge     82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge
pci@0000:00:1f.1          storage    82801DB (ICH4) IDE Controller
pci@0000:00:1f.3          bus        82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller

html과 xml로 내보내기 한 화면은 캡쳐화면으로 준비했으니 참고하시기 바랍니다.

* EX 3) html 내보내기 결과
사용자 삽입 이미지

* EX4 ) xml 내보내기 결과
사용자 삽입 이미지

사용법은 매우 간단하므로 하드웨어 정보가 필요 하다면 한번쯤 설치해서 정보를 확인해 보는것도 좋을것 같다.



참조 :
1) http://2cpu.co.kr/zboard/zboard.php?id=tiptech&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=name&desc=asc&no=66

2) http://ezix.org/project/wiki/HardwareLiSter