Class AbstractServiceCollector

    • Constructor Detail

      • AbstractServiceCollector

        public AbstractServiceCollector()
    • Method Detail

      • getRuntimeAttributes

        public Map<String,​Object> getRuntimeAttributes​(CollectionAgent agent,
                                                             Map<String,​Object> parameters)
        Description copied from interface: ServiceCollector
        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.
        Specified by:
        getRuntimeAttributes in interface ServiceCollector
        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

        public String getEffectiveLocation​(String location)
        Description copied from interface: ServiceCollector
        Allows the collector to override the location at which it should be run. This call will always be performed in OpenNMS.
        Specified by:
        getEffectiveLocation in interface ServiceCollector
        Parameters:
        location - location associated with the service to be monitored
        Returns:
        a possibly updated location
      • marshalParameters

        public Map<String,​String> marshalParameters​(Map<String,​Object> parameters)
        Description copied from interface: ServiceCollector
        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.
        Specified by:
        marshalParameters in interface ServiceCollector
        Returns: