Hermlon Hermlon - 1 year ago 91
C Question

Blinking ethernet port lights

With ethtool it is possible to blink the lights on the ethernet port. But they are both blinking. Can you make them blink separately (using a C library or how it is controlled) or is this a command the network card supports and they can't be forced to blink manually? (The command for ethtool is

ethtool -p enp2s14 100
Would be nice if someone could give me a basic understanding on how far this is controllable by the os / the drivers?

Answer Source

I just had a look at the source code of ethtool and then at the Linux driver:

There are some network cards (network card drivers) that handle the blinking completely themselves. For these cards the kernel tells the card: "Blink" and the card will do the blinking.

For other types of network cards the kernel will do that: There is a loop in the kernel that will send the "LEDs on" and "LEDs off" commands to the card.

However there seems to be no command allowing one of the LEDs to be switched on or off individually.

Sometimes the LEDs are handled by the network card driver; sometimes by the network card hardware. If the LEDs are handled by the network card driver you might modify the network card driver - however I don't think that this is what you want to do.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download