大家好!!我有一个示例代码可以在 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 方法调用...