랜카드 정보를 보려고 하는데...

zzaratra의 이미지

랜카드 디바이스를 아큐먼트에 넣으면 디바이스 정보를 얻을수 있도록 하고 싶은데요.. 가장 쉬운 방법은 무엇일까요..

input > eth0
output :3Com Corporation 3c985 1000BaseSX (SX/TX)

아무 방법이나 다 괜찮거든요...

dmesg 로 봤을때의 ethnet 순서하고 /proc/pci 에 나온 ethernet 순서 하고 다르더라구요...

zzaratra의 이미지

순서를 앞에 놓기 위해.. ^^ 죄송...

ethtool 이란 프로그램이 있더라구요... 랜카드에 대한 설정을 변경 시켜 주는 프로그램이더군요.. 랜카드에 대한 정보도 보여주고
근데..보여 주는 정보가

$ ethtool -i eth0
driver: e100
version: 2.2.21-k1
firmware-version: N/A
bus-info: 00:0c.0

이정도 이던데.. 전 "3Com Corporation 3c985 1000BaseSX (SX/TX)" 이런 모델명이 나오기를 원하거든요..

아니면 /proc/pci 에 나온 내용하고 eth(X) 하고 매칭 시키려면 어떻게 하나요...

/usr/include/linux/ethtool.h 파일을 보면 랜카드를 정보를 보거나 설정할수 있도록 되어있지만... 모델명을 볼수 있도록은 제공하는것 같지 않아서요...

제가 원하는것은

eth0 : 3Com Corporation 3c985 1000BaseSX (SX/TX)
eth1 : 3Com Corporation 3c905B 100BaseTX [Cyclon]

ez8의 이미지

뭔가 허접하지만 올려봅니다.
정말 간단하게 만든거라, 쉘스크립트입니다.

#!/bin/sh

if [ $# -lt "1" ]
then
    result=`dmesg | grep eth0 | grep IRQ`
else
    result=`dmesg | grep $1 | grep IRQ`
fi

echo $result

집에 있는 컴퓨터 dmesg 보면서 만든거라 안 맞을지도 모르겠네요.
비슷한 식으로 여러가지 필요한 기능 추가하면 될 듯 싶습니다.

zzaratra의 이미지

dmesg 를 보면서 하려고 했었는데..

이게 경우마다 다 다르더라구요..

3Com 같은 경우에는 eth0 인 경우에는 eth0: 이런 식이 아니더라구요
$dmesg |grep 3Com
00:10.0: 3Com PCI 3c905B Cyclone 100baseTx at 0xb800. Vers LK1.1.16
eth1: 3Com 3C985 Gigabit Ethernet at 0xf3800000, irq 10
eth2: 3Com 3C985 Gigabit Ethernet at 0xf3000000, irq 5

근데 intel 경우에는 또 다르구요...

$dmesg
eth0: Dropping NETIF_F_SG since no checksum feature.
eth0: HP Gigabit Ethernet Server Adapter
Intel(R) PRO/100 Network Driver - version 2.2.21-k1
Copyright (c) 2003 Intel Corporation

e100: selftest OK.
e100: eth1: Intel(R) PRO/100 Network Connection
Hardware receive checksums enabled
cpu cycle saver enabled

eepro100.c:v1.09j-t 9/29/99 Donald Becker http://www.scyld.com/network/ee

이렇게

찾기가 애매 하더라구요.. 눈으로 봐서는 알겠지만.. 특정한 형태가 없어서요..

/proc/pci 의 랜카드 정보 순서도 eth(x) 순서도 아니구요...

mach의 이미지

zzaratra wrote:

찾기가 애매 하더라구요.. 눈으로 봐서는 알겠지만.. 특정한 형태가 없어서요..

snmp agent를 살펴보심이 좋을듯

------------------ P.S. --------------
지식은 오픈해서 검증받아야 산지식이된다고 동네 아저씨가 그러더라.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.