SExec Connector
Properties Configuration Settings
The SExec Component enables your MuleSoft to execute remote commands over SSH.
Remarks
The SExec Connector uses the SSH "exec" subsystem to remotely execute commands from your Mule Project.
SExec Send Connector
The SExec Send Connector provides an ultra light-weight remote command execution client for your Mule Project. You must first set an SSHHost. If the SSH server requires authentication, you should set the necessary SSHUser, and either SSHPassword or SSHCert depending on the SSHAuthMode you wish to use. Once the SSH server information is set, you must enter the Command you wish to execute.
Whenever called from the Mule Project, the connector will execute the given command. If the outbound message has any data, that data will be supplied to the executing command's standard input.
Once the command has finished executing, the connector will write the output from the command's standard out pipe to the CommandStdOut property in the message context. It will also write the command's exit code to the CommandExitStatus property, and any data from the standard err pipe to the CommandErrorMessage property in the message context.
Send Example
Add an SExec Send connector to the body of your flow. Just as an example, say you would like to execute a script in the SSH user's home directory on the server. Configure the connection settings appropriately and set the Command property to:
sh script.sh
For the purposes of this example, lets say the contents of the script on the remote machine are as follows:
#!/bin/bash echo "Hello from my script!"
The connector will write the standard output resulting from the Command to both the payload of the Mule Message and the CommandStdOut attribute. A logger which prints the message payload behind the SExec Connector in this case shows:
org.mule.runtime.core.internal.processor.LoggerMessageProcessor: Hello from my script!
Additional information about the command such as CommandExitStatus, CommandErrorMessage, and CommandStdErr are available in the attributes collection.
Sender Property List
The following is the full list of the properties of the sender connector with short descriptions. Click on the links for further details.
Command | The command to be sent to the remote host. |
CommandErrorMessage | The error message, if any, returned by the server after command execution. |
CommandExitStatus | The exit code for the executed command for the current message. |
CommandSSHUser | The SSH user name used by the component when executing the command. |
CommandStdErr | The standard error output of the executed Command . |
CommandStdOut | The standard output of the executed Command . |
FailOnError | Controls how the component treats error codes returned by command execution. |
Firewall | A set of properties related to firewall access. |
LogFile | The file to write logging information to at runtime. |
LogMode | What information gets logged during component execution. |
LogType | How information gets logged during component execution. |
Other | Defines a set of configuration settings to be used by the component. |
PersistentConnection | Instructs the component whether to keep the connection to the server open. |
RuntimeLicense | Specifies the component runtime license key. |
SSHAcceptServerHostKey | Instructs the component to accept the server host key that matches the supplied key. |
SSHAuthMode | The type of authentication used by the component. |
SSHCert | The certificate to use for client authentication during the SSH handshake. |
SSHCompressionAlgorithms | A comma-separated list of compression algorithms allowed for this connection. |
SSHHost | The address of the SSH host. |
SSHPassword | The password for SSH password-based authentication. |
SSHPort | The port on the SSH server where the SSH service is running; by default, 22. |
SSHUser | The username for SSH authentication. |
Timeout | A timeout for the component. |
Configuration Settings
The following is a list of configuration settings for the connector with short descriptions. Click on the links for further details.
KeyRenegotiationThreshold | Sets the threshold for the SSH Key Renegotiation. |
LogSSHPackets | If True, detailed SSH packet logging is performed. |
SSHAcceptServerHostKeyFingerPrint | Instructs the component to accept the server's host key with this fingerprint. |
SSHEncryptionAlgorithms | A comma-separated list containing all allowable compression algorithms. |
SSHKeyExchangeAlgorithms | Specifies the supported key exchange algorithms. |
SSHMacAlgorithms | Specifies the supported Mac algorithms. |
SSHPublicKeyAlgorithms | Specifies the supported public key algorithms. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |