473,696 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SNMP Toolkit

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 software is
fine, as it's for a specialised in-house application.

I've tried PySNMP which, while a fine piece of code (I've learnt a lot
looking through it!), it's fairly CPU intensive in my application.
I've also tried using UCDSNMP via popen() but that has a tendency to
hang in a multi-threaded environment.

So, does anyone know of a solid, multi-threading capable, fast SNMP
library with a reasonable Python interface that will run on Windows
without me needing to get my head round a C compiler to build it? I
know I should be all manly-man and hew my own C-based SNMP library
from scratch but, basically, while I'm only a mediocre Python
programmer, the last compiled language I used was COBOL...

Thanks!
Matthew.
Jul 18 '05 #1
10 10035
>>>>> "Matthew" == Matthew Bell <li****@cix.co. uk> writes:

Matthew> Hi, I'm looking for a high-performance SNMP manager
Matthew> toolkit (SNMPv1 / v2, GET / GETNEXT / GETBULK) I can use
Matthew> with Python on Windows2K/XP. I wonder if anyone has got
Matthew> any suggestions? Commercial software is fine, as it's
Matthew> for a specialised in-house application.

Matthew> I've tried PySNMP which, while a fine piece of code (I've
Matthew> learnt a lot looking through it!), it's fairly CPU
Matthew> intensive in my application. I've also tried using
Matthew> UCDSNMP via popen() but that has a tendency to hang in a
Matthew> multi-threaded environment.

Matthew> So, does anyone know of a solid, multi-threading capable,
Matthew> fast SNMP library with a reasonable Python interface that
Matthew> will run on Windows without me needing to get my head
Matthew> round a C compiler to build it? I know I should be all
Matthew> manly-man and hew my own C-based SNMP library from
Matthew> scratch but, basically, while I'm only a mediocre Python
Matthew> programmer, the last compiled language I used was
Matthew> COBOL...

Matthew> Thanks! Matthew.

Pysnmp is the only 100% pure Python SNMP implementation I'm aware
of. Perhaps you could address your program's inefficiencies instead?
What are you doing that's so CPU intensive? SNMP agents/managers that
I've worked on (admittedly not using Python) were always I/O bound,
rather than CPU bound.

Jul 18 '05 #2
Les Smithson <ls******@NOhar e.SPAM.demon.co .uk> wrote in message news:<m3******* *****@hare.demo n.co.uk>...
>> "Matthew" == Matthew Bell <li****@cix.co. uk> writes:

Matthew> Hi, I'm looking for a high-performance SNMP manager
Matthew> toolkit (SNMPv1 / v2, GET / GETNEXT / GETBULK) I can use
Matthew> with Python on Windows2K/XP.

[...deletia...]
Pysnmp is the only 100% pure Python SNMP implementation I'm aware
of. Perhaps you could address your program's inefficiencies instead?
What are you doing that's so CPU intensive? SNMP agents/managers that
I've worked on (admittedly not using Python) were always I/O bound,
rather than CPU bound.


The application is monitoring 30+ big LAN switches with a large
variety of information being collected from each one. Using UCD-SNMP
then (if we ignore the way it tends to hang sometimes), indeed, I/O is
the limiting factor rather than CPU. The Python code I've written
that deals with all the data amazes me by how relatively little CPU it
consumes (yay for Python!); if I could find a way to get UCD-SNMP to
work reliably in a multi-threaded environment then I'd happily carry
on using that. But the hanging is getting really frustrating as not
even select() seems to be able to catch it. It just hangs.

Using PySNMP rather than UCD-SNMP certainly gets round the random
hanging, but it does make CPU go through the roof.

I'm not actually necessarily looking for a pure Python SNMP toolkit.
To be honest, given the large amounts of SNMP traffic that this
application has to generate, it would make an awful lot of sense to
have the low-level SNMP grunt work done in a C / C++ library and then
have the Python code just deal with the processed OIDs and values.
It's just that I can't find any such library that'll run on Win32 and
that has a convenient Python wrapper. I've got a recollection that I
stumbled across a commercial C++ based SNMP library that came with a
Python wrapper about a year ago, but no amount of googling has found
it again :-(

I have found any number of native COM/.NET/ASP/etc C++ SNMP toolkits
and tried using the Python Win32 extensions to talk to them but I just
don't understand enough about low-level Win32 calls, event handling
etc to get them to work, particularly as the code examples typically
expect you to either be using Visual C++ or Visual Basic.

Thanks anyway,
Matthew.
Jul 18 '05 #3
>>>>> "Matthew" == Matthew Bell <li****@cix.co. uk> writes:

Matthew> I have found any number of native COM/.NET/ASP/etc C++
Matthew> SNMP toolkits and tried using the Python Win32 extensions
Matthew> to talk to them but I just don't understand enough about
Matthew> low-level Win32 calls, event handling etc to get them to
Matthew> work, particularly as the code examples typically expect
Matthew> you to either be using Visual C++ or Visual Basic.

Matthew> Thanks anyway, Matthew.

I have to ask this - did you look at snmpy
(http://snmpy.sourceforge.net)? This uses ucd-snmp/net-snmp for the
grunt. It doesn't claim to be ported to Windows, but net-snmp is, and
the C module in snmpy doesn't *look* that difficult to build on
Windows.

Jul 18 '05 #4
In article <m3************ @hare.demon.co. uk>,
Les Smithson <ls******@NOhar e.SPAM.demon.co .uk> wrote:
>> "Matthew" == Matthew Bell <li****@cix.co. uk> writes:


Matthew> I have found any number of native COM/.NET/ASP/etc C++
Matthew> SNMP toolkits and tried using the Python Win32 extensions
Matthew> to talk to them but I just don't understand enough about
Matthew> low-level Win32 calls, event handling etc to get them to
Matthew> work, particularly as the code examples typically expect
Matthew> you to either be using Visual C++ or Visual Basic.

Matthew> Thanks anyway, Matthew.

I have to ask this - did you look at snmpy
(http://snmpy.sourceforge.net)? This uses ucd-snmp/net-snmp for the
grunt. It doesn't claim to be ported to Windows, but net-snmp is, and
the C module in snmpy doesn't *look* that difficult to build on
Windows.


What have been people's experiences with snmpy? The last time I looked
at it (over a year ago), I had troubles building it (on linux) because
it had dependencies on an oldish version of net-snmp.

I do a lot of SNMP work, but have never really found a good python SNMP
package. I looked at PySNMP (the pure python one) but never managed to
get that to work either. It also just seems wrong to be doing all the
low-level BER and packet building stuff in Python.
Jul 18 '05 #5
Les Smithson wrote:
>>"Matthe w" == Matthew Bell <li****@cix.co. uk> writes:
>>
>>
....
Matthew> I've tried PySNMP which, while a fine piece of code (I've
Matthew> learnt a lot looking through it!), it's fairly CPU
Matthew> intensive in my application. I've also tried using
Matthew> UCDSNMP via popen() but that has a tendency to hang in a
Matthew> multi-threaded environment.

....
SNMP agents/managers that
I've worked on (admittedly not using Python) were always I/O bound,
rather than CPU bound.

PySNMP is actually a *very* heavy library compared to C ASN.1 parsers.
I've certainly run into situations where it's just not fast enough to do
what we want to do. Thing is, it's flexible and can be readily
integrated with Twisted, so we still use it, even if it does mean it can
take 10 minutes to scan a plant. That's all processor-bound time, not
IO bound.

Some day I'm going to try to squeeze some money out of the budget to
spend a week on figuring out how to make PySNMP faster, but until then
I'm afraid I just don't have a good suggestion for large SNMP querying
tasks.

Have fun,
Mike

_______________ _______________ _______________ ___
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
blog: http://zope.vex.net/~mcfletch/plumbing/
Jul 18 '05 #6
Mike C. Fletcher wrote:

PySNMP is actually a *very* heavy library compared to C ASN.1 parsers.
I've certainly run into situations where it's just not fast enough to do
what we want to do.
[..]
That's all processor-bound time, not
IO bound.


AFAIK the BER encoding/decoding is implemented in pure Python. If one has
the time to implement these routines in C it'd be much less CPU intensive I
guess.

I wish support for BER and DER to be in the standard lib...

Ciao, Michael.
Jul 18 '05 #7
Have you tried yapsnmp: http://yapsnmp.sourceforge.net/ ?
It is a Python wrapper around net-snmp, so should be fast.
It also claims to be thread-safe.
The problem you could have is that it's advertised as a posix module
only. But the wrapper is built using SWIG, so it should be possible to
build it for Windows without too much hassle.
Note that I've never used it myself, so can't comment on the package
itself.
However, I will have to do some snmp coding soon, and it's the first
one I will try.
Jul 18 '05 #8
Michael Str?der <mi*****@stroed er.com> wrote:

[ skipped ]
AFAIK the BER encoding/decoding is implemented in pure Python. If one has
the time to implement these routines in C it'd be much less CPU intensive I
guess.


I've got an impression, that building/parsing BER is not computationally
intensive. In fact, BER encoding has been designed to cope with rather limited
resources (in terms of about 20 yo hardware!).

As an alternative bottleneck I'd rather propose 1) object instantiation and
2) function calls. As of this writing, pysnmp.asn1 code is designed as a top-down
parser what implies intensive recursion and object creation. Although not a real
receipt but rater a workaround, I'd suggest caching and reusing top-level
ASN.1/SNMP objects (such as SNMP message) inside your app whenever possible.
This might safe lots of CPU on a long run.

-ilya
Jul 18 '05 #9
Les Smithson <ls******@NOhar e.SPAM.demon.co .uk> wrote in message news:<m3******* *****@hare.demo n.co.uk>...
I have to ask this - did you look at snmpy
(http://snmpy.sourceforge.net)? This uses ucd-snmp/net-snmp for the
grunt. It doesn't claim to be ported to Windows, but net-snmp is, and
the C module in snmpy doesn't *look* that difficult to build on
Windows.


Yes, I did look at snmpy. And was instantly scared off by the obvious
need to hack about with the C module to get it to compile on Win32. I
haven't even been able to get net-snmp itself to compile on Win32 - I
tried to follow the net-snmp readme about compiling it with cygwin and
just ended up in a world of pain. The thought of doing the same for
snmpy brings me out in hives.

For better or for worse, I don't come from a UNIX / C background and
so while such things may be straightforward for some, they're not for
me.

Thanks anyway,
Matthew.
Jul 18 '05 #10

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

Similar topics

1
3987
by: dan byers | last post by:
hey everyone, i'm working on a system to monitor devices through SNMP. i'm using the Net::SNMP modules by D.Town. i try to load the snmp session request with a set of OIDs to make the system run through the large set of queries faster. the problem i'm seeing is that if the request method does the request, and one particular index doesn't exist on the device, the entire request bails and no results are returned, thus skipping over any...
3
5321
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 InterDev 6, IIS5 on W2KServer. Thanks!
1
532
by: ZacBowling | last post by:
Does anyone have an idea of how to access the SNMP API or WMI SNMP provider in C#/.NET? I need to query a Ascend MAX's SNMP service with a custom MIB in .NET. I won't be modify anything on the MAX (even though a SET isn't anymore difficult then a GET or a WALK I don't think).
0
1662
by: Chris | last post by:
For the IBM DB2 Development following this group. SNMP is coming back in a big way. Changes in Version 2c and adoptions of Version 3 are ushering in the adoption of SNMP back into the enterprise. Your customers are going to be asking for the inclusion of SNMP back into the monitoring suite. I'm not just talking about sending piddly SNMP traps. I mean the "real meat" stats you get out of your DB2 instances (physical-to-logical layout,...
10
10194
by: Bennett F. Dill | last post by:
Hi I'd like help writing a c# console app that can send an SNMP trap. I've seen some documents on writng an SNMP server, but I don't want to receive traps, I only want to send them. Thanks Ben
0
1267
by: ramgce2003 | last post by:
Dear all... We have an NMS Software(Created by using GUI(Window) based application in VC++) already used to comminicate to our SNMP Agent Note::: 1. Consider NMS Software(actas a client) running one one PC and SNMP Agent(act as a server) may be just another PC. 2. If I run the NMS Software, it will send SNMP request to SNMP
1
2075
by: idoha | last post by:
Hi, I am trying to determine the SNMP status on remote machine. I need to distinguish between two possible options, where the SNMP is not active: 1)When the SNMP listener is not active on a certain port (default is 161). This is caused when the SNMP service is off or when it listens to port other than 161. 2)When the communityString is incorrect. I have been trying to use NET::SNMP and send a get request. The problem is that it...
1
4164
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 server 2003 (or a win XP system) to accept and act upon traps sent out from a storage system. Responding to various error conditions, this system can be fully configured to send traps.
7
3519
by: moon1 | last post by:
how will I change the code the 1st code according to the 2nd one? 1st code sub snmpGet(@) { # Assign arguments my ($deviceName)=$_; # Device name to read from my ($community)=$_; # SNMP Community String my ($timeout)=$_; # Timeout value for SNMP-GET request my ($type)=$_; # SNMP Object Type
0
8666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9145
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9010
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4611
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2319
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.