question

Sandeep K. avatar image
Sandeep K. asked ·

How to extract 'restart pending' processes list from Deployment status page?

Scenario -> I'm on deployment status page. We are done with all agents update activity. Now I want to send all these server names and respective 'restart pending' processes to a different team. Pls advise how to do it. I don't want to expand each server and manually copy-paste the processes to a text editor.

Dynatrace Managedoneagenthost monitoringauto-detection
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Julius L. avatar image
Julius L. answered ·

Here is a "2-liner " using curl and jq, just set the TENANT and APITOKEN environment variables:

curl -X GET "https://$TENANT/api/v1/entity/infrastructure/hosts?relativeTime=day&Api-Token=$APITOKEN" -H "accept: application/json; charset=utf-8" |jq -s '.[]| map({(.entityId): .displayName})|add' >hostsmap
curl -X GET "https://$TENANT/api/v1/entity/infrastructure/processes?relativeTime=day&Api-Token=$APITOKEN"| jq -s '.[][]|select ( .monitoringState.restartRequired==true )| .fromRelationships.isProcessOf[0]|=$hosts[.] | { "hostname" : .fromRelationships.isProcessOf[0], "processName": .displayName }' --argfile hosts hostsmap
Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Jose O. avatar image
Jose O. answered ·

You need to build code to query Topology Smartscape Processes API and there you got and example answer like this https://www.dynatrace.com/support/help/extend-dyna...

"monitoringState": {
            "actualMonitoringState": "ON",
            "expectedMonitoringState": "ON",
	    "restartRequired": false
        },

Then you can process restartRequired parameter and check which ones are true.

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

IGOR M. avatar image
IGOR M. answered ·
Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

IGOR M. avatar image
IGOR M. answered ·

Hello.

I am mnot sure it is published out

but you have to study API docs https://www.dynatrace.com/support/help/extend-dyna...

Regards, Igor

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.