Hitachi

JP1 Version 12 JP1/Integrated Management 2 - Manager Overview and System Design Guide


4.19.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.

Figure 4‒107: Overview of how to execute commands on a managed host from JP1/IM - View

[Figure]

You can also execute commands on a client host (viewer). For details about how to execute commands on a client host, see 4.19.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)

  • Data file (including .vbs) that has a file type (extension) associated with an application that can be run by an automated action

When commands are targeted to managed UNIX hosts:
  • UNIX command

  • Shell script

However, the following types of commands cannot be executed:

#: 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.

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:

(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
  • 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 4.19.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 8.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 8.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 8.1.1 Executing a command by using Command Execution in the JP1/Integrated Management 2 - Manager Administration Guide.

For details about how to execute commands by clicking command buttons, see 8.1.2 Executing a command by using the Command button in the JP1/Integrated Management 2 - Manager Administration Guide.

Figure 4‒108: Flow of processing for command execution (command executed remotely on an agent)

[Figure]

The flow of processing is described below, following the numbers in the figure:

  1. 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.

  2. On receiving the command execution request, JP1/Base on the manager host references the configuration definitions and passes the request to the target host.

  3. 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.

  4. After the command has been executed, JP1/Base on the agent reports the result to the higher-level host defined in the configuration definitions.

  5. 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 8.4.4 Managing command execution.