Interface ServiceCollector

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      CollectionSet collect​(CollectionAgent agent, java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Invokes a collection on the object.
      java.lang.String getEffectiveLocation​(java.lang.String location)
      Allows the collector to override the location at which it should be run.
      RrdRepository getRrdRepository​(java.lang.String collectionName)
      Retrieve the RrdRepository configuration for the given collection.
      java.util.Map<java.lang.String,​java.lang.Object> getRuntimeAttributes​(CollectionAgent agent, java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Invoked before every call to #collect(CollectionAgent, EventProxy, Map) in order to retrieve state/runtime information required for perform the collection.
      void initialize()
      Initialize the collector.
      java.util.Map<java.lang.String,​java.lang.String> marshalParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Marshal the parameter values to strings, which is necessary for passing the parameters over the wire for the RPC call.
      java.util.Map<java.lang.String,​java.lang.Object> unmarshalParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
      Unmarshal the parameter values from strings.
      void validateAgent​(CollectionAgent agent, java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Validate whether or not this collector should be scheduled to run against the given agent.
    • Method Detail

      • validateAgent

        void validateAgent​(CollectionAgent agent,
                           java.util.Map<java.lang.String,​java.lang.Object> parameters)
                    throws CollectionInitializationException
        Validate whether or not this collector should be scheduled to run against the given agent. If the collector cannot, or should not be a run against a given agent, a CollectionInitializationException must be thrown. In the case of the SNMP collector, this is used to prevent collect from scheduling interfaces other than the those marked as primary on a given node.
        Parameters:
        agent -
        parameters -
        Throws:
        CollectionInitializationException
      • collect

        CollectionSet collect​(CollectionAgent agent,
                              java.util.Map<java.lang.String,​java.lang.Object> parameters)
                       throws CollectionException
        Invokes a collection on the object. This call will be performed in both OpenNMS and Minion.
        Parameters:
        agent - a org.opennms.netmgt.collectd.CollectionAgent object.
        parameters - a Map object.
        Returns:
        a org.opennms.netmgt.config.collector.CollectionSet object.
        Throws:
        org.opennms.netmgt.collectd.CollectionException - if any.
        CollectionException
      • getRrdRepository

        RrdRepository getRrdRepository​(java.lang.String collectionName)
        Retrieve the RrdRepository configuration for the given collection. This call will always be performed in OpenNMS.
        Parameters:
        collectionName - a String object.
        Returns:
        a RrdRepository object.
      • getRuntimeAttributes

        java.util.Map<java.lang.String,​java.lang.Object> getRuntimeAttributes​(CollectionAgent agent,
                                                                                    java.util.Map<java.lang.String,​java.lang.Object> parameters)
        Invoked before every call to #collect(CollectionAgent, EventProxy, Map) in order to retrieve state/runtime information required for perform the collection. This call will always be performed in OpenNMS.
        Parameters:
        agent - Includes details about to the agent from which we wish to collect.
        parameters - Includes the service parameters defined in collectd-configuration.xml.
        Returns:
        Additional attributes, which should be added to the parameter map before calling #collect(CollectionAgent, EventProxy, Map).
      • getEffectiveLocation

        java.lang.String getEffectiveLocation​(java.lang.String location)
        Allows the collector to override the location at which it should be run. This call will always be performed in OpenNMS.
        Parameters:
        location - location associated with the service to be monitored
        Returns:
        a possibly updated location
      • marshalParameters

        java.util.Map<java.lang.String,​java.lang.String> marshalParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
        Marshal the parameter values to strings, which is necessary for passing the parameters over the wire for the RPC call. We delegate this task to the ServiceCollector instead of handling it elsewhere since the API, and RPC module do not have access to the model objects used by the collector. This will only be called in OpenNMS when the collector is to be executed remotely.
        Parameters:
        parameters -
        Returns:
      • unmarshalParameters

        java.util.Map<java.lang.String,​java.lang.Object> unmarshalParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Unmarshal the parameter values from strings. This call will always be performed in Minion.
        Parameters:
        parameters -
        Returns: