Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cable state in application
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Thu Dec 08, 2005 11:57 pm    Post subject: Cable state in application Reply with quote

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
View user's profile Send private message
eweneb
n00b
n00b


Joined: 23 Jun 2005
Posts: 39

PostPosted: Fri Dec 09, 2005 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
MrUlterior
Guru
Guru


Joined: 22 Mar 2005
Posts: 511
Location: Switzerland

PostPosted: Fri Dec 09, 2005 2:58 pm    Post subject: Reply with quote

ethtool is better
_________________

Misanthropy 2.0 - enough hate to go around
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 967
Location: Varberg, Sweden

PostPosted: Fri Dec 09, 2005 3:37 pm    Post subject: Reply with quote

I'm too fond of executing an external program. mii-tool/ethtool must get their information from somewhere...
Back to top
View user's profile Send private message
eweneb
n00b
n00b


Joined: 23 Jun 2005
Posts: 39

PostPosted: Fri Dec 09, 2005 4:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum