Unix Check Port
- Task type:
ssh_checkport
Description
The Unix Check Port task allows you to verify whether a specific port is open on a destination host, performing the check from the local machine (Default mode) or from a remote server via SSH.
Unlike the Unix Check Connection task, which verifies host reachability, this task checks whether a specific port is open and reachable on the destination system.
Configuration
The configuration is very similar to that of the "Unix Check Connection" task, but with the addition of the port to verify. The task configuration fields can be set manually or via workflow parameters and variables.
Server Connection
- Connection mode: Defines the source of the credentials used for the connection. It can assume three operating modes:
- Default: the check is performed from the local machine.
- Manual: Allows manual entry of connection parameters.
- Environment: Uses a preconfigured connection environment. In this mode, a menu is displayed listing the available connections based on the role associated with the Workflow.
- IP Address: IP address of the remote server.
- Hostname: Hostname of the remote server.
- User: Username used to establish the SSH connection.
- Password: Password associated with the connection user.
- Port: Port used for the SSH connection (the default value is 22).
Run command as another user
By enabling this checkbox, you can run the check with a user different from the one used for the SSH connection.
- User: Name of the user under which the command will be executed.
- Password: Password of the user used to execute the command.
Control Parameters (Destination Host)
- Host: The IP address or hostname of the destination machine on which you want to verify the port.
- Port: The port number you wish to check on the destination host.
Output Parameters
Upon completion of execution, the task makes the following Output Parameters available, usable as input in subsequent tasks of the Workflow.
- result: Contains a textual message describing the outcome of the operation or an error message (e.g., "Missing server address").
- resultJson: Represents the result of the task execution in JSON format, including general information, configurations, and execution details.
- exitStatus: Returns the exit code of the network command executed (likely netcat, telnet, or similar). A value of 0 indicates that the port is open and the connection was successfully established.
Example resultJson parameter
{
"run_info": {
"status": "Completed",
"run_result": "Success"
},
"output_parameters": {
"exitStatus": "0"
}
}
Notes
The task establishes an SSH connection with the remote server and verifies whether the specified port on the target host is open. If the "Run command as another user" option is enabled, the check is performed with a user different from the main SSH connection user.