The Command Line Workstation (CLW) threaddump option was originally available when thread dump creation was added in version 9.1.x but at that time it was not formally documented because it was unsupported. Although it is now fully supported and documented in the latest this KB remains published as an additional source of this information.
Can the Thread Dump feature be run from the CA APM Command Line Workstation?
APM 9.x, 10.x
There are 2 options when running the command to collect a new threaddump file for the agent:
Documentation page for latest APM 10.7 version:
1. By default the thread dump file will be created in the folder <EM_HOME>/threaddumps, where EM_HOME is the home directory of the Collector for the relevant agent.
2. The text format thread dump returned to the CLW client will have the stack truncated if there are more than 10 elements (this is non-configurable) and this is the same result as when saving the thread dump from the Workstation Investigator UI using option "Save as Text button"
3. To see the full thread dump stack requires loading it into the Workstation Investigator UI and viewing with any other external thread analysis tool will likely result in errors.
4. To retrieve the list of already collected threaddump file names use the command:
get List of ThreadDump filenames for the agent matching [REGULAR EXPRESSION]
java -Xmx128M -Duser=admin -Dpassword= -Dhost=EM_host -Dport=EM_port -jar "EM_HOME/lib/CLWorkstation.jar" get List of ThreadDump filenames for the agent matching ".*HostName\|Tomcat\|Tomcat Agent.*"
The output will show:
TD enable on EM = true
TD enable onTomcat Agent = true
5. Per the usual CLW usage the command can also be included as part of shell\batch file and subsequently invoked via Shell Command Action for any required alert.