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

A

Aldo Ceccarelli

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
 
F

frankcui

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
 
A

Aldo Ceccarelli

On 04/15/2011 05:00 PM, Aldo Ceccarelli wrote:> Hello All,




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
 
R

rusi

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

Aldo Ceccarelli

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
 
C

Chris Angelico

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
 
D

Daniel Kluev

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

Aldo Ceccarelli

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

Thanks Daniel, your solution is far better WKR! Aldo
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top