SNMP工具包 [英] SNMP Toolkit

查看:100
本文介绍了SNMP工具包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在寻找一个高性能的SNMP管理工具包(SNMPv1 / v2,

GET / GETNEXT / GETBULK)I可以在Windows2K / XP上使用Python。我想知道是否有人有任何建议吗?商业软件很好,因为它适用于专门的内部应用程序。


我已经尝试过PySNMP,这是一个很好的作品代码(我已经学到了很多

正在查看它!),它在我的应用程序中相当CPU密集。

我也尝试过使用UCDSNMP通过popen(),但有一个倾向于在多线程环境中挂起。


所以,有没有人知道一个坚实的,多...具有线程能力,快速的SNMP

库具有合理的Python接口,可以在Windows上运行

但是,基本上,虽然我只是一个平庸的Python <程序员,我使用的最后一个编译语言是COBOL ...


谢谢!

马修。

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.

推荐答案

>>>>> "马修" == Matthew Bell< li **** @ cix.co.uk>写道:


马修>我正在寻找一位高性能的SNMP管理员

Matthew>工具包(SNMPv1 / v2,GET / GETNEXT / GETBULK)我可以使用

Matthew>在Windows2K / XP上使用Python。我想知道是否有人获得了

Matthew>有什么建议?商业软件很好,因为它是'b $ b马修>专业的内部应用程序。


Matthew>我已经尝试了PySNMP,虽然这是一段很好的代码(我已经通过它了解了很多东西!),但它是相当的CPU

马修>我的申请密集。我也尝试过使用

Matthew> UCDSNMP通过popen(),但有一个倾向于挂在一个
Matthew>多线程环境。


Matthew>那么,有没有人知道一个坚实的,多线程的能力,

Matthew>具有合理Python界面的快速SNMP库

Matthew>将在Windows上运行而不需要我的头脑

Matthew>围绕一个C编译器来构建它?我知道我应该是全部

马修> manly-man和我自己的基于C的SNMP库来自

Matthew>但是,基本上,虽然我只是一个平庸的Python

Matthew>程序员,我用的最后一种编译语言是

Matthew> COBOL ......


马修>谢谢!马修。


Pysnmp是唯一100%纯Python的SNMP实现我知道

of。也许你可以解决你的程序效率低下的问题?

你在做什么,那么CPU密集型?

我曾经工作的SNMP代理/经理(诚然不使用Python)总是受I / O限制,

而不是CPU限制。

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


Les Smithson< ls ****** @ NOhare.SPAM.demon.co.uk>在消息新闻中写道:< m3 ************ @ hare.demon.co.uk> ...
Les Smithson <ls******@NOhare.SPAM.demon.co.uk> wrote in message news:<m3************@hare.demon.co.uk>...
>> "马修" == Matthew Bell< li **** @ cix.co.uk>写道:
>> "Matthew" == Matthew Bell <li****@cix.co.uk> writes:


马修>我正在寻找一位高性能的SNMP管理员
Matthew>工具包(SNMPv1 / v2,GET / GETNEXT / GETBULK)我可以使用
Matthew>在Windows2K / XP上使用Python。


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是唯一100%纯Python的SNMP实现我知道
的。也许你可以解决你的程序效率低下的问题?
你在做什么?CPU密集型?我一直在努力的SNMP代理/经理(诚然不使用Python)总是受I / O约束,而不是CPU限制。


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




该应用程序正在监控30多个大型LAN交换机,每个交换机都收集了大量的信息。然后使用UCD-SNMP

(如果我们忽略了它有时会挂起的方式),实际上,I / O是限制因素而不是CPU。我编写的Python代码

处理所有数据让我感到惊讶的是它消耗的CPU相对较少(对于Python来说是yay!);如果我能找到一种方法让UCD-SNMP在多线程环境中可靠地工作,那么我很乐意使用它来获得

。但悬挂变得非常令人沮丧,因为没有

甚至select()似乎能够抓住它。它只是挂起。


使用PySNMP而不是UCD-SNMP肯定会绕过随机的

挂起,但它确实让CPU通过了屋顶。 />

我实际上并不一定在寻找纯Python的SNMP工具包。

老实说,鉴于此大量的SNMP流量,这个

应用程序必须生成,这将非常有意义

在C / C ++库中完成低级SNMP grunt工作然后

让Python代码处理已处理的OID和值。

只是我找不到任何可以在Win32上运行的库和

有一个方便的Python包装器。我有一个记忆,我在一年前发现了一个商业的基于C ++的SNMP库,并附带了一个

的Python包装器,但谷歌没有多少谷歌搜索发现

再次:-(


我找到了任意数量的原生COM / .NET / ASP /等C ++ SNMP工具包

并尝试使用Python Win32扩展程序与他们交谈,但我只是

对于低级Win32调用,事件处理

等了解不够他们工作,特别是代码示例通常

希望你使用Visual C ++或Visual Basic。


无论如何,谢谢,

Matthew。



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.


>>>>>"  Matthew" == Matthew Bell< li **** @ cix.co。 uk>写道:


Matthew>我找到了任意数量的原生COM / .NET / ASP / C ++

Matthew> SNMP工具包并尝试使用Python Win32扩展

Matthew>与之交谈他们但我对此不太了解

Matthew>低级Win32调用,事件处理等,以使他们获得

Matthew>工作,特别是代码示例通常期望

Matthew>您要么使用Visual C ++,要么使用Visual Basic。


Matthew>无论如何,谢谢,马修。


我要问这个 - 你看看snmpy

http://snmpy.sourceforge.net)?这使用ucd-snmp / net-snmp作为

grunt。它并没有声称要移植到Windows,但net-snmp是,并且

cmp模块中的snmpy并不*看起来很难构建

Windows。

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


这篇关于SNMP工具包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆