private void rescheduleAllServices(Event event) { LOG.info("Poller configuration has been changed, rescheduling services."); getPollerConfig().rebuildPackageIpListMap(); for (Long nodeId : getNetwork().getNodeIds()) { String nodeLabel = null; try { nodeLabel = getPoller().getQueryManager().getNodeLabel(nodeId.intValue()); } catch (final Exception e) { LOG.error("Unable to retrieve nodeLabel for node {}", nodeId, e); } String nodeLocation = null; try { nodeLocation = getPoller().getQueryManager().getNodeLocation(nodeId.intValue()); } catch (final Exception e) { LOG.error("Unable to retrieve nodeLocation for node {}", nodeId, e); } serviceReschedule(nodeId, nodeLabel, nodeLocation, event, true); } }
private void serviceReschedule(Event event, boolean rescheduleExisting) { final Long nodeId = event.getNodeid(); if (nodeId == null || nodeId <= 0) { LOG.warn("Invalid node ID for event, skipping service reschedule: {}", event); return; } String nodeLabel = EventUtils.getParm(event, EventConstants.PARM_NODE_LABEL); try { nodeLabel = getPoller().getQueryManager().getNodeLabel(nodeId.intValue()); } catch (final Exception e) { LOG.error("Unable to retrieve nodeLabel for node {}", nodeId, e); } String nodeLocation = null; try { nodeLocation = getPoller().getQueryManager().getNodeLocation(nodeId.intValue()); } catch (final Exception e) { LOG.error("Unable to retrieve nodeLocation for node {}", nodeId, e); } getPollerConfig().rebuildPackageIpListMap(); serviceReschedule(nodeId, nodeLabel, nodeLocation, event, rescheduleExisting); }
nodeLocation = getPoller().getQueryManager().getNodeLocation(nodeId.intValue()); } catch (final Exception e) { LOG.error("Unable to retrieve nodeLocation for node {}", nodeId, e);