javadynatrace

Is there an easy way to find all JVMs across all hosts in dynatrace?


Is there an easy way to search dynatrace for all hosts with any java process. Basically trying to find any jvm running on any of our servers. Need to know what server it is, what java vendor, what java version and if possible what technology is using the jvm. I basically need to come up with an inventory of java versions that are out of data and not supported and seems like I should be able to find it easily in dynatrace rather than manually poking around on a hundred servers (many of which I probably dont have direct access to).

If I open an individual host and click on a process (for instance elastic search) I can see this information if I expand properties (EXE=java, JVM vendor=OpenJDK, JVM version=13.0.2, etc). It also seems to know that the process is an elastic search instance vs tomcat or something else (Type=Elasticsearch). I am just not sure how to query for all hosts/processes running a jvm.


Solution

  • You can use the "autotagging" functionality to have a common tag applied to any process with a JVM, see "Settings -> Tags -> Automatically applied tags".

    E.g. name it "jvm".

    Choose "Rule applies to" - "process groups".

    In the rule you can use "Technology" - "Java" as selection.

    It seems you need to define at least some condition here although none is required in this case, so any dummy-condition will do, e.g. "Java main class" - "does NOT begin with" - "zzzzz".

    You should see the new tag be shown for each JVM process in the UI after a short while when auto-tags are applied.

    Then you can use the Dynatrace REST API for "processes" to query for all processes with tag "jvm" and further filter from there.

    If you manage to define a condition for what "outdated" means in your case, you may also be able to put a tag "outdated jvm" on such processes and be able to get the actual list of matching jvms directly.