org.opennms.netmgt.xml.event.Event.getHost()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(100)

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

Event.getHost介绍

[英]Returns the value of field 'host'. The field 'host' has the following description: The host at which the event is generated
[中]返回字段“host”的值。字段“主机”具有以下描述:生成事件的主机

代码示例

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon

@Override
  public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) {
    return event.getHost();
  }
},

代码示例来源:origin: OpenNMS/opennms

@Override
  public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) {
    return event.getHost();
  }
},

代码示例来源:origin: OpenNMS/opennms

return new EventField(name) { public String get(Event event) { return event.getHost(); } };
} else if (name.equals(TAG_INTERFACE)) {

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>getEventHost</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 * @return a {@link java.lang.String} object.
 */
@Override
public String getEventHost(final Event event) {
  if (event.getHost() == null) {
    return null;
  }
  // If the event doesn't have a node ID, we can't lookup the IP address and be sure we have the right one since we don't know what node it is on
  if (!event.hasNodeid()) {
    return event.getHost();
  }
  try {
    return getHostName(event.getNodeid().intValue(), event.getHost());
  } catch (final Throwable t) {
    LOG.warn("Error converting host IP \"{}\" to a hostname, storing the IP.", event.getHost(), t);
    return event.getHost();
  }
}

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon

/**
 * <p>getEventHost</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 * @return a {@link java.lang.String} object.
 */
@Override
public String getEventHost(final Event event) {
  if (event.getHost() == null) {
    return null;
  }
  // If the event doesn't have a node ID, we can't lookup the IP address and be sure we have the right one since we don't know what node it is on
  if (!event.hasNodeid()) {
    return event.getHost();
  }
  try {
    return getHostName(event.getNodeid().intValue(), event.getHost());
  } catch (final Throwable t) {
    LOG.warn("Error converting host IP \"{}\" to a hostname, storing the IP.", event.getHost(), t);
    return event.getHost();
  }
}

代码示例来源:origin: OpenNMS/opennms

retParmVal = Long.toString(event.getNodeid());
} else if (mename.equals(TAG_HOST)) {
  retParmVal = event.getHost();
} else if (mename.equals(TAG_INTERFACE)) {
  retParmVal = event.getInterface();

代码示例来源:origin: OpenNMS/opennms

body.put("host",event.getHost());

代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module

body.put("host",event.getHost());

代码示例来源:origin: org.opennms.features/org.opennms.features.opennms-es-rest

body.put("host",event.getHost());

代码示例来源:origin: OpenNMS/opennms

if (event.getHost() != null) {
  b.append(" Host: " + event.getHost() + "\n");

代码示例来源:origin: OpenNMS/opennms

else
    snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.9.0", "OctetString", "text", "null");
if (event.getHost() != null)
    snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.10.0", "OctetString", "text", event.getHost());
else
    snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.10.0", "OctetString", "text", "null");

代码示例来源:origin: OpenNMS/opennms

private void validateTranslatedEvent(Event event) {
  assertEquals(m_translator.getName(), event.getSource());
  assertEquals(Long.valueOf(3), event.getNodeid());
  assertEquals("www.opennms.org", event.getHost());
  assertEquals("a generated event", event.getDescr());
  assertEquals("192.168.1.1", event.getInterface());
  assertEquals("Switch", EventUtils.getParm(event, "nodeLabel"));
  assertEquals("PSV", event.getService());
  assertEquals("Down", EventUtils.getParm(event, "passiveStatus"));
}

代码示例来源:origin: OpenNMS/opennms

EventConstants.TYPE_SNMP_OCTET_STRING, EventConstants.formatToString(event.getTime()));
addVarBinding(trapBuilder, ".1.3.6.1.4.1.5813.20.1.10.0", // OPENNMS-MIB::openNMS-event-host
       EventConstants.TYPE_SNMP_OCTET_STRING, event.getHost());
addVarBinding(trapBuilder, ".1.3.6.1.4.1.5813.20.1.11.0", // OPENNMS-MIB::openNMS-event-interface
       EventConstants.TYPE_SNMP_OCTET_STRING, iface);

代码示例来源:origin: OpenNMS/opennms

throw new EventProcessorException(e);
oe.setEventHost(event.getHost());
oe.setEventForward((event.getForwardCount() > 0) ? org.opennms.netmgt.dao.util.Forward.format(event.getForward(), EVENT_FORWARD_FIELD_SIZE) : null);
oe.setIfIndex(event.getIfIndex());

代码示例来源:origin: org.opennms/opennms-dao-mock

throw new EventProcessorException(e);
oe.setEventHost(event.getHost());
oe.setEventForward((event.getForwardCount() > 0) ? org.opennms.netmgt.dao.util.Forward.format(event.getForward(), EVENT_FORWARD_FIELD_SIZE) : null);
oe.setIfIndex(event.getIfIndex());

相关文章