【问题标题】:What is Target in snmp4j lib for SNMPSNMP 的 snmp4j 库中的目标是什么
【发布时间】:2013-03-20 07:32:23
【问题描述】:

大家好!! 我有一个示例代码可以在 SNMP 协议中使用 snmp4j 访问设备的某些信息...在示例代码中,他们提供了将检索到的信息转储到某个目标地址的示例代码,但我没有得到这是什么目标地址...

下面是我的代码...

 /**
 * This method returns a Target, which contains information about where the
 * data should be fetched and how.
 *
 * @return
 */
private Target getTarget() {
    Address targetAddress = GenericAddress.parse(address);
    CommunityTarget target = new CommunityTarget();
    target.setCommunity(new OctetString("public"));
    target.setAddress(targetAddress);
    target.setRetries(2);
    target.setTimeout(1500);
    target.setVersion(SnmpConstants.version2c);
    return target;
}

}

并且这个方法已经被ResponseEvent返回类型的Get方法调用了...

【问题讨论】:

    标签: windows networking snmp mib snmp4j


    【解决方案1】:

    这只是您要从中检索某些 SNMP 信息的设备的 IP 地址。可以这样写"udp:127.0.0.1/161"

    Here is an example of a simple SNMP Client with snmp4j

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-13
      相关资源
      最近更新 更多