如何为SNMP4J设置指定的引擎ID以发送V3陷阱 [英] How to set a specified engine ID for SNMP4J to send V3 trap

查看:585
本文介绍了如何为SNMP4J设置指定的引擎ID以发送V3陷阱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想在NMS上创建SNMPv3用户时,需要输入引擎ID ,这是来自SNMP代理服务器的每个用户的标识符字符串,因此我输入了一个临时ID. 例如:

When I want to create a SNMPv3 user on the NMS, there need to input an engine ID which is an identifier string from SNMP Agent server for each user, so I input an casual id. For example:

createUser -e "0x80001370017f000101" "mytrapuser1" SHA "user1authpass" AES "user1encypass"
authUser log,execute,net mytrapuser1

我可以使用以下命令将陷阱从代理服务器成功发送到NMS:

And I can successfully send the trap from Agent server to NMS using below command:

snmptrap -v 3 -a SHA -A user1authpass -x AES -X user1encypass -l authPriv -u mytrapuser1 -e 0x80001370017f000101 {NMS-server-ip} 39 12.0.4.0

现在,一切看起来都很好.

Now, everything looks ok.

但是当我想使用Java SNMP4j在代理服务器上与创建的用户mytrapuser1发送陷阱时,我不知道如何将请求的引擎ID指定为0x80001370017f000101,这导致陷阱在代理或请求的上发送失败NMS上无法匹配引擎ID.

But when I want to use java SNMP4j to send trap with the created user mytrapuser1 on Agent server, I don't know how to specify the request's engine id as 0x80001370017f000101, that caused the trap is sent failed on agent or the requested engine ID cannot be matched on the NMS.

我的问题:
1.我应该为SNMP4j设置一个指定的引擎ID来发送陷阱吗?
2.如果不是#1,如何提前获取代理服务器的引擎ID,然后可以使用它在NMS服务器上创建用户?
3.如果有什么我理解错误或使用错误的内容?

My Questions:
1. Should I set a specified engine ID for SNMP4j to send a trap?
2. If #1 is not, how can I get an Agent server's engine id in advance, then I can use it to create user on NMS server?
3. If there are anything I understand wrong or use mistakes?

有没有人可以帮助我,非常感谢.

Is there anyone could help me, thanks very much.

推荐答案

好的,让我们看看.

我如何看待它的设置如下:

How I've seen it setup is the following:

应用程序创建一个引擎ID,用于发送陷阱.该引擎ID与该应用程序相对应,并且可以用作您的应用程序的标识符.

The application creates an engine ID that it uses to send out traps. This engine ID corresponds with the application, and can be used as an identifier for your application.

因此,为了回答问题1,我相信您确实应该设置一个特定的引擎ID. 这也回答了问题2.

So to answer question #1, I believe you should indeed set a specific engine id. Which also answers question #2.

对于工作流程,我认为它应该是这样的:

As for the workflow I believe it to be like this:

  • 为您的应用程序提供了引擎ID.
  • NMS使用您在应用程序中定义的引擎ID创建一个用户.
    • 我建议使引擎id可配置,以便可以轻松更改它,而不必重新编译整个项目.
    • Your application is given an engine id.
    • The NMS creates a user with the engine id that you have defined in your application.
      • I would suggest making the engine id configurable, so that it can be changed easily without having to recompile the whole project.

      这篇关于如何为SNMP4J设置指定的引擎ID以发送V3陷阱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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