473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SNMP support for Python under Windows

I'm looking for SNMP support in Python. I have found pySNMP, but I'm
not sure whether this works under Windows as well. A few questions:

1) Where do I need to install the pySNMP files?
2) What do I have to do in order to be able to write somethin like:
"from pysnmp import session"

Thakns in advance for all input
Jul 18 '05 #1
2 8130
WIWA wrote:

I'm looking for SNMP support in Python. I have found pySNMP, but I'm
not sure whether this works under Windows as well.
Yes, it does.
A few questions:

1) Where do I need to install the pySNMP files?
Doesn't it install with distutils? If so "python setup.py --install"
or whatever it says in the README would work. Sorry, I haven't
installed it lately.

If it doesn't have instructions, put the files under the
c:/python/lib/site-packages directory.
2) What do I have to do in order to be able to write somethin like:
"from pysnmp import session"
Install, then type "from pysnmp import session".... ;-)
Thakns in advance for all input


(If you're having troubles, please note versions and platform
next time, for Python, PySNMP, and Windows.)

-Peter
Jul 18 '05 #2
Hi Peter,

Thanks for this useful information. I tried this on my Windows2000
system and it seems to work. I used distutils and modified the PATH
entry. I'll check on my Windows XP machine and will let you know if I
found any discrepancy.

Thanks again for all your effort. I have another question, but will
put that in a separate message on this discussion forum. Any help is
welcome.

- Wim

Peter Hansen <pe***@engcorp.com> wrote in message news:<3F***************@engcorp.com>...
WIWA wrote:

I did two things, both unsuccessfull:

1) If I install the pySNMP modules under lib/site-packages and then
type sth like:
from pysnmp import session it gives the error message "ImportError: No
module named pysnmp". The same happens if I unstall pySNMP directly
under the lib directory. Installs in this context means 'copy paste'
the *.py files of the pySNMP distribution.


I misled you the first time, but have since taken another look
at the installation to see how it works. In order to import
anything from a package (roughly, a set of .py files that includes an
__init__.py file), you need to put those files in a directory
which is named for the package (e.g. pysnmp in this case) _and_
which is available in sys.path. (Do "import sys" and "sys.path"
to see the list. You probably have lib/site-packages in that
list, so just put all the PySNMP files under it in a folder called
pysnmp.)
- Do I need to explicitly mention in my script where pySNMP is
installed?


Not if it's in a folder called pysnmp that is itself in one of the
sys.path folders, or under the current folder.
2) I installed distutils 1.0.2 for Windows and it installed into the
Python directory. So ar so good, I think...


Distutils is included in Python so you probably didn't need to do
that, and maybe shouldn't have. I'm not sure whether that will have
broken the standard distutils. It's repairable if it did. On my
Python 2.2.1 setup here, the standard distutils is v1.0.3.
I go to DOS prompt and go to the directory where disutils is installed
and type in python setup.py install, but DOS replies:
'Python is not recognized as an internal or external command, program
or batchfile".


Now that's a different problem. You need python.exe to be findable
from the DOS PATH. The simplest approach might be to check the FAQ
entry at http://www.python.org/cgi-bin/faqw.p...=faq08.018.htp

As a test of the pysnmp installation, without having to change PATH
at all, change to the Python directory ("cd \python" or whatever)
and run the interactive interpreter ("python") and just type
"import pysnmp" to see if it works.
System coordinates are Windows XP. Python version is 2.2.2 and pySNMP
is version 3.0.0.


Should all be no problem, although I suspect instructions in that
FAQ entry may be a little light on XP advice. Let us know if you
see any area that could be improved so others can benefit from this
exchange...

-Peter

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Matthew Bell | last post by:
Hi, I'm looking for a high-performance SNMP manager toolkit (SNMPv1 / v2, GET / GETNEXT / GETBULK) I can use with Python on Windows2K/XP. I wonder if anyone has got any suggestions? Commercial...
4
by: Jeremy Sanders | last post by:
Hi - I'd like to write a program which basically does a few snmpgets. I haven't been able to find a python package which gives you a nice high-level and simple way of doing this (like PHP has)....
3
by: Kevin Ingram | last post by:
Is it possible to connect to devices and read SNMP data with ASP? I did a search and all I could find was utilities for sale to do it, wondered if it can be done using straight ASP. We are using...
3
by: py | last post by:
>From what I have seen Python does not come with an snmp module built in, can anyone suggest some other SNMP module (preferably one you have used/experienced)..I have googled and seen yapsnmp and...
3
by: Jean-Marc Blaise | last post by:
Dear all, I've been looking for some info on the snmp support provided by DB2 UDB V8.1. Just 1 line, and 2 references in the index, when the V7.1 Troubleshooting guide had a complete paragraph....
0
by: vanisathish | last post by:
Hi, I need to develop a web-based NetworkManagement Software on windows platform(planning to use ASP,HTML ). The Networking devices provide support for SNMP. Is there a way i can construct...
1
by: Schroeder, AJ | last post by:
Hello group, I performed binary installs of Net-SNMP and PHP 4.4.4 on my Windows XP laptop so that I can do some offline development/testing away from my Linux server. Anyway, I attempted to do...
1
by: KDawg44 | last post by:
Hi, I am very new to Python and really just began studying and using it. I read that it was relatively easy to interact with Windows machines with Python and I am desperately looking for...
1
by: Dirk Van de moortel | last post by:
{ OOPS, posted this to moderated group perl.cpan.discuss as well, so it can take a while to get through, if it gets through at all Otherwise sorry for duplicate posting } We need to set up a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.