Java SNMP API 选择
我知道这个问题已经被问过很多次了,但我目前正在使用 snmp4j 库,并且发现它非常慢。即使在我的本地系统上,六个查询也需要大约六秒的时间,而且我无法获得直接值,例如特定的磁盘使用情况,我必须操作几个值,因为我使用的 MIB-II mib 没有内置那么多功能是否有任何 API 既快速又允许直接检索指标,例如磁盘使用情况、CPU 使用情况、可用内存、内存使用情况等, 网上有很多可用的 API,但我没有时间全部尝试,我希望得到实际使用过此类 API 的人的答案。
I know this question has been asked many times over, but I am currently using snmp4j library and I am finding it very slow. It takes about six seconds for six queries even on my local system, and also I cannot get direct values such as particular disk usage, I have to manipulate several values since the MIB-II mib that I use doesn't have that many features built in. Is there any API that's fast and also permits direct retrieval of metrics such as disk usage, CPU usage, memory free, memory usage etc.,
There are many APIs available on the net but I don't have time to try out all, I would like answers from someone who have actually worked hands on with such APIs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该分析性能到一个更低的水平,然后判断它是否执行缓慢。当然,您应该明确您正在使用 snmp4j 的哪一部分(管理器或代理)。
您对从 SNMP 查询返回哪种数据的要求不适合通用 SNMP 库/代理(例如 snmp4j)。一般来说,它们是根据 IETF RFC 设计的,其中没有记录特定于操作系统的 API。
如果您确实搜索特定于操作系统的代理,或者您希望该代理实现尽可能多的功能,您可以选择商业代理。在这种情况下,他们的售前人员可以接听您的电话或邮件,并给您想要的答案。
You should analyze the performance down to a much lower level and then tell if it performs slow. Of course, you should clarify which part of snmp4j you are using (the manager or the agent).
Your requirements on what kind of data to be returned from SNMP queries are not suitable for a general SNMP libraries/agents such as snmp4j. To be general, they are designed according to IETF RFCs, where no OS specific API was documented.
If you do search for an OS specific agent, or you want this agent to have as many features as possible implemented, you may go to commercial ones. In that case, their presale guys can take your phone calls or mails and give you the answers you want.
您遇到的性能问题与 SNMP4J 无关。我怀疑您的测试用例存在一些编程问题。 SNMP4J 完全能够“直接”(使用 GET PDU)获取任何标准或自定义 MIB 的度量值。
我不知道有任何“更高级”的 API。 SNMP4J 完全实现所有 SNMP 标准。那么你还缺少什么?
The performance problems you encounter are not related to SNMP4J. I would suspect some programming issues with your test case. SNMP4J perfectly is able to "directly" (using GET PDU) fetch metric values for any standard or custom MIB.
I am not aware of any "more advanced" API. SNMP4J fully implements all SNMP standards. So what are you missing?