Can you advice a Python library to query a lan subnet with SNMP andcollect MAC addresses of nodes?

Discussion in 'Python' started by Aldo Ceccarelli, Apr 15, 2011.

  1. Hello All,
    in my specific problem I will be happy of a response where possible
    to:

    1. distinguish different operating systems of answering nodes
    2. collect responses of Wyse thin-clients with "Thin OS" to get node
    name and MAC address in particular

    Thanks a lot in advance for any sharing / forward to documentation,
    products in the area.

    KR Aldo
    Aldo Ceccarelli, Apr 15, 2011
    #1
    1. Advertising

  2. Aldo Ceccarelli

    frankcui Guest

    Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    On 04/15/2011 05:00 PM, Aldo Ceccarelli wrote:
    > Hello All,
    > in my specific problem I will be happy of a response where possible
    > to:
    >
    > 1. distinguish different operating systems of answering nodes
    > 2. collect responses of Wyse thin-clients with "Thin OS" to get node
    > name and MAC address in particular
    >
    > Thanks a lot in advance for any sharing / forward to documentation,
    > products in the area.
    >
    > KR Aldo

    I think for your interest, if what you described is not a part of your
    software you are doing but only a specific task, you could use some
    network scanning tools like nmap to achieve your goals.

    there is also a module called pysnmp and you can look into it to see if
    it meets your need.

    frank
    frankcui, Apr 15, 2011
    #2
    1. Advertising

  3. Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    On 15 Apr, 11:54, frankcui <> wrote:
    > On 04/15/2011 05:00 PM, Aldo Ceccarelli wrote:> Hello All,
    > > in my specific problem I will be happy of a response where possible
    > > to:

    >
    > > 1. distinguish different operating systems of answering nodes
    > > 2. collect responses of Wyse thin-clients with "Thin OS" to get node
    > > name and MAC address in particular

    >
    > > Thanks a lot in advance for any sharing / forward to documentation,
    > > products in the area.

    >
    > > KR Aldo

    >
    > I think for your interest, if what you described is not a part of your
    > software you are doing but only a specific task, you could use some
    > network scanning tools like nmap to achieve your goals.
    >
    > there is also a module called pysnmp and you can look into it to see if
    > it meets your need.
    >
    > frank


    Thanks Frank! I've browsed pysnmp as you kindly adviced, now looking
    also into http://pynetsnmp.sourceforge.net/
    KR Aldo
    Aldo Ceccarelli, Apr 15, 2011
    #3
  4. Aldo Ceccarelli

    rusi Guest

    Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    On Apr 15, 3:22 pm, Aldo Ceccarelli <> wrote:
    > On 15 Apr, 11:54, frankcui <> wrote:
    >
    >
    >
    > > On 04/15/2011 05:00 PM, Aldo Ceccarelli wrote:> Hello All,
    > > > in my specific problem I will be happy of a response where possible
    > > > to:

    >
    > > > 1. distinguish different operating systems of answering nodes
    > > > 2. collect responses of Wyse thin-clients with "Thin OS" to get node
    > > > name and MAC address in particular

    >
    > > > Thanks a lot in advance for any sharing / forward to documentation,
    > > > products in the area.

    >
    > > > KR Aldo

    >
    > > I think for your interest, if what you described is not a part of your
    > > software you are doing but only a specific task, you could use some
    > > network scanning tools like nmap to achieve your goals.

    >
    > > there is also a module called pysnmp and you can look into it to see if
    > > it meets your need.

    >
    > > frank

    >
    > Thanks Frank! I've browsed pysnmp as you kindly adviced, now looking
    > also intohttp://pynetsnmp.sourceforge.net/
    > KR Aldo


    This is 6-7 year old stale memory (and dont want to start a flame war
    but...)
    Last I looked at the snmp modules in python I vaguely remember that
    the perl modules were so much more feature complete that I had to
    switch to perl even though I am generally uncomfortable with perl.
    rusi, Apr 17, 2011
    #4
  5. Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    On Apr 15, 11:00 am, Aldo Ceccarelli <>
    wrote:
    > Hello All,
    > in my specific problem I will be happy of a response where possible
    > to:
    >
    > 1. distinguish different operating systems of answering nodes
    > 2. collect responses of Wyse thin-clients with "Thin OS" to get node
    > name and MAC address in particular
    >
    > Thanks a lot in advance for any sharing / forward to documentation,
    > products in the area.
    >
    > KR Aldo


    Hello and thank you All!
    I've solved my problem as follows:
    1. installed nmap
    2. wrote a python script calling nmap nmap -sP via os.system and
    redirecting output to a file
    3. read results file and made a further processing to get exact
    filtered records with MAC addresses I needed

    Kindest regards Aldo
    Aldo Ceccarelli, Apr 18, 2011
    #5
  6. Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    On Tue, Apr 19, 2011 at 1:23 AM, Aldo Ceccarelli
    <> wrote:
    > Hello and thank you All!
    > I've solved my problem as follows:
    > 1. installed nmap
    > 2. wrote a python script calling nmap nmap -sP via os.system and
    > redirecting output to a file
    > 3. read results file and made a further processing to get exact
    > filtered records with MAC addresses I needed


    I don't know if it's significant, but if I want to process a command's
    output using Python, I'll generally use:

    nmap -sP | /path/to/script.py

    rather than os.system() and temporary files. YMMV though.

    Chris Angelico
    Chris Angelico, Apr 18, 2011
    #6
  7. Aldo Ceccarelli

    Daniel Kluev Guest

    Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    Isn't it better to use subprocess.Popen and read stdout/stderr
    directly? Should be much more convenient than temporary files.

    --
    With best regards,
    Daniel Kluev
    Daniel Kluev, Apr 18, 2011
    #7
  8. Re: Can you advice a Python library to query a lan subnet with SNMPand collect MAC addresses of nodes?

    On 18 Apr, 22:38, Daniel Kluev <> wrote:
    > Isn't it better to use subprocess.Popen and read stdout/stderr
    > directly? Should be much more convenient than temporary files.
    >
    > --
    > With best regards,
    > Daniel Kluev


    Thanks Daniel, your solution is far better WKR! Aldo
    Aldo Ceccarelli, Apr 19, 2011
    #8
    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. Vijesh
    Replies:
    0
    Views:
    436
    Vijesh
    Nov 27, 2004
  2. asd
    Replies:
    3
    Views:
    437
    Arnaud Berger
    May 23, 2005
  3. yagru_alvarez
    Replies:
    7
    Views:
    622
    Michael Doubez
    Jun 6, 2011
  4. kielhd
    Replies:
    3
    Views:
    340
    John W. Krahn
    Nov 9, 2003
  5. milaus

    SNMP module to query net-snmp

    milaus, Aug 31, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    405
    Dr.Ruud
    Aug 31, 2006
Loading...

Share This Page