List all incoming process connections using API

We have hundreds of Hosts, and among them like 50 running MS SQL database. Now we want to list all hosts/processes calling these MS SQL databases.

For a single host I can select the MS SQL process and use UI to see incoming processes.  Now I want to do that for all servers, using API.  I cant find anything how to do this in scale.  We dont want to do it manually, becuase even if we spend a couple of hours doing it manually, we need an updated report next month.

Any ideas or suggestions?

NOTE, majority of Hosts only have Infrastructure mode agent.

Not sure if this is what you are look for, I think you can get that by using entities API.

entitySelector  query:

type(HOST),toRelationships.isProcessOf(type(PROCESS_GROUP_INSTANCE),toRelationships.isNetworkClientOf(type(PROCESS_GROUP_INSTANCE),softwareTechnologies(MICROSOFT_SQL_SERVER))

This will bring all host that have any PROCESS_GROUP_INSTANCE talking to any SQL Server PROCESS_GROUP_INSTANCES.

Curl example:

curl -X 'GET' \<br>'[dynatrace_url]/api/v2/entities?entitySelector=type(HOST),toRelationships.isProcessOf(type(PROCESS_GROUP_INSTANCE),toRelationships.isNetworkClientOf(type(PROCESS_GROUP_INSTANCE),softwareTechnologies(MICROSOFT_SQL_SERVER)))' \<br>-H 'accept: application/json; charset=utf-8' \<br>-H 'Authorization: Api-Token dt0c01.XXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Same query can be used in auto-tagging rule or management zone.

Hi @holst

Thanks for raising such concern.

  • please note, that Topology & Smartscape - Process group is no longer available under environment Api v1 and it’s accessible through environment Api v2.
  • for which it will require creating an access token with “entities.read” scope.

  • Having admin privileges> go to environment Api v2 > monitored entities > unlock using the created token, otherwise you should have at least the right to create personal access token with “environment:roles:viewer” otherwise the Dynatrace admin will create the token and provide you with the target API to utilize constantly as long as the token will never expire.
  • start specifying the below parameters to get the intended result.

for monthly result

for sorting

Execute and the below result message “200” should appear and you will be able to download the Json file.

for the curl bash you should receive the curl command to call the api externally

curl -X ‘GET’ \
‘https://abcdef/e/env_id/api/v2/entities?pageSize=500&entitySelector=type(HOST)%2CtoRelationships.isProcessOf(type(PROCESS_GROUP_INSTANCE)%2CtoRelationships.isNetworkClientOf(type(PROCESS_GROUP_INSTANCE)%2CsoftwareTechnologies(MICROSOFT_SQL_SERVER))&from=now&to=-30d&sort=sort%3D%2Bname’ \
-H ‘accept: application/json; charset=utf-8’

You can customize the entity selector as per actual requirements as described by @axel_tapia .

Regards,

Peter.