Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Can you advice a Python library to query a lan subnet with SNMP andcollect MAC addresses of nodes? (http://www.velocityreviews.com/forums/t746852-can-you-advice-a-python-library-to-query-a-lan-subnet-with-snmp-andcollect-mac-addresses-of-nodes.html)

Aldo Ceccarelli 04-15-2011 09:00 AM

Can you advice a Python library to query a lan subnet with SNMP andcollect MAC addresses of nodes?
 
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

frankcui 04-15-2011 09:54 AM

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

Aldo Ceccarelli 04-15-2011 10:22 AM

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 <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

rusi 04-17-2011 04:38 AM

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 <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.

Aldo Ceccarelli 04-18-2011 03:23 PM

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 <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

Chris Angelico 04-18-2011 07:13 PM

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
<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

Daniel Kluev 04-18-2011 08:38 PM

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

Aldo Ceccarelli 04-19-2011 06:16 AM

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 <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


All times are GMT. The time now is 10:20 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.