<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AppD Inventory Website in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733532#M8529</link>
    <description>&lt;P&gt;Hi. Not sure if you can post json data to WordPress? If so I can share a pythyon script I use for pushing stuff to elastic to get you started.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2019 13:00:23 GMT</pubDate>
    <dc:creator>Gunnar_Svanberg</dc:creator>
    <dc:date>2019-10-31T13:00:23Z</dc:date>
    <item>
      <title>AppD Inventory Website</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733531#M8528</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to create an AppD inventory Website with the following details.&lt;/P&gt;
&lt;P&gt;EAI, Application Name, Agent Type, Agent Version, Environment&amp;nbsp;(PROD,QA, INT &amp;amp; DEV).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;What are the best practices to create this? Do we have any scripts or plugins to do that? I'm thinking about doing it on WordPress by automating the data from CSV or excel.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Sravan&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 15:48:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733531#M8528</guid>
      <dc:creator>Sravan__Sukhava</dc:creator>
      <dc:date>2019-10-30T15:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: AppD Inventory Website</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733532#M8529</link>
      <description>&lt;P&gt;Hi. Not sure if you can post json data to WordPress? If so I can share a pythyon script I use for pushing stuff to elastic to get you started.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733532#M8529</guid>
      <dc:creator>Gunnar_Svanberg</dc:creator>
      <dc:date>2019-10-31T13:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: AppD Inventory Website</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733533#M8530</link>
      <description>&lt;P&gt;Yes Please Share it along with the process and any additional steps I need to do. Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733533#M8530</guid>
      <dc:creator>Sravan__Sukhava</dc:creator>
      <dc:date>2019-10-31T13:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: AppD Inventory Website</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733534#M8531</link>
      <description>&lt;P&gt;Replace mydomain.com in all places&lt;/P&gt;&lt;P&gt;replace uid and pwd in "usage statment"&lt;/P&gt;&lt;P&gt;replace prodserver and testserver with your controllers&lt;/P&gt;&lt;P&gt;replace (if using elastic) esuid and espwd&lt;/P&gt;&lt;P&gt;You need python 3&lt;/P&gt;&lt;P&gt;Produces output like this for each node:&lt;/P&gt;&lt;P&gt;{'appAgentVersion': 'Server Agent #4.5.7.24863 v4.5.7 GA compatible with 4.4.1.0 radaa5f09cafb67679c435337aa86ecda35877078 master', 'machineAgentVersion': '', 'agentType': 'APP_AGENT', 'type': 'Other', 'machineName': 'sso73-openshift-customiz-47-tzc9c', 'appAgentPresent': True, 'nodeUniqueLocalId': '', 'machineId': 271232, 'machineOSType': 'Linux', 'tierId': 2727, 'tierName': 'CD_DEV_sso', 'machineAgentPresent': False, 'name': 'CD_DEV_sso73-openshift-customiz-47-tzc9c', 'ipAddresses': None, 'id': 586157, 'application': 'CD_DEV_sso', 'date': '2019-10-31T13:09:33.468978', 'description': ''}&lt;/P&gt;&lt;P&gt;import requests&lt;BR /&gt;import json&lt;BR /&gt;from requests.utils import requote_uri&lt;BR /&gt;import string&lt;BR /&gt;import urllib.parse&lt;BR /&gt;from ast import literal_eval&lt;BR /&gt;import datetime&lt;BR /&gt;import urllib3&lt;BR /&gt;import sys&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'''&lt;BR /&gt;function to loop through all applications based on it's ID&lt;BR /&gt;'''&lt;BR /&gt;def load(appl):&lt;BR /&gt;ID = str(appl['id'])&lt;BR /&gt;# use the global variable!&lt;BR /&gt;global app_name&lt;BR /&gt;global description&lt;BR /&gt;app_name = appl['name']&lt;BR /&gt;description = appl['description']&lt;BR /&gt;url = f"https://{controller}.mydomain.com:8181/controller/rest/applications/{ID}/nodes?output=json"&lt;BR /&gt;r = requests.get(url, auth=(uid, pwd), verify=False)&lt;BR /&gt;tiers = r.json()&lt;BR /&gt;&lt;BR /&gt;for data in tiers:&lt;BR /&gt;loop_tiers(data)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'''&lt;BR /&gt;loop throough json array as datatype dict&lt;BR /&gt;'''&lt;BR /&gt;def loop_tiers(data):&lt;BR /&gt;global app_name&lt;BR /&gt;global description&lt;BR /&gt;#add stuff to the dictionary&lt;BR /&gt;data['application'] = app_name&lt;BR /&gt;data['date'] = datetime.datetime.utcnow().isoformat()&lt;BR /&gt;data['description'] = description&lt;BR /&gt;print(data)&lt;BR /&gt;# Post it off to elastic&lt;BR /&gt;year = str(datetime.datetime.now().year)&lt;/P&gt;&lt;P&gt;esuid = 'elastic'&lt;BR /&gt;espwd = 'my_elasticpwd'&lt;BR /&gt;esurl = f"&lt;A href="https://myelasticserver.mydomain.com:9243/appd-(year)/_doc/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://myelasticserver.mydomain.com:9243/appd-(year)/_doc/&lt;/A&gt;"&lt;BR /&gt;headers = {'content-type': 'application/json'}&lt;BR /&gt;requests.post(esurl, data=json.dumps(data), auth=(esuid, espwd), headers=headers, verify=False)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'''&lt;BR /&gt;usage stement&lt;BR /&gt;'''&lt;BR /&gt;#set up incoming arguments&lt;BR /&gt;urllib3.disable_warnings()&lt;BR /&gt;if len(sys.argv) != 2:&lt;BR /&gt;print(f"\n To few or to many arguments expects either prod or test as first argumet \n Usage: python {(sys.argv[0])} appdyn_heapsize.py prod|test")&lt;BR /&gt;exit()&lt;BR /&gt;env = str.lower(sys.argv[1])&lt;BR /&gt;if env == 'prod':&lt;BR /&gt;controller = 'prodserver.mydomain.com'&lt;BR /&gt;uid = 'uid@customer1'&lt;BR /&gt;pwd = 'mypwd'&lt;BR /&gt;elif env == 'test':&lt;BR /&gt;controller = 'testserver.mydomain.com'&lt;BR /&gt;uid = 'uid@customer1'&lt;BR /&gt;pwd = 'mypwd'&lt;BR /&gt;else:&lt;BR /&gt;print('\n first argument must be either prod or test \n')&lt;BR /&gt;exit()&lt;/P&gt;&lt;P&gt;'''&lt;BR /&gt;Get all applications and their ID&lt;BR /&gt;'''&lt;BR /&gt;url = f"https://{controller}.mydomain.com:8181/controller/rest/applications?output=json"&lt;BR /&gt;app_name = ''&lt;BR /&gt;description = ''&lt;BR /&gt;r = requests.get(url, auth=(uid, pwd), verify=False)&lt;BR /&gt;applications = r.json()&lt;BR /&gt;# Call load function for each application's ID&lt;BR /&gt;for a_name in applications:&lt;BR /&gt;load(a_name)&lt;/P&gt;&lt;P&gt;exit(0)&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:24:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/AppD-Inventory-Website/m-p/733534#M8531</guid>
      <dc:creator>Gunnar_Svanberg</dc:creator>
      <dc:date>2019-10-31T13:24:00Z</dc:date>
    </item>
  </channel>
</rss>

