02 Nov 2021 04:16 PM - last edited on 18 May 2023 12:34 PM by Michal_Gebacki
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.
I've pretty much copied the demo_activegate_plugin_multi from the examples.
Any thoughts?
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.
03 Nov 2021 12:15 PM
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.
03 Nov 2021 03:38 PM
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.
03 Nov 2021 03:48 PM
Hi Ben, you can also increase the version in the plugin.json. That will automatically restart the remote plugin module.
Mike
03 Nov 2021 03:52 PM
Thanks for that Mike, good to know! 👍