Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: how to traverse network devices in our system?

Reply
Thread Tools

RE: how to traverse network devices in our system?

 
 
Tim Golden
Guest
Posts: n/a
 
      05-17-2006
[(E-Mail Removed)]

| i would like to know whether python can help me querying the network
| devices attached to my system (ethernet,wireless) and display their
| module name and vendor name?

Which OS? If it's windows, you can use WMI. I would
guess Linux, tho', from your mention of module name.

TJG

__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
__________________________________________________ ______________________
 
Reply With Quote
 
 
 
 
chaks.yoper@gmail.com
Guest
Posts: n/a
 
      05-17-2006
Hi Tim and all,

Tim Golden wrote:

> [(E-Mail Removed)]
>
> | i would like to know whether python can help me querying the network
> | devices attached to my system (ethernet,wireless) and display their
> | module name and vendor name?
>
> Which OS? If it's windows, you can use WMI. I would
> guess Linux, tho', from your mention of module name.
>

Yes, it is Linux. I was just googling and found that there are kudzu
bindings for python. From that i can query kudzu for any configured and
unconfigured device (i hope so). is there any other method available
other kudzu python bindings ?

thank you.

Chakkaradeep

> TJG
>
> __________________________________________________ ______________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> __________________________________________________ ______________________


 
Reply With Quote
 
 
 
 
Franck Pommereau
Guest
Posts: n/a
 
      05-18-2006
> Yes, it is Linux. I was just googling and found that there are kudzu
> bindings for python. From that i can query kudzu for any configured and
> unconfigured device (i hope so). is there any other method available
> other kudzu python bindings ?


I do it using DBus/Hal, for instance:

###############
import dbus

system_bus = dbus.SystemBus()
hal_manager_obj = system_bus.get_object('org.freedesktop.Hal',
'/org/freedesktop/Hal/Manager')
hal_manager = dbus.Interface(hal_manager_obj,
'org.freedesktop.Hal.Manager')

for udi in hal_manager.FindDeviceByCapability("net") :
obj = system_bus.get_object("org.freedesktop.Hal", udi)
dev = dbus.Interface(obj, 'org.freedesktop.Hal.Device')
print dev.GetProperty("net.interface"),
print dev.GetProperty("net.address")
###############

Cheers,
Franck
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
how to traverse network devices in our system? chaks.yoper@gmail.com Python 0 05-17-2006 09:44 AM
How exactly does STP traverse the network? Josh T Cisco 3 12-08-2005 04:06 AM
Can I have 2 IP addresses on our internal interface on our cisco pix firewall bgamblin@spvg.com Cisco 1 09-08-2005 08:54 PM
How do we stamp our names onto our photos? Kim Digital Photography 6 01-06-2005 06:12 AM



Advertisments