/** * Apply threshold for specific resource (and required attributes). * Send thresholds events (if exists). */ @Override public void completeResource(CollectionResource resource) { List<Event> eventList = m_thresholdingSet.applyThresholds(resource, m_attributesMap, m_collectionTimestamp); ThresholdingEventProxy proxy = ThresholdingEventProxyFactory.getFactory().getProxy(); proxy.add(eventList); proxy.sendAllEvents(); }
/** * Merges the configuration and update states using parameter entity as a reference. * * @param entity a {@link org.opennms.netmgt.threshd.ThresholdEntity} object. */ public void merge(ThresholdEntity entity) { if (getThresholdConfig().equals(entity.getThresholdConfig()) == false) { sendRearmForTriggeredStates(); getThresholdConfig().merge(entity.getThresholdConfig()); } }
/** {@inheritDoc} */ @Override protected boolean passedThresholdFilters(CollectionResourceWrapper resource, ThresholdEntity thresholdEntity) { if (resource.isAnInterfaceResource() && !resource.isValidInterfaceResource()) { LOG.info("passedThresholdFilters: Could not get data interface information for '{}' or this interface has an invalid ifIndex. Not evaluating threshold.", resource.getIfLabel()); return false; } return super.passedThresholdFilters(resource, thresholdEntity); }
/** * <p>getConfigWrapper</p> * * @param baseDef a {@link org.opennms.netmgt.config.threshd.Basethresholddef} object. * @return a {@link org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper} object. * @throws org.opennms.netmgt.threshd.ThresholdExpressionException if any. */ public static BaseThresholdDefConfigWrapper getConfigWrapper(Basethresholddef baseDef) throws ThresholdExpressionException { if(baseDef instanceof Threshold) { return new ThresholdConfigWrapper((Threshold)baseDef); } else if(baseDef instanceof Expression) { return new ExpressionConfigWrapper((Expression)baseDef); } return null; }
private CollectionResourceWrapper createWrapper(SnmpCollectionResource resource, Map<String, CollectionAttribute> attributes, Date timestamp) { CollectionResourceWrapper wrapper = new CollectionResourceWrapper(timestamp, 1, "127.0.0.1", "SNMP", getRepository(), resource, attributes, getResourceStorageDao()); return wrapper; }
protected boolean isTriggerCountExceeded() { return getExceededCount() >= getThresholdConfig().getTrigger(); }
/** * <p>getGroupName</p> * * @return a {@link java.lang.String} object. */ public String getGroupName() { return m_thresholdGroup.getName(); }
/** {@inheritDoc} */ @Override public ThresholdEvaluatorState getThresholdEvaluatorState(BaseThresholdDefConfigWrapper threshold) { return new ThresholdEvaluatorStateHighLow(threshold); }
public ThresholdType getType() { return getThresholdConfig().getType(); }
/** {@inheritDoc} */ @Override public ThresholdEvaluatorState getThresholdEvaluatorState(BaseThresholdDefConfigWrapper threshold) { return new ThresholdEvaluatorStateRelativeChange(threshold); }
/** {@inheritDoc} */ @Override public void send(Event event) throws EventProxyException { add(event); }
/** {@inheritDoc} */ @Override public ThresholdEvaluatorState getThresholdEvaluatorState(BaseThresholdDefConfigWrapper threshold) { return new ThresholdEvaluatorStateAbsoluteChange(threshold); }
/** {@inheritDoc} */ @Override public ThresholdEvaluatorState getThresholdEvaluatorState(BaseThresholdDefConfigWrapper threshold) { return new ThresholdEvaluatorStateRearmingAbsoluteChange(threshold); }
/** * Should be called when thresholds configuration has been reloaded */ public void refreshThresholds() { if (m_thresholdingSet != null) m_thresholdingSet.reinitialize(); }
@Override public void clearState() { // Based on what evaluator does for rearmed state m_lastSample = Double.NaN; m_triggerCount = 0; setPreviousTriggeringSample(Double.NaN); }
/** {@inheritDoc} */ @Override public ThresholdGroup get(String name) { return get(name, null); }
/** * <p>merge</p> * * @param threshold a {@link org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper} object. */ public void merge(BaseThresholdDefConfigWrapper threshold) { m_baseDef = threshold.getBasethresholddef(); }
/** * <p>getIfResourceType</p> * * @return a {@link org.opennms.netmgt.threshd.ThresholdResourceType} object. */ public ThresholdResourceType getIfResourceType() { return m_thresholdGroup.getIfResourceType(); }
/** * <p>getNodeResourceType</p> * * @return a {@link org.opennms.netmgt.threshd.ThresholdResourceType} object. */ public ThresholdResourceType getNodeResourceType() { return m_thresholdGroup.getNodeResourceType(); }