Execute a command in a local shell.
Probe Type ID: exec
Properties:
Name | Type | Default value | Description |
---|---|---|---|
shell |
string | None |
The shell to use when executing the command line. On Unixes, this is defaulted to /bin/sh , on Windows, this is the shell as specified via the COMSPEC environment variable. |
This probe implements a single shot command execution interface (the same as ProbeSsh) for locally executed commands.
Basically you just specify a command to execute that will be executed within a shell, and you get a response once its execution is over. The response contains both an integer return code and the whole command output.
If you consider the command execution is too long (no response received), you can cancel it at any time from the userland. Such a cancellation terminates all the subprocess tree with a SIGKILL signal on POSIX platforms, and a SIGTERM to the started process (not all its subtree) on Windows. Once cancelled, you should not expect a command response anymore.
No interaction is possible during the command execution.
Notes:
All platforms. Tested on Linux (kernel 2.6), Solaris 8, Solaris 10.
None.
The test system interface port bound to such a probe complies with the ExecPortType
port type as specified below:
type union ExecCommand
{
charstring execute,
anytype cancel
}
type record ExecResponse
{
integer status,
charstring output
}
type charstring ErrorResponse;
type port ExecPortType message
{
in ExecCommand;
out ExecResponse, ErrorResponse;
}