The command library provides the following classes:
Article number/class name |
Class Name
Swrba_Command
List of Methods
Method | Description |
String run(String hostname, String username, String password, String exec_username, String exec_password, String commandline) | Execute the command on the specified host. "Success" is returned if execution of the command was successful. An exception is returned if execution of the command failed. |
Integer return_code() | Return the return value of the results of the command execution. 159 to 240 are returned if an internal error occurred during processing within a Ruby script. |
String stdout() | Return the standard output of the results of the command execution. |
String stderr() | Return the standard error output of the results of the command execution. |
Input Information
hostname Specify the host name or IP address.
commandline Specify the command name and argument.
Username Specify the name of the user using SSH to connect to the remote executing host. If the operation component connects with the file transfer infrastructure, the connected user name will be fixed at either of the following names and cannot be changed. In this case, the user name is ignored even if specified.
- If the Business Server is running on Windows: SYSTEM user
- If the Business Server is running on Linux or Solaris: root
password Specify the password of the user using SSH to connect to the remote executing host.
If the operation component connects with the file transfer infrastructure, the password is ignored even if specified.
exec_usernameSpecify the executing user's name.
If the host specified by the "hostname" option is running on Windows and the connection is made using the file transfer infrastructure,
execute the command as a SYSTEM user. In this case, the user name is ignored even if specified.
exec_password This library does not use the value of "execpassword".
The value of "execpassword" is ignored even if specified.
Notes
If the information except for the Management Server has been entered for "hostname", this library uses the file transfer infrastructure or SSH communication to perform its operations. Set either at least to be able to communicate. Refer to the "3.16 Notes of Each Communication Method" for the notes of each communication method.
Note 1: If the information for the Management Server has been entered for 'hostname', SSH communication will not be used and the command will be executed within the Management Server, so follow the command's specifications.
If the connected user and executing user are different, refer to the "3.16.7 Notes When Connected User And Executing User Are Different".
Systemwalker Runbook Automation uses return values between 159 and 240. Return values outside this range and unused return values within the range are values output by the installation command rather than values set by Systemwalker Runbook Automation. Investigate the command itself.
File Location
Windows | <Installation directory>\SWRBAM\rbaope\bin\parts\lib\ standard\swrba_command.rb |
Linux | /opt/FJSVswrbam/rbaope//bin/parts/lib/standard/swrba_command.rb |