3.16.3 Executing commands on managed hosts from JP1/IM - View
In JP1/IM, requests can be issued from the Event Console window to execute a command on a managed host. You perform this request in JP1/IM - View's Execute Command window. The entered execution request is forwarded to the specified host from the manager that you are logged in to, according to the system configuration defined in the JP1/Base configuration management. The command is then executed on the target host.
|
You can also execute commands on a client host (viewer). For details about how to execute commands on a client host, see 3.16.4 Executing commands on client hosts.
The following describes the executable commands, the conditions required for issuing command requests to execute commands on managed hosts (agent hosts or manager hosts), and then the flow of processing for command execution.
- Organization of this subsection
(1) Executable commands
The following types of commands can be executed from JP1/IM - View:
- When commands are targeted to managed Windows hosts:
-
-
Executable file (.com or .exe)
-
Batch file (.bat)
-
Script file of JP1/Script (.spt) (provided the .spt file extension is associated with JP1/Script so that it can be executed)
-
- When commands are targeted to managed UNIX hosts:
-
-
UNIX command
-
Shell script
-
However, the following types of commands cannot be executed:
-
Commands that require interactive operation
-
Commands that display windows
-
Commands that use an escape sequence or control code
-
Internal commands, such as echo and copy
-
Shortcuts# (in Windows)
#: You cannot even execute the shortcuts of the commands listed under When commands are targeted to managed Windows hosts.
Note that commands are executed by the OS user who is the JP1 user logged in to JP1/IM - View.
- Reference note
-
When you execute commands from JP1/IM - View, you cannot directly shut down the OS, but you can control the OS by using JP1/Power Monitor.
(2) Conditions for command execution
The following conditions apply to command execution from JP1/IM - View:
-
The JP1 user who requests command execution from JP1/IM - View must be registered in the authentication server and have the required permission for executing commands remotely.
-
The system configuration must be defined using the JP1/Base configuration management.
-
To execute a command on multiple hosts concurrently, the hosts must be grouped according to the host group definitions of the JP1/Base command execution function.
-
The JP1 user issuing the request must be mapped to an OS user on the target host.
-
To specify the command execution environment, you must first prepare an environment variable definition file on the target host.
(3) Checking the command execution status and result
In the Execute Command window of JP1/IM - View, you can check the status and result of an executed command. To view the command execution log, execute the jcocmdlog command on the manager.
A JP1 event can be issued to report the execution status of a command. Because JP1 events are not issued by default, you must change the settings for issuing JP1 events by specifying the -cmdevent option of the jcocmddef command.
- Important note
-
-
When multiple commands are executed, the results might be output in a different order from the execution order. The result output timing is affected by such things as the time required to execute each command, performance and workload differences among the hosts on which the commands are executed, and retry after a communication error.
-
The Execute Command window in JP1/IM - View shows the command execution results at the time they were received by the manager. Therefore, when you open this window, the displayed result might be for a previously executed command.
-
If you accidentally execute a command that cannot be executed from JP1/IM - View (see 3.16.3(1) Executable commands), the command fails to terminate (message KAVB2013-I is not displayed in the Log area in the Execute Command window). In this situation, you can recover by using the status check and deletion commands provided by JP1/Base. For details, see 7.4.4(6) Commands for troubleshooting.
-
(4) Flow of processing for command execution
The following describes how the JP1/IM and JP1/Base functionality are inter-linked in command execution, taking as an example the flow of processing when a command is executed on an agent from a viewer.
The description below assumes that a JP1 user who has permission to execute commands is logged in to the manager. (For details about login requirements and the permissions required to execute commands, see 7.4.1 Managing JP1 users.) There are two methods of command execution: executing a command by directly entering the command name, or executing a frequently-used command by clicking a command button after registering the command for a button.
For details about how to execute commands by directly entering the command names, see 7.1.1 Executing a command by using Command Execution in the Job Management Partner 1/Integrated Management - Manager Administration Guide.
For details about how to execute commands by clicking command buttons, see 7.1.2 Executing a command by using the Command button in the Job Management Partner 1/Integrated Management - Manager Administration Guide.
|
The flow of processing is described below, following the numbers in the figure:
-
Open the Execute Command window in JP1/IM - View, and execute a command.
In the Execute Command window, you can specify the command type, event information to inherit, target host, command, and the command execution environment. (The command execution environment must be defined in advance by setting up an environment variable definition file on the target host.)
To issue a request to execute the command on an agent, select Command of managed host for Command type.
-
On receiving the command execution request, JP1/Base on the manager host references the configuration definitions and passes the request to the target host.
-
JP1/Base on the agent host where the request was received first references the user mapping definitions and then executes the command using the permissions of the mapped OS user.#
#: User mapping (JP1/Base user management) is processed on the target host where the command is to be executed. Thus, user mapping must be set up in advance on the agent to execute a command from JP1/IM - View on an agent, or on the manager to execute a command from JP1/IM - View on a manager.
-
After the command has been executed, JP1/Base on the agent reports the result to the higher-level host defined in the configuration definitions.
-
On receiving the command execution result, JP1/Base on the manager records the result in a command execution log (ISAM) file, and then reports the result to JP1/IM - View.
Command execution from JP1/IM - View is realized by the JP1/Base command execution function. See also 7.4.4 Managing command execution.