org.snmp4j.Snmp.discoverAuthoritativeEngineID()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(285)

本文整理了Java中org.snmp4j.Snmp.discoverAuthoritativeEngineID()方法的一些代码示例,展示了Snmp.discoverAuthoritativeEngineID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Snmp.discoverAuthoritativeEngineID()方法的具体详情如下:
包路径:org.snmp4j.Snmp
类名称:Snmp
方法名:discoverAuthoritativeEngineID

Snmp.discoverAuthoritativeEngineID介绍

[英]Discovers the engine ID of the SNMPv3 entity denoted by the supplied address. This method does not need to be called for normal operation, because SNMP4J automatically discovers authoritative engine IDs and also automatically synchronize engine time values.

For this method to operate successfully, the discover engine IDs flag in USM must be true (which is the default).
[中]查找由提供的地址表示的SNMPv3实体的引擎ID。正常操作不需要调用此方法,因为SNMP4J会自动发现权威的引擎ID,并自动同步引擎时间值。
要使此方法成功运行,USM中的discover engine IDs标志必须为true(这是默认值)

代码示例

代码示例来源:origin: org.snmp4j/snmp4j

private byte[] getUserEngineID() {
  byte[] engineID;
  OctetString ne =
      SnmpConfigurator.createOctetString((String)
              ArgumentParser.getValue(settings, "CE", 0),
          null);
  if (ne == null) {
    engineID = ((UserTarget) target).getAuthoritativeEngineID();
  } else {
    engineID = ne.getValue();
  }
  if ((engineID == null) || (engineID.length == 0)) {
    engineID =
        snmp.discoverAuthoritativeEngineID(target.getAddress(),
            target.getTimeout());
  }
  return engineID;
}

代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core

new OctetString(user.getPrivacyPassphrase()));
Snmp snmp = createSnmpSession(target.getAddress());
byte[] authorativeEngine = snmp.discoverAuthoritativeEngineID(target.getAddress(), 8000);
if(authorativeEngine != null) {		      
  OctetString authorativeEngineID = new OctetString(authorativeEngine);

代码示例来源:origin: org.jboss.jbossas/jboss-snmp

new OctetString(user.getPrivacyPassphrase()));
Snmp snmp = createSnmpSession(target.getAddress());
byte[] authorativeEngine = snmp.discoverAuthoritativeEngineID(target.getAddress(), 8000);
if(authorativeEngine != null) {		      
  OctetString authorativeEngineID = new OctetString(authorativeEngine);

相关文章