cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

skanchalwar2
Guide

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.

 

4 REPLIES 4

imoskovko1
Inactive

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


imoskovko1
Inactive

jortiz
Inactive

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.


Julius_Loman
DynaMight Legend
DynaMight Legend

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

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts