Custom properties

ActiveGate plugins enable you to send custom properties for a monitored technology on both, node and node group levels. It has a form of key, value pair, where both are strings.

To send a property, use: report_property(key="Key", value="Value") method:

group.report_property(key='Group version', value="0.5")

or

node.report_property(key='Device version', value="2.3")

The following example presents the complete plugin code:

demo_activegate_plugin_props.py
Download
import json
import requests
from ruxit.api.base_plugin import RemoteBasePlugin
import logging

logger = logging.getLogger(__name__)


class DemoPluginRemote(RemoteBasePlugin):
    def initialize(self, **kwargs):
        config = kwargs['config']
        logger.info("Config: %s", config)
        self.url = config["url"]

    def query(self, **kwargs):
        # Collect stats
        stats = json.loads(requests.get(self.url).content.decode())

        # Create group - provide group id used to calculate unique entity id in dynatrace
        #   and display name for UI presentation
        group = self.topology_builder.create_group(identifier="DemoGroup",
                                                   group_name="ActiveGate Demo Group")
        # report group custom property - any string-string values pair. It is added to device group metadata displayed in dynatrace UI
        group.report_property(key='Group custom property: version', value=stats['version'])
		
        logger.info("1. Group custom property")
        # Create device / node - provide node id used to calculate unique entity id in dynatrace
        #   and display name for UI presentation
        node = group.create_device(identifier="DemoDevice",
                                    display_name="ActiveGate Demo Device")

        logger.info("Topology: group name=%s, node name=%s", group.name, node.name)

        # report property - any string-string values pair. It is added to device metadata displayed in dynatrace UI
        node.report_property(key='Device custom property: version', value=stats['version'])
        logger.info("2. Device custom property")

There are no specific edits required in the plugin.json file.

See an example of custom properties reported on the node group and node levels:

ActiveGate plugin device group properties.

ActiveGate plugin - device custom properties.