2.3.2 Collecting the Material Using Commands during Error Detection
The failure detection command is executed by the system when the Management Server detects the logical server failure. To execute the error detection command, specify the values in the keys of mserver.properties (Management Server environment configuration file) during system setup.
- Important note
-
If a logical server process terminates abnormally when Administration Agent is not running, the error detection command is not executed even if you start Administration Agent later. In such cases, when Administration Agent starts, the KEOS20071-E message with details "The command is not defined." is output. For details on the message, see the manual uCosminexus Application Server Messages.
You can use the failure detection command to execute the process for acquiring the thread dump and the user dump when a failure occurs, and obtain the error data quickly. Moreover, if you use the failure detection command, you can also automatically collect the snapshot log at any of the following timing. Decide the acquisition time according to the settings.
-
If a failure occurs in the logical server, the failure detection command is executed and the snapshot log is collected before the logical server is stopped.
-
If a failure occurs in the J2EE server or batch server, the failure detection command is executed and the snapshot log is collected before the J2EE server or batch server is restarted.
There are two types of failure detection commands; the failure detection command provided by the system and the failure detection command created by the user.
- Failure detection command provided by the system
-
This command is already defined in the application server. When a failure occurs in the logical server, the failure detection command provided by the system obtains the information such as the thread dump and the trace based performance analysis of JavaVM of the logical server in which the failure occurred. The data obtained by using the failure detection command provided by the system can be collected as the snapshot log.
According to the default settings, the failure detection command provided by the system is executed when a failure occurs in the logical server and the snapshot log is collected before the logical server in which the error occurred is stopped.
- Failure detection command created by the user
-
A failure detection command can also be created by the user. A batch file or shell script, in which the required process is described by the user for acquiring the data, can be executed as the failure detection command.
To collect the data obtained by using the failure detection command created by the user, as the snapshot log, you need to pre-define the get destination of the data as the collection destination of the snapshot log.
For details about changing the operation settings of commands provided by the system during failure detection or for settings required for commands created by the user during failure detection, see 3.3.1 Data acquisition settings using failure detection time commands (Systems for executing J2EE applications) or 3.3.2 Data acquisition settings using failure detection time commands (Systems for executing batch applications).
- Tip
-
If the necessary settings are not performed when configuring a system, commands during error detection are not executed. Confirm the following settings:
-
When true is set in the com.cosminexus.mngsvr.sys_cmd.abnormal_end.enabled key of mserver.properties (Management Server environment settings file), commands during error detection provided by the system are executed.
-
When true is set in the com.cosminexus.mngsvr.usr_cmd.abnormal_end.enabled key of mserver.properties (Management Server environment settings file), commands created by the user are executed when an error is detected.
-
The information that can be acquired by each type of the above-mentioned command is described below.
- Organization of this subsection
(1) Information that can be acquired by executing the failure detection time commands provided by the system
The following table describes information that can be acquired by executing the commands during error detection provided by the system. The information that can be acquired by executing the commands during error detection differs, depending on the type of error (system down or hang-up) and the OS used.
Note that it is necessary to perform the required settings in adminagent.properties (Administration agent property file) to acquire this information in the snapshot log.
The following table describes the information that can be acquired by executing the commands during error detection.
Logical server |
OS |
Information that you can acquire |
J2EE Application |
Batch Application |
|
---|---|---|---|---|---|
When process down is detected |
When hang up is detected |
||||
Logical performance tracer |
Windows UNIX |
|
-- |
Y |
Y |
Logical J2EE server# |
Windows |
|
|
Y |
Y |
UNIX |
|
|
Y |
Y |
|
Logical Web server |
Windows UNIX |
|
|
Y |
-- |
Other logical servers |
Windows UNIX |
|
|
Y |
-- |
-
Thread dump of a J2EE server or a batch server where the problem occurred
You can acquire a Thread dump when true is set in the adminagent.j2ee.sys_cmd.abnormal_end.threaddump key of adminagent.properties (Administration agent property file).
-
Trace based performance analysis
You can acquire the trace based performance analysis when true is set in the adminagent.sys_cmd.abnormal_end.prftrace key of adminagent.properties (Administration agent property file). The trace based performance analysis file is output to Application-Server-installation-directory/manager/tmp. Note that you can change the output destination with the adminagent.prftrace_dir key in adminagent.properties (Administration Agent property file).
- Important note
-
A Thread dump is not output when it is determined that the J2EE server process where the problem occurred does not exist. Moreover, the trace based performance analysis is not output when it is determined that the performance tracer process does not exist.
(2) Information that can be acquired by executing the commands during error detection created by the user
You can execute batch files or shell scripts in which any process required for acquiring the data is coded, as the user created commands during error detection. For example, you can acquire a user dump or core dump by executing a command such as the drwtsn32 command in this command. For details about how to create failure detection time commands, see 3.3.1 Data acquisition settings using failure detection time commands (Systems for executing J2EE applications) or 3.3.2 Data acquisition settings using failure detection time commands (Systems for executing batch applications).
Note that the command during error detection created by the user is executed if the adminagent.serverkind.usr_cmd.abnormal_end key of adminagent.properties (Administration agent property file) is specified.