大家好! 我有一个示例代码,用于在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 的获取方法调用返回类型...
答案 0 :(得分:0)
这只是您要从中检索某些SNMP信息的设备的IP地址。您可以像"udp:127.0.0.1/161"