Report on devices and device groups

Devices are the foundation of the topologies. Each device may represent a service (database, file server, router, etc). Metrics, events, and properties can be reported on the device level. A device group is a set of devices. Properties can also be reported on a device group level.

To report devices and device groups, use the topology_builder object. The object is accessible as a property of RemoteBasePlugin class, which you can use to create a device group.

Whenever possible, assign IP addresses and ports to devices. Dynatrace AI requires this to detect dependencies among components.

Report on devices

By default, the device technology assignment is defined in the plugin JSON file. Additionally, multiple IP addresses and ports assigned to one device can be reported. You can use them to match discovered services with a specific device.

How to report on a device
Download
from ruxit.api.base_plugin import RemoteBasePlugin

class MyPlugin(RemoteBasePlugin):

	def query(self, **kwargs):
		group = self.topology_builder.create_group("My group", "My group")
		device = group.create_element("My device", "My device")
		device.report_property("my_property", "First device")
		device.add_endpoint("172.18.19.241", 4581)
		device.relative("my_device_counter", 2)

JSON essential
Download
{
	"name": "custom.remote.python.my_plugin",
	"version": "1.001",
	"type": "python",
	"entity": "CUSTOM_DEVICE",
	"processTypeNames": ["PYTHON"],
	"technologies": ["example technology"],
	"source": {
		"package": "my_plugin",
		"className": "MyPlugin",
		"activation": "Remote"
	},
	"metrics": [
		{
			"timeseries": {
				"key": "my_device_counter", 
				"unit": "Count", 
				"displayname": "my counter"}
		}
	]
}

Report on device groups

By default, the device group technology assignment is defined in the plugin JSON file.

How to report on device groups
Download
from ruxit.api.base_plugin import RemoteBasePlugin

class MyPlugin(RemoteBasePlugin):
	def query(self, **kwargs):
		group = self.topology_builder.create_group("My group", "My group")
		group.report_property("my_property", "First group")
		group.absolute("my_group_counter", 1)

JSON essential
Download
{
	"name": "custom.remote.python.my_plugin",
	"version": "1.001",
	"type": "python",
	"entity": "CUSTOM_DEVICE",
	"processTypeNames": ["PYTHON"],
	"technologies": ["example technology"],
	"source": {
		"package": "my_plugin",
		"className": "MyPlugin",
		"activation": "Remote"
	},
	"metrics": [
	{
		"entity": "PROCESS_GROUP", 
		"timeseries": {
			"key": "my_group_counter", 
			"unit": "Count", 
			"displayname": "my counter"}
	}
	],
	"ui": {
	"pgmetrics": [ {
		"key" : "my_group_counter",
		"displayname" : "My counter"
	} ]
}