View previous topic :: View next topic |
Author |
Message |
Raniz l33t


Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Thu Dec 08, 2005 11:57 pm Post subject: Cable state in application |
|
|
I'm writing a system monitor in Python and I wan't to check whether an network interface is plugged in or not.
Is there any way to do this? I've noticed messages in both dmesg and /var/log/messages when I plug the cable in and out. But that doesn't help me.
I'd also like to know whether it's full/half duplex or even simplex and the speed of the connection too. |
|
Back to top |
|
 |
eweneb n00b


Joined: 23 Jun 2005 Posts: 39
|
Posted: Fri Dec 09, 2005 2:15 pm Post subject: |
|
|
You need mii-tool; it should give you everything you need.
"mii-tool -v eth0" _________________ "Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clark
"Any unnecessarily advanced technology is indistiguishable from masochism." -- Eric B. Ewen |
|
Back to top |
|
 |
MrUlterior Guru

Joined: 22 Mar 2005 Posts: 511 Location: Switzerland
|
Posted: Fri Dec 09, 2005 2:58 pm Post subject: |
|
|
ethtool is better _________________
Misanthropy 2.0 - enough hate to go around
|
|
Back to top |
|
 |
Raniz l33t


Joined: 13 Sep 2003 Posts: 967 Location: Varberg, Sweden
|
Posted: Fri Dec 09, 2005 3:37 pm Post subject: |
|
|
I'm too fond of executing an external program. mii-tool/ethtool must get their information from somewhere... |
|
Back to top |
|
 |
eweneb n00b


Joined: 23 Jun 2005 Posts: 39
|
Posted: Fri Dec 09, 2005 4:28 pm Post subject: |
|
|
Actually, MrUlterior was correct: ethtool is better; mii-tool is being deprecated.
You should pull down the ethtool source and read it and/or contact the author for further information. _________________ "Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clark
"Any unnecessarily advanced technology is indistiguishable from masochism." -- Eric B. Ewen |
|
Back to top |
|
 |
|