Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #3256 > unrolled thread

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

Started byAldo Ceccarelli <ceccarelli.aldo@gmail.com>
First post2011-04-15 02:00 -0700
Last post2011-04-18 23:16 -0700
Articles 8 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? Aldo Ceccarelli <ceccarelli.aldo@gmail.com> - 2011-04-15 02:00 -0700
    Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? frankcui <frankcui24@gmail.com> - 2011-04-15 17:54 +0800
      Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? Aldo Ceccarelli <ceccarelli.aldo@gmail.com> - 2011-04-15 03:22 -0700
        Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? rusi <rustompmody@gmail.com> - 2011-04-16 21:38 -0700
    Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? Aldo Ceccarelli <ceccarelli.aldo@gmail.com> - 2011-04-18 08:23 -0700
      Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? Chris Angelico <rosuav@gmail.com> - 2011-04-19 05:13 +1000
      Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? Daniel Kluev <dan.kluev@gmail.com> - 2011-04-19 07:38 +1100
        Re: Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes? Aldo Ceccarelli <ceccarelli.aldo@gmail.com> - 2011-04-18 23:16 -0700

#3256 — Can you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes?

FromAldo Ceccarelli <ceccarelli.aldo@gmail.com>
Date2011-04-15 02:00 -0700
SubjectCan you advice a Python library to query a lan subnet with SNMP and collect MAC addresses of nodes?
Message-ID<e2459986-6ae7-48b4-ab83-2c2eec9840b1@dr5g2000vbb.googlegroups.com>
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

[toc] | [next] | [standalone]


#3262

Fromfrankcui <frankcui24@gmail.com>
Date2011-04-15 17:54 +0800
Message-ID<mailman.391.1302861281.9059.python-list@python.org>
In reply to#3256
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

[toc] | [prev] | [next] | [standalone]


#3264

FromAldo Ceccarelli <ceccarelli.aldo@gmail.com>
Date2011-04-15 03:22 -0700
Message-ID<a87d7452-ce9a-41b6-8782-352f43100f4a@k36g2000vbr.googlegroups.com>
In reply to#3262
On 15 Apr, 11:54, frankcui <frankcu...@gmail.com> 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

[toc] | [prev] | [next] | [standalone]


#3372

Fromrusi <rustompmody@gmail.com>
Date2011-04-16 21:38 -0700
Message-ID<f74be35d-be73-450f-84fc-686cc1fda852@v33g2000prn.googlegroups.com>
In reply to#3264
On Apr 15, 3:22 pm, Aldo Ceccarelli <ceccarelli.a...@gmail.com> wrote:
> On 15 Apr, 11:54, frankcui <frankcu...@gmail.com> 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.

[toc] | [prev] | [next] | [standalone]


#3488

FromAldo Ceccarelli <ceccarelli.aldo@gmail.com>
Date2011-04-18 08:23 -0700
Message-ID<ee43baee-46bd-47d0-a01f-f89dbb4539fc@dn9g2000vbb.googlegroups.com>
In reply to#3256
On Apr 15, 11:00 am, Aldo Ceccarelli <ceccarelli.a...@gmail.com>
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

[toc] | [prev] | [next] | [standalone]


#3496

FromChris Angelico <rosuav@gmail.com>
Date2011-04-19 05:13 +1000
Message-ID<mailman.521.1303154011.9059.python-list@python.org>
In reply to#3488
On Tue, Apr 19, 2011 at 1:23 AM, Aldo Ceccarelli
<ceccarelli.aldo@gmail.com> 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

[toc] | [prev] | [next] | [standalone]


#3500

FromDaniel Kluev <dan.kluev@gmail.com>
Date2011-04-19 07:38 +1100
Message-ID<mailman.523.1303159143.9059.python-list@python.org>
In reply to#3488
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

[toc] | [prev] | [next] | [standalone]


#3540

FromAldo Ceccarelli <ceccarelli.aldo@gmail.com>
Date2011-04-18 23:16 -0700
Message-ID<4979d42a-a903-4bb8-9762-bf829b293471@a11g2000pro.googlegroups.com>
In reply to#3500
On 18 Apr, 22:38, Daniel Kluev <dan.kl...@gmail.com> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web