@Override public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) { return event.getDistPoller(); } },
@Override public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) { return event.getDistPoller(); } },
if (paramMap.containsKey("location")) { effectiveLocation = paramMap.get("location"); } else if (event.getDistPoller() != null) { final OnmsMonitoringSystem monitoringSystem = monitoringSystemDao.get(event.getDistPoller()); if (monitoringSystem != null) { effectiveLocation = monitoringSystem.getLocation(); } else { LOG.info("newSuspect event references monitoring system with id {}, but this system was not found. Using the default location.", event.getDistPoller());
if (paramMap.containsKey("location")) { effectiveLocation = paramMap.get("location"); } else if (event.getDistPoller() != null) { final OnmsMonitoringSystem monitoringSystem = monitoringSystemDao.get(event.getDistPoller()); if (monitoringSystem != null) { effectiveLocation = monitoringSystem.getLocation(); } else { LOG.info("newSuspect event references monitoring system with id {}, but this system was not found. Using the default location.", event.getDistPoller());
@Override public void handleMessage(TrapLogDTO messageLog) { try (Logging.MDCCloseable mdc = Logging.withPrefixCloseable(Trapd.LOG4J_CATEGORY)) { final Log eventLog = toLog(messageLog); eventForwarder.sendNowSync(eventLog); // If configured, also send events for new suspects if (config.getNewSuspectOnTrap()) { eventLog.getEvents().getEventCollection().stream() .filter(e -> !e.hasNodeid()) .forEach(e -> { sendNewSuspectEvent(e.getInterface(), e.getDistPoller()); LOG.debug("Sent newSuspectEvent for interface {}", e.getInterface()); }); } } }
@Override public void handleMessage(TrapLogDTO messageLog) { try (Logging.MDCCloseable mdc = Logging.withPrefixCloseable(Trapd.LOG4J_CATEGORY)) { final Log eventLog = toLog(messageLog); eventForwarder.sendNowSync(eventLog); // If configured, also send events for new suspects if (config.getNewSuspectOnTrap()) { eventLog.getEvents().getEventCollection().stream() .filter(e -> !e.hasNodeid()) .forEach(e -> { sendNewSuspectEvent(e.getInterface(), e.getDistPoller()); LOG.debug("Sent newSuspectEvent for interface {}", e.getInterface()); }); } } }
.forEach(e -> { LOG.trace("Syslogd: Found a new suspect {}", e.getInterface()); sendNewSuspectEvent(localAddr, e.getInterface(), e.getDistPoller()); });
b.append(" Descr: " + event.getDescr() + "\n"); if (event.getDistPoller() != null) { b.append(" DistPoller: " + event.getDistPoller() + "\n");
e.getInterface(), getServiceID(e.getService()), e.getDistPoller() == null ? "00000000-0000-0000-0000-000000000000" : e.getDistPoller(), "Y", "Y",
e.getInterface(), getServiceID(e.getService()), e.getDistPoller() == null ? "00000000-0000-0000-0000-000000000000" : e.getDistPoller(), "Y", "Y",
else snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.1.0", "OctetString", "text", "null"); if (event.getDistPoller() != null) snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.2.0", "OctetString", "text", event.getDistPoller()); else snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.2.0", "OctetString", "text", "null");
if (ovent.getDistPoller() == null && event.getDistPoller() != null && !"".equals(event.getDistPoller().trim())) { ovent.setDistPoller(monitoringSystemDao.get(event.getDistPoller()));
if (ovent.getDistPoller() == null && event.getDistPoller() != null && !"".equals(event.getDistPoller().trim())) { ovent.setDistPoller(monitoringSystemDao.get(event.getDistPoller()));
oe.setEventDescr(event.getDescr()); try { oe.setDistPoller(m_distPollerDao.get(event.getDistPoller())); } catch (final DataAccessException e) { throw new EventProcessorException(e);
oe.setEventDescr(event.getDescr()); try { oe.setDistPoller(m_distPollerDao.get(event.getDistPoller())); } catch (final DataAccessException e) { throw new EventProcessorException(e);