Auto Collecting Engine Data

The collection of data require multiple engine API ( OSGi commands). These APIs are invoked internally and output is exported in file format at a specified location.

bwadmin Command Line

A REST API is provided to collect engine or an AppNode data. Invoke the REST API as POST: http://<host>:<port>/bw/framework.json/collect/.

The engine data collected for an AppNode for TIBCO ActiveMatrix BusinessWorks™ is stored at <user.dir> \..\debug\APPNODE_DATA_<TIME_STAMP>.zip where <user.dir> is of the form

$BW_HOME\bw\<version>\domains\<domain_name>\appnodes\<appspace_name>\<appnode_name>\bin

Execute the following command at the command line to collect AppNode's data:

  1. In a terminal, navigate to BW_HOME\bin and type bwadmin.
  2. Go to MyDomain.
    bwadmin[admin]> cd MyDomain
  3. Go to MyAppSpace.
    bwadmin[admin@MyDomain]> cd MyAppSpace
  4. Start the AppNode, if it is not already running:
    bwadmin[admin@MyDomain/MyAppSpace]> start appnode MyAppNode
  5. Go to MyAppNode
    bwadmin[admin@MyDomain/MyAppSpace]> cd MyAppNode
  6. Run the collectappnodedata command
bwadmin[admin@MyDomain/MyAppSpace/MyAppNode]>collectappnodedata [options] [operation]

The following options are available:

Option Description
-o, -override Delete all previously created data files. Generate new files as per the selected operation. It has two options true or false.

The default option is true.

-i, -input

Input list of operations to be performed. Comma-separated list without space.

Sample input:

"THREAD_DUMP", "HEAP_DUMP", "VM_ARGUMENTS", "ENVIRONMENT_VARIABLES", "THREAD_SNAPSHOT", "MEMORY_SNAPSHOT", "SYSTEM_PROCESS_INFORMATION", "SYSTEM_PROPERTIES", "CPU_INFORMATION", "osgiCommand1", "osgiCommand2"

-d, -domain Domain name
-p, -path Output directory path
-n, -appnode Name of an AppNode
-a, -appspace AppSpace name, Applicable when an entity is an AppNode
-al, -all Download all files from specified directory path.
-dp, -downloadpath Download all files from the specified directory path. It has two options true or false.

The default option is false.

-dd, -downloadanddelete Delete file after download. It has two options true or false.

The default option is false.

--help Display this help message
The following operations are available:
Operation Description
ALL

Admin CLI command:

collectappnodedata -o false -p "D:/appNode/data/" ALL
Options available:
  • override: [optional] Override previously created data. The default value is true.
  • path: [optional] Set output directory path.

Output:

All default set of operations are executed.

Note: SYSTEM_PROCESS_INFORMATION is not executed when running in TIBCO Business Studio™ for BusinessWorks™.
INCLUDE

Admin CLI command:

collectappnodedata -p "D:/appNode/data/" -i "command1","command2" INCLUDE
Only the set of operations given as an input are executed.

Options available:

  • override: [optional] Override previously created data. The default value is true.
  • path: [optional] Set output directory path.
  • input: Set of operations to be executed. Comma-separated list for admin CLI command and JSON list for REST API.

Output:

For Example, if the input list is la,lp,"lapi *",thread_dump, then only these four operations are executed.

Note: Input list is mandatory to execute this operation.
EXCLUDE

Admin CLI command:

collectappnodedata -p "D:/appNode/data/" -i "command1","command2" EXCLUDE
All default set operations excluding the set of operation given as input is executed.

Options available:

  • override: [optional] Override previously created data. The default value is true.
  • path: [optional] Set output directory path.
  • input: [optional] Set of operations to be executed. Comma-separated list for admin CLI command and JSON list for REST API.

Output:

For example, if the input list is la,lp"lapi *",thread_dump, then all default set operation without these four operations are executed. The following operations are executed:

[ "HEAP_DUMP", "VM_ARGUMENTS", "ENVIRONMENT_VARIABLES", "SYSTEM_PROPERTIES", "THREAD_SNAPSHOT", "MEMORY_SNAPSHOT", "SYSTEM_PROCESS_INFORMATION","CPU_INFORMATION", "LMETRICS", "LCFG", "LENDPOINTS"]

Note: Input list is expected for this operation. If the list is empty the operation works similar to ALL operation.
DOWNLOAD

Admin CLI command:

collectappnodedata -p "D:/appNode/data/" -dp "D:/downloads" -al true -dd true DOWNLOAD
The operation is used to download the collected AppNode data.

Options available:

  • path: [optional] the path for the directory where data is collected. OR the path for the file.
  • all: [optional] If the value of option "path" is a directory or if the value is not set, then the path is the default directory.

    If you set the "all" option as TRUE, all files present in that directory having names starting with keyword "APPNODE_DATA" are compressed to a single zip file with name "APPNODE_DATA" and then the file APPNODE_DATA.zip is downloaded.

    If the value is not set or set as false and the path value is a directory, then the last generated file is sent as output.

  • downloadanddelete: [optional] Delete the file after download. It has two options true or false.

    The default option is false.

  • downloadpath: [mandatory and applicable for CLI command] To provide download path directory.

Output:

The file is download at specified download path.

Note: If an option downloadanddelete is selected and the file download operation fails because of network issue, the file is not available for download next time.
LIST

Admin CLI command:

collectappnodedata -p "D:/appNode/data/" LIST

The operation is used to list the data file present at the set path.

Options available:

  • path:[optional] the path for the directory where data is collected. OR the path for the file.

Output:

If the path set is a directory or is a default path, then all files present in that directory having names starting with keyword "APPNODE_DATA" are listed as output. If the path is a file, then it checks if the file exists.

DELETE

Admin CLI command:

collectappnodedata -p "D:/appNode/data/" DELETE

The operation is used to delete the data files created.

Options available:

  • path:[optional] the path for the directory where data is collected. OR the path for the file.

Output:

If the path set is a directory or is a default path, then all files present in that directory having names starting with keyword "APPNODE_DATA" are deleted. If the path is a file, then the file is deleted.

Note: The files with names starting with the keyword "APPNODE_DATA" are deleted.

Admin UI

To collect an AppNode data of a running AppNode using Admin UI :

  1. Navigate to the AppNode level 2 page.
  2. Open the Appnode Data tab.
  3. Select the operation from the list of default operations provided. By default, the following operations are provided:

    "THREAD_DUMP", "HEAP_DUMP", "VM_ARGUMENTS", "ENVIRONMENT_VARIABLES", "SYSTEM_PROPERTIES", "THREAD_SNAPSHOT", "MEMORY_SNAPSHOT","SYSTEM_PROCESS_INFORMATION","CPU_INFORMATION", "LMETRICS", "LCFG", "LP", "LA", "LENDPOINTS","LAPI"

    To select all operations from the list, select the Select All Operation option.

    To add the custom operation to the list, type a name of a custom operations and press Enter.

  4. Click Collect. The dialog box is displayed showing the list of operations selected. Clear the Override check box if you do not want to override the data file.
  5. The AppNode data is collected at the TIBCO_HOME/bw/<version>/domains/<domain_name>/appnodes/<AppSpace_Name>/<AppNode_Name>/debug folder in the .zip format.
  6. The Appnode Data List section shows the list of data files collected at the TIBCO_HOME/bw/<version>/domains/<domain_name>/appnodes/<AppSpace_Name>/<AppNode_Name>/debug folder on your file system.
    • To delete the data file from the Appnode Data List section as well as from your file system, click the Delete button at row level.
    • To delete multiple data files, select the check boxes on the left side of those rows and click the Delete button on top of the list.
    • To download the AppNode's data on your local system, click the Download button on right side of the data file in the list.
    • To download multiple data files, select the check boxes on the left side of those rows and click the Download button on top of the list.
    • To select all entries irrespective of pagination, and perform bulk delete or download operations in the AppNode Data List, select the Select All check box and click Delete or Download buttons on the top of the list.

REST API

API context http://<host>:<port>/bw/framework.json/collect/{operation}
Method POST
Authorization required YES
Header-parameter login
Operations
  • ALL
  • INCLUDE
  • EXCLUDE
  • DOWNLOAD
  • LIST
  • DELETE
For example:
http://<host>:<port>/bw/framework.json/collect/ALL

The operation details are as follows:

Operation Description
ALL This API is used for executing default set of operations.

The default set of operations is as follows:

[ "THREAD_DUMP", "HEAP_DUMP", "VM_ARGUMENTS","ENVIRONMENT_VARIABLES", "SYSTEM_PROPERTIES", "THREAD_SNAPSHOT","MEMORY_SNAPSHOT", "SYSTEM_PROCESS_INFORMATION","CPU_INFORMATION","LMETRICS", "LCFG", "LP", "LA", "LENDPOINTS","LAPI *"]
INCLUDE This API accepts a list of commands or operations as an input in the form of JSON list.

Only listed operations are executed.

EXCLUDE This API accepts a list of commands or operations as an input in the form of JSON list. All default set operations excluding the set of operation given as input is executed.
DOWNLOAD This API is available to download all collected data as a stream APPLICATION_OCTET_STREAM
LIST This API is available to list the files present.
DELETE This API is available to delete data files created.
Header Parameter Description
PATH An optional parameter to provide a directory path where the data is collected or is downloaded.
OVERRIDE An option for collect data operation [ALL, INCLUDE, EXCLUDE], where the data collected previously is overwritten by the new data.

The default value is TRUE.

ALL An option for operation DOWNLOAD, where all files present are compressed at one file with name APPNODE_DATA.zip and downloaded at once. The default value is FALSE.
DOWNLOADANDDELETE An option for operation DOWNLOAD, where the file is deleted after the download operation.

The default value is FALSE.

LOGIN This option is required for authorization of the user. This option is mandatory. It is the login id for the session.

API consumes entity: INPUT

Required Header parameter: Content-Type=application/json

JSON list of commands: Sample input: ["command1" , "command2"].

Applicable for INCLUDE and EXCLUDE operations.