02 Nov 2021 09:16 AM - last edited on 18 Nov 2021 05:21 AM by MaciejNeumann
Hi, im trying to build my first activegate extension, the aim is to use the plugin to take information from some files prepared from other sources, then pump the metrics into dynatrace.
However every time i run it, i get the above error.
Sample from my script below.
Ive pretty much copied the demo_activegate_plugin_multi from the examples.
import re import json import os import ruxit.api.topology_builder from ruxit.api.exceptions import ConfigException from ruxit.api.base_plugin import RemoteBasePlugin from ruxit.api.data import PluginProperty class Primary_RTU_Monitoring(RemoteBasePlugin): def query(self, **kwargs): if self.config["debug"]: #debug mode run every min. path = r"E:\Scripts\RTU_IO_MON\LOGS\\" categories = os.listdir(path) for item in categories: topology_group = self.topology_builder.create_group(identifier=item, group_name="RTU_IO_MONITORING") try: file_name = "\results.json" ...........etc
Solved! Go to Solution.
from ruxit.api.topology_builder import TopologyBuilder from ruxit.api.exceptions import ConfigException from ruxit.api.base_plugin import RemoteBasePlugin class My_Plugin_Class(RemoteBasePlugin, TopologyBuilder):
Looks like its an issue with my imports. It now works in the simulator with the arrangement shown. I thought RemoteBasePlugin imported BasePlugin, which in turn imported TopologyBuilder. Guess not.
demo_activegate_plugin_multi.py only imports RemoteBasePlugin.
Hopefully its a fix, time to test deployment.
Fix worked. For the sake of anyone else who stumbles here in future:
When you update the plugin file, you need to stop and start the activegate service, or else your changes will not be loaded. This caught me out for a while. make sure you allow a few min in the stopped state before starting again.
Hi Ben, you can also increase the version in the plugin.json. That will automatically restart the remote plugin module.
Thanks for that Mike, good to know! 👍