use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class DefaultPollerBackEnd method sendUnsuccessfulScanReportEvent.
private void sendUnsuccessfulScanReportEvent(final String reportId, final String locationName, final String failureMessage) {
final EventBuilder eventBuilder = new EventBuilder(EventConstants.REMOTE_UNSUCCESSFUL_SCAN_REPORT_UEI, "PollerBackEnd");
eventBuilder.addParam(PARM_SCAN_REPORT_ID, reportId);
eventBuilder.addParam(PARM_SCAN_REPORT_LOCATION, locationName);
eventBuilder.addParam(PARM_SCAN_REPORT_FAILURE_MESSAGE, failureMessage);
m_eventIpcManager.sendNow(eventBuilder.getEvent());
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class DnsProvisioningAdapter method buildEvent.
private EventBuilder buildEvent(String uei, int nodeId) {
EventBuilder builder = new EventBuilder(uei, "Provisioner", new Date());
builder.setNodeid(nodeId);
return builder;
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class UpdateNotifdStatusServlet method sendEvent.
protected void sendEvent(String uei, HttpServletRequest request) {
EventBuilder bldr = new EventBuilder(uei, "NotifdConfigFactory");
bldr.addParam("remoteUser", request.getRemoteUser());
bldr.addParam("remoteHost", request.getRemoteHost());
bldr.addParam("remoteAddr", request.getRemoteAddr());
try {
EventIpcManagerFactory.getIpcManager().sendNow(bldr.getEvent());
} catch (Throwable t) {
}
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class SnmpManageNodesServlet method sendSNMPRestartEvent.
private void sendSNMPRestartEvent(int nodeid, String primeInt) throws ServletException {
EventBuilder bldr = new EventBuilder(EventConstants.REINITIALIZE_PRIMARY_SNMP_INTERFACE_EVENT_UEI, "web ui");
bldr.setNodeid(nodeid);
bldr.setInterface(addr(primeInt));
sendEvent(bldr.getEvent());
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class PollerBackEndTest method testStatusChangeFromDownToUp.
public void testStatusChangeFromDownToUp() {
expect(m_locMonDao.get(LOCATION_MONITOR_ID)).andReturn(m_locationMonitor);
expect(m_monSvcDao.get(2)).andReturn(m_dnsService);
expect(m_locMonDao.getMostRecentStatusChange(m_locationMonitor, m_dnsService)).andReturn(m_dnsCurrentStatus);
// called when saving performance data
expect(m_monitoringLocationDao.get(m_locationDefinition.getLocationName())).andReturn(m_locationDefinition);
expect(m_pollerConfig.getPackage(m_package.getName())).andReturn(m_package);
expect(m_pollerConfig.getServiceInPackage("DNS", m_package)).andReturn(m_dnsSvcConfig).times(3);
expect(m_pollerConfig.parameters(m_dnsSvcConfig)).andReturn(m_dnsSvcConfig.getParameters()).times(6);
final PollStatus newStatus = PollStatus.available(1234.0);
OnmsLocationSpecificStatus expectedStatus = new OnmsLocationSpecificStatus(m_locationMonitor, m_dnsService, newStatus);
// TODO: make anticipate method
EventBuilder eventBuilder = new EventBuilder(EventConstants.REMOTE_NODE_REGAINED_SERVICE_UEI, "PollerBackEnd").setMonitoredService(m_dnsService).addParam(EventConstants.PARM_LOCATION_MONITOR_ID, LOCATION_MONITOR_ID);
m_eventIpcManager.getEventAnticipator().anticipateEvent(eventBuilder.getEvent());
m_locMonDao.saveStatusChange(isA(OnmsLocationSpecificStatus.class));
expectLastCall().andAnswer(new StatusChecker(expectedStatus));
m_mocks.replayAll();
m_backEnd.saveResponseTimeData(m_locationMonitor.getId(), m_dnsService, 1234, m_package);
m_backEnd.reportResult(LOCATION_MONITOR_ID, 2, newStatus);
}
Aggregations