Describes the procedure to write new Neconf events collector.

  1. Create package for a custom collector, for example: netconf_collector

  2. Inside the collector package, develop python code by implementing StreamColletor.

  3. Create or update the required configuration files. Refer the section Configurations

Example: To create a custom netconf collector:

from collectors.stream_collector import StreamCollector 
class NetconfCollector(StreamCollector)

See, sample code for netconf collector in examples directory.

To use the yang model for parsing/ filtering the message in the nnetconf collector use session.get(filter..) as shown below in the example.

filterExp="<network-element-pac></network-element-pac>"
data=self._session.get(filter=("subtree", filterExp)).data_ele
for elem in data.getchildren():
    for innerelem in elem.getchildren():
        if innerelem.tag == "network-element":
            self._elementName=innerelem.text
            break
self._logger.debug("Equipment name %s ", self._elementName)
filterExp="<equipment></equipment>"
data=self._session.get(filter=("subtree",filterExp)).data_ele