Symexec supports the running of remote execution tasks using the Symphony infrastructure. An execution task is a child process executed by a Symphony service instance using a command line specified by a Symphony client.
Use symexec create to create an execution session in which to run execution tasks. The session stays open until it is explicitly closed.
Use symexec send to send an execution task command in the execution session.
Use symexec fetch to retrieve the statuses of finished execution tasks in the execution session. The statuses are retrieved as return codes or exception description and error codes.
Use symexec run to create an execution session, run a command, retrieve the results and close the session.
To run an execution conmand on Windows, specify the full name including the file extension.
Specifies the name of the application to use. If you do not specify an application name, the application defaults to symexec5.1. If you specify an application name, it must match the application name in the corresponding application profile, and the application must be registered.
Sets the environment variables to be passed to the execution session. Specify as many environment variable/value pairs as required to define the environment.
To specify multiple environment variable/value pairs, separate the pairs with a comma.
Specify a pre-execution command to run before running the executable command. If the pre-execution command is successful, the executable command is run. The command you specify must exist in the same location on every compute host on which it may run, or be accessible from the compute host. Specify an absolute path, or set the path in the PATH environment variable.
The pre-execution command context depends on command association, as follows:
Specify a post-execution command to run. The execution service ensures that if the pre-execution command completes successfully, the post-execution command will always be executed, even if errors occur in the user’s command during the session. The command you specify must exist in the same location on every compute host on which it may run, or be accessible from the compute host. Specify an absolute path, or set the path in the PATH environment variable.
The post-execution command context depends on command association, as follows:
Specify the user ID under which to run the execution session.
Specifies the number of tasks for which to fetch results.
If there are less than n task results available to be retrieved, symexec fetch waits until it can fetch all n tasks, or until the value set for timeout_in_seconds_for_fetch is reached.
If another symexec send or symexec fetch command is issued for the same session ID, the existing symexec fetch client is terminated, because only one client connection can be made to the session at a time.
Specifies the number of seconds to wait for the session results.
If you do not specify a timeout, symexec waits indefinitely until all requested task outputs are received. If you specify 0 seconds, symexec returns immediately with or without the task output.
If the timeout expires and all of the results have still not been received, one of the following happens, depending on the subcommand the timeout is specified for:
Specifies the execution command to run. The executable you specify must exist in the same location on every compute host on which it may run, or be accessible from the compute host. Specify an absolute path, or set the path in the PATH environment variable.
symexec run -u user01 -x 12345 mycmd.exe
Creates an execution session using the default application symexec5.1, runs mycmd.exe, retrieves the results, and closes the session.
The results from an execution task can be in the form of an exit code with optional stdout and stderr data files from the execution task’s command. To retrieve the stdout and stderr data from a completed execution task, you must change its command to run under a shell so the command can redirect the stdout and stderr data to file(s). The file(s) can then be retrieved by either copying the file from the remote host (for example, with an FTP command) or by using a shared file system location.
The followingexamples demonstrate how to retrieve the stdout and stderr data from Windows and Linux hosts.
In this example, the command will take the output of the "dir c:\" command and place it in the dir_content.txt file. The command can be entered in the textbox. The cmd /c opens a command shell and closes it after processing the string.
cmd /c dir c:\ > c:\temp\dir_content.txt
In this example, the command will take the output of the "ls /" command and place it in the root_content.txt file. The sh -c opens a command shell, which reads the commands from the string.