Controller (SaaS, On Premise)

cancel
Showing results for 
Search instead for 
Did you mean: 

Export app and machine agent status by Rest Api

Highlighted
Creator

Export app and machine agent status by Rest Api

Hi All,

 

we have a requirement for a project:

 

1. we need to extract all tiers and node details and dump into a CSV file

2. we need the app and machine agent status (agent up, down or % availability) details in the extraction

 

can anyone suggest some Rest API to extract the required data?

 

Regards,

Mandar Kadam

Tags (1)
Export app and machine agent status by Rest Api
8 REPLIES 8
Community Manager

Re: Extracting Node data like App & machine agent status by Rest Api

Hi Mandar,

 

I found this AppD Docs page that I think might help. Let me know if it does. 

 

https://docs.appdynamics.com/display/PRO45/Application+Model+API#ApplicationModelAPI-RetrieveNodeInf...


Thanks,
Ryan, AppDynamics Community Manager




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Highlighted
Creator

Re: Extracting Node data like App & machine agent status by Rest Api

Hi Ryan,

 

Thanks for the reply,

But i have this already and this doesn't serve my goal, i need the status of the nodes like machine and App agent status which we see in tiers and nodes section like agent is 80% up or 0%. 

i want that data.

 

i have found some thing like agent availability metric from metric browser but while execute the API call i get 

<metric-items></metric-items> as output, there should be some value which i see in metric browser in controller that should be displayed but its nothing there.

 

can u or some one here can help in this issue.

 

Regards,

Mandar Kadam

Highlighted
Community Manager

Re: Extracting Node data like App & machine agent status by Rest Api

Hi @mandar.kadam,

 

Thanks for letting me know. If I find other resources I'll send them your way. In the meantime, let's see if the community can jump in and assist you here.


Thanks,
Ryan, AppDynamics Community Manager




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Highlighted

Re: Extracting Node data like App & machine agent status by Rest Api

Hi Mandar, 

Have you found a solution to this?

 

I'm also looking into this topic, where i wan't to output the "Agent Availability" metric to a file. 

 

Have you tried something like this? https://docs.appdynamics.com/display/PRO45/Metric+and+Snapshot+API#MetricandSnapshotAPI-RetrieveMetr... 

 

Best regards, 

Fredrik 

Highlighted
Architect

Re: Export app and machine agent status by Rest Api

Hi There

 

This is what i did, in 3 steps, you can use an automation tool, or just create a script that iterates through the apps,nodes and output it to a CSV.

 

1. Query Applications API to get the Application Names & IDs

https://<controller details>/controller/rest/applications?output=JSON

 

2. Query REST API to get Node Id's per application(Will output App Agent & Machine agent), example will get metrics for last 60 minutes

https://<controller details>/controller/rest/applications/<Application Name>/nodes?output=JSON&time-range-type=BEFORE_NOW&duration-in-mins=60

 

3. Use the IDs to query another API to output the availability you see in the UI

POST

https://<controller details>/controller/restui/v1/nodes/list/health/ids

 

Body of Request(Please replace start_time & end_time with the epoch times you require)

{"requestFilter":[<comma seperated list of node id's>],"resultColumns":["LAST_APP_SERVER_RESTART_TIME","VM_RUNTIME_VERSION","MACHINE_AGENT_STATUS","APP_AGENT_VERSION","APP_AGENT_STATUS","HEALTH"],"offset":0,"limit":-1,"searchFilters":[],"columnSorts":[],"timeRangeStart":<start_time>,"timeRangeEnd":<end_time>}

 

This will output the availability that you see in the UI, for the time period you selected



Learn more about me in the Community Member Spotlight Q & A
Highlighted

Re: Export app and machine agent status by Rest Api

Hello Mario,

 

I don't know much about these issues, but I want to do the same thing as you want to do, but I don't know how. For example, I am getting internal server error while posting the 3rd step. I am using Postman. Can you help me in detail about this?Can you help me in detail about this? I share the screenshot.

 


I have one more question, I will be glad if you can help with this.
As an example, I am making a monthly report. My report criteria are as follows.

Call / Min> 10 + Response time> 3000ms

Call / Min <1 - 10
Response time <1000ms - 5000ms

Unfortunately, I could not pull these values ​​with the api and I have to manually write to excel one by one.example 2.picture

Capture.JPGCapture.2JPG.JPG

 

 

 

Tags (1)
Highlighted
Architect

Re: Export app and machine agent status by Rest Api

Hi Haluk

 

Let's focus on the first problem, querying the data

 

I can see from your Postman screenshot that you have no body defined for that query

 

You should have a payload as mentioned in my initial reply to which ID's you want to query as well as the Time range like below

 

{"requestFilter":[123456,234567],"resultColumns":["LAST_APP_SERVER_RESTART_TIME","VM_RUNTIME_VERSION","MACHINE_AGENT_STATUS","APP_AGENT_VERSION","APP_AGENT_STATUS","HEALTH"],"offset":0,"limit":-1,"searchFilters":[],"columnSorts":[],"timeRangeStart":145908524378,"timeRangeEnd":145908524578}

 

Can you validate or advise what payload you are adding to the query?



Learn more about me in the Community Member Spotlight Q & A
Highlighted

Re: Export app and machine agent status by Rest Api

Hello Mario,

 

This is how I tried, but I want to remind you once again that I am very weak in this regard.

Capture5.JPG

Capture3.JPGCapture4.JPGCapture.1JPG.JPGCapture2.JPGnt to remind you once again that I am very weak in this regard.