RE: how to traverse network devices in our system?

Discussion in 'Python' started by Tim Golden, May 17, 2006.

  1. Tim Golden

    Tim Golden Guest

    []

    | 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
    ________________________________________________________________________
     
    Tim Golden, May 17, 2006
    #1
    1. Advertising

  2. Tim Golden

    Guest

    Hi Tim and all,

    Tim Golden wrote:

    > []
    >
    > | 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
    > ________________________________________________________________________
     
    , May 17, 2006
    #2
    1. Advertising

  3. > 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
     
    Franck Pommereau, May 18, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kal
    Replies:
    1
    Views:
    9,562
    Kevin Spencer
    Jun 21, 2004
  2. aaaa
    Replies:
    1
    Views:
    359
    James McGill
    Mar 2, 2006
  3. Replies:
    0
    Views:
    307
  4. Lino
    Replies:
    1
    Views:
    333
    Martin Lansler
    Jul 31, 2006
  5. Naveen Vaila

    "Windows CE Devices and Palm Devices Help Needed"

    Naveen Vaila, May 24, 2004, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    529
    Abraham Durairaj
    Jun 23, 2004
Loading...

Share This Page