Importing Dynatrace OneAgent host data into Assets

This article walks through importing host data from the Dynatrace OneAgents API into JSM Assets using OnLink, covering authentication, field mapping, pagination, and filtering.

TL;DR

OnLink connects to the Dynatrace environment API, fetches OneAgent host records as JSON, and maps the fields you choose to attributes on a JSM Assets object type. The flow is:

  1. Create or confirm the target Assets schema and object type (e.g., “Hosts”).
  2. Configure an OnLink Assets Data Source that authenticates to Dynatrace with an API token.
  3. Point it at the OneAgents endpoint and fetch sample data.
  4. Map the JSON fields to Assets attributes and run the import.

OneAgent authentication

Dynatrace uses API tokens for authentication. A token has three dot-separated components:

dt0s01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM

Generate the token in Dynatrace (see the Dynatrace API authentication docs) with this scope:

ScopePurpose
oneAgents.readGrants access to GET requests of the OneAgents API

In the OnLink data source configuration:

  1. Add an Assets Data Source.
  2. Set Authentication Type to Bearer Token and paste the Dynatrace token.
  3. Set Method to GET and the URL to your environment’s OneAgents endpoint:
GET https://{your-environment-id}.live.dynatrace.com/api/v1/oneagents
  1. Set Response data path to hosts — the API wraps host records in a hosts array.

Assets Mapping

Once sample data is returned, map the JSON fields to your Assets object type attributes using OnLink mapping statements. Two statement types matter here:

  • key: — identifies the stable unique value used to match and update existing Assets objects. Always define exactly one.
  • map: — copies a JSON field into an Assets attribute.

Example mapping for OneAgent hosts:

MappingPurpose
key:entityId=Entity IDUses the Dynatrace entityId as the unique key so re-imports update rather than duplicate objects
map:displayName=Device NameMaps the host display name to Device Name
map:osType=OS TypeMaps the operating system type
map:osVersion=OS VersionMaps the OS version
map:hypervisorType=Hypervisor TypeMaps the hypervisor type

A few tips:

  • Start with the key: mapping first, then add map: entries for each field you want in Assets.
  • Compare the sample JSON with your object type attributes before importing — attribute names are case-sensitive.
  • For nested values (most host details live under hostInfo), inspect the sample output and use the field path supported by the OnLink mapping configuration.
  • Use Get Data to preview results, verify the key field is unique, and only run the import once the preview looks right.

Filter query

You usually don’t want every host Dynatrace has ever seen. The OneAgents endpoint supports query parameters to limit results server-side — see the OneAgent API parameter reference.

For example, to import only hosts that are currently monitored, add:

availabilityState=MONITORED

Other useful filters include narrowing by management zone, network zone, or update status. Filtering at the API level keeps imports fast and avoids stale or decommissioned hosts landing in your CMDB.

Full step-by-step documentation: Dynatrace OneAgent to JSM Assets

If you are looking to import data from Dynatrace OneAgent without any on-premise installation or Adapter client and completely managed within your Atlassian JSM instance, give OnLink a try.