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.

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.