Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a Linux tool to check hardware boards status?

In Windows you have the hardware dialog which shows you lines like "your hardware is working properly" (I don't have the English version so the string may actually be different, but you got the idea).

I'd like to check the same on Linux. Note that I know what hardware is installed but I need to know that the driver has been correctly loaded and that there are no errors. Since we are installing Linux on different PCs with the very same hardware we need a quick way to know that everything works after the installation. So if a board (say an ethernet card) isn't working for some reason I'd like to be notified about that.

I know I could use lsmod and dmesg but that is not very "quick". Maybe there is some magic file in /proc that tells me (per board basis) that everything is working properly for a given board?

Specifically I need to test the ethernet boards and the serial line status.

(the serial line driver is compiled directly into the kernel so lsmod isn't very handy here)

share|improve this question

2 Answers 2

up vote 1 down vote accepted

For ethernet interfaces you can use ethtool.

# ethtool -t eth0 online
The test result is PASS
The test extra info:
nvram test     (online)          0
link test      (online)          0
register test  (offline)         0
memory test    (offline)         0
loopback test  (offline)         0
interrupt test (offline)         0

This runs a self test, but depends on proper support in your hardware and driver. You can also just get its status.

# ethtool  eth0 
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: g
        Wake-on: g
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

This tells you the connection parameters, and link status.

For serial lines, the udev rules will load the driver and it will register device nodes if they exist. The mere presence of /dev/ttyS? tells you there is harware there, and that it passed a sanity test. The Linux driver does a test and the device won't be registered if it doesn't pass. But to really know if it works will require testing it with a loopback plug.

Oh, and you can also use the ssetserial command to get information about the serial port.

# setserial /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

The presence of that information tells you you have that serial port hardware.

share|improve this answer

Testing is definitely the correct answer. Any piece of hardware can and will fail. Additionally, it will often fail in a way that still makes it LOOK like it is working, until you try to use it. It may work fine except in certain cases, such as high load. With this in mind it's clear Windows saying "this hardware is working properly" is not useful.

If you are managing even a moderately large set of hardware, it is essential to do some sort of burn in. Run CPU intensive tasks for a few hours, write huge amounts of data to disk and read it back to ensure it is correct, saturate the network card with traffic and check for dropped packets. This is the only way to be sure.

Also, be sure to run similar (but probably smaller) checks through the life of the machine. Use something like nagios so that you get an alert as soon as something is amiss. Hardware fails, and it fails frequently.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.