Synopsis
[Windows]
mjrmtjob.exe -h <host name on remote machine> [-p <OS on remote machine>] [-l <char set on remote machine>] [-u <user name for exec on remote machine>] -d <cur dir for exec on remote machine> "<command/script and parms...>" |
[UNIX]
mjrmtjob -h <host name on remote machine > [-p <OS on remote machine>] [-l <char set on remote machine>] [-u <user name for exec on remote machine>] -d '<cur dir for exec on remote machine' '<command/script and parms...>' |
Description
Execute commands or scripts on a remote machine where Systemwalker Operation Manager has not been installed.
Options
-h <host name on remote machine>
Specify the host name on the remote machine.
Specify the value using up to 64 bytes.
-p <OS on remote machine>
Specify the type of operating system on the remote machine.
The valid values are: "Linux", "Solaris", and "Windows". The value is not case-sensitive.
If this option is omitted, the operating system on the server that executed the mjrmtjob command is used.
-l <char set on remote machine>
Specify the character set used on the remote machine.
The valid values are: "ASCII", "SJIS", "EUC", and "UTF-8". The operating system determines the character set that can be specified.
The character set used for command and script parameters, standard output, and standard error output is converted based on the specified value.
If this option is omitted or an invalid character set is specified, the command will run (without character set conversion) using the character set used on the server that executed the mjrmtjob command .
The table below lists the character sets that can be specified for each operating system on the remote machine. The value is not case-sensitive.
OS | Valid character sets |
---|---|
Windows | ASCII or SJIS |
Solaris | ASCII, SJIS, EUC, or UTF-8 |
Linux | ASCII or UTF-8 |
-u <user name for exec on remote machine>
Specify the name of the user to be used for command or script execution on the remote machine.
Specify the value using up to 64 bytes. If using the Active Directory, a local account cannot be specified.
If this option is omitted, the user who executed the mjrmtjob command is used.
-d '<cur dir for exec on remote machine>' [Windows]
Specify the full path of the directory on the remote machine in which to execute the command or script. Specify the value using up to 64 bytes.
-d '<cur dir for exec on remote machine>' [UNIX]
Specify the full path of the directory on the remote machine in which to execute the command or script.
Specify the value using up to 64 bytes, enclosed in single quotation marks (').
Operand
'<command/script and parms...>' [Windows]
Specify the command or script to be executed as a job on the remote machine, followed by its parameters.
Specify the value enclosed in double quotation marks (").
'<command/script and parms...>' [UNIX]
Specify the command or script to be executed as a job on the remote machine, followed by its parameters.
Specify the value enclosed in single quotation marks (').
Return Values
Return value | Meaning |
---|---|
201-256 | The command processing has failed or Jobscheduler has returned this completion code. |
Other than the above | Value returned by the executed command/script. |
Command Location
Linux | /usr/bin |
Cautions
You need a remote machine license to execute this command.
This command can be executed only if it is registered as a Systemwalker Operation Manager job. It cannot be executed directly from the command prompt or by any means other than as a Systemwalker Operation Manager job.
If you specify this command in the Add/Change - Job window, all the values that you specify including Directory, Request host, and excecution user are used for this command.
In the Parameters box, specify the parameters for the command or script to be executed.
The following table lists the characters that can be used in the command options:
OS on the remote machine | Valid characters |
---|---|
Windows | Alphanumeric characters and the following symbols: \ . : - _ |
Solaris | Alphanumeric characters and the following symbols: / . - _ |
If the remote machine fails, the files below may remain. If that happens, delete them manually after restarting the remote machine.
OS on the remote machine | Files on the remote machine (*1) |
---|---|
Windows | Files in <cur dir for exec on remote machine>:
|
Solaris | Files in <cur dir for exec on remote machine>:
|
*1: <host-name> is the host name of the server that executed the mjrmtjob command.
The command or script specified in the operand is executed remotely via SSH communication on the remote machine (on a shell in Unix, or by VBScript in Windows).
Therefore, do not execute commands or shell scripts that are likely to cause issues, such as those where control is not returned. Operation of such commands and shell scripts is not guaranteed. The following are examples of problematic commands:
exit command
Command that starts the daemon
yes command
Execution cannot be continued in continuous execution mode.
The following message may be output to the previous log when this command is executed, but this is the message that is output at initial SSH connection and is not an issue:
Warning: Permanently added <host name> (RSA) to the list of known hosts.
The command is executed as a shell script if the remote machine runs Solaris or Linux, or as a batch file if it runs Windows, which affects how operands can be specified (except where double quotation marks (Windows) or single quotation marks (UNIX) are used as characters in a parameter).
Specify the command/script in such a way that the format (excluding the double quotation marks (Windows) or single quotation marks (UNIX) that enclose the operands) can be executed on the remote machine.
Examples [Windows]
Execute the /user/command/keisan command as "UserA" on the Linux server "HOSTB", with the "aaa bbb ccc" parameters, and "/work" as the current directory:
mjrmtjob.exe -h HOSTB -p Linux -l UTF-8 -u UserA -d /work "/user/command/keisan aaa bbb ccc"
When specifying double quotation marks (") as a character in a parameter, add three back slashes (\) before the double quotation mark.
"Tokyo A" ccc" is specified in the parameter.
mjrmtjob.exe -h HOSTB -p Linux -l UTF-8 -u UserA -d /work "/user/command/keisan Tokyo A\\\" ccc"
When specifying an environment variable in a parameter, enclose the environment variable in % as below.
The environment variable XYZ is specified in the parameter.
(Use "Tokyo" as the environment variable XYZ on the remote machine.)
mjrmtjob.exe -h HOSTC -p Windows -l SJIS -u UserA -d d:\work "d:\user\command\keisan %XYZ% aaa"
When executed on the remote machine, it will be as below:
d:\user\command\keisan Tokyo aaa
When specifying a character string enclosed in "%" in the parameter, escape "%" with "%". Specify as below.
A character string "%XYZ%" is specified in the parameter.
mjrmtjob.exe -h HOSTC -p Windows -l SJIS -u UserA -d d:\work "d:\user\command\keisan %%XYZ%% aaa"
When executed on the remote machine, it will be as below:
d:\user\command\keisan %XYZ% aaa
Examples [UNIX]
Execute the /user/command/keisan command as "UserA" on the Linux server "HOSTB", with the "aaa bbb ccc" parameters, and "/work" as the current directory:
mjrmtjob -h HOSTB -p Linux -l UTF-8 -u UserA -d '/work' '/user/command/keisan aaa bbb ccc'
Perform the following procedure to specify a single quotation mark (') in a parameter:
Enclose the command/script and the portion of the parameter up to the single quotation mark in the parameter in single quotation marks (').
Escape the single quotation mark in the parameter with a backslash (\), and then enclose the result in double quotation marks (").
There is no need to escape the single quotation mark if the remote machine runs Windows.
If the parameter continues after the escaped single quotation mark, enclose the remainder in single quotation marks.
Execute the /user/command/keisan command as "UserA" on the Linux server "HOSTB", with the "Tokyo A' ccc" parameters, and "/work" as the current directory:
mjrmtjob -h HOSTB -p Linux -l UTF-8 -u UserA -d '/work' '/user/command/keisan Tokyo A'"\'"' ccc'