Splunk AppDynamics

Extract Server Tags from API

Lyubo_Dimitrov
Explorer

Is it possible to get the TAG data of a server from the AppDynamcis API?

I have a Machine Agent installed on an ubuntu hosted on AWS and from the AppDynamics > Servers > Dashboard I can see a pane with "Tags", i.e.:

AWS|Instance-Type

AWS|region

AWS|ami-id

etc..

I am looking for a way to extract this information from the AppDynamics API. 

Labels (1)
Tags (2)
0 Karma
1 Solution

Morelz
Builder

Hey Lyubo

You can do it the following way

Query Auth, to get Token etc.

curl -i --user <username>@<accountname>:<password> https://<controller details>/controller/auth?action=login

Then you query the following 

curl -i -H "Cookie:JSESSIONID=47a106d019813087b904e61f680e;" -H "X-CSRF-TOKEN:f62197d00f39a1fbd5e30852985926173c6328ea" -H "Content-Type: application/json" -H "Accept: application/json" https://<controller details>/controller/sim/v2/user/machines/<machine id>

It brings back everything, including the tags

Ciao

View solution in original post

Morelz
Builder

Hey Lyubo

You can do it the following way

Query Auth, to get Token etc.

curl -i --user <username>@<accountname>:<password> https://<controller details>/controller/auth?action=login

Then you query the following 

curl -i -H "Cookie:JSESSIONID=47a106d019813087b904e61f680e;" -H "X-CSRF-TOKEN:f62197d00f39a1fbd5e30852985926173c6328ea" -H "Content-Type: application/json" -H "Accept: application/json" https://<controller details>/controller/sim/v2/user/machines/<machine id>

It brings back everything, including the tags

Ciao

Lyubo_Dimitrov
Explorer

Hey Mario,

That's perfect! Thanks a lot!

Is this API available on some documentation? I couldn't find it anywhere...

Also, are there any other APIs available which are not described here:
https://docs.appdynamics.com/display/PRO45/AppDynamics+APIs

0 Karma

Morelz
Builder

Hey Lyubo

AppDynamics will only publish their public API's, which they support and will be standardized.

Sometimes these don't have the functionality we require.

The easiest way to find one that are not documented is to use developer options, load the page/data in the UI, and check what calls it's making:)

However Appdynamics will also tell you these are subject to change anytime, as they are not meant to be used this way.

Ciao

Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...