Top
Systemwalker Runbook Automation Reference Guide
Systemwalker

3.12.2 Check port connection

Description

This operation component checks whether a TCP connection can be made on a port for a node (server or network device).

This operation component can be used to check whether communications can be performed using the specified port.

This operation component can be used only when the Management Server is running on Linux.

Options

Basic Options

(1) hostname

Target host name or IP address where the operation component will be executed.

To check the port status execute on the Management Server, specify the following:

  • For IPv4: 'localhost' or '127.0.0.1'

  • For IPv6: 'localhost' or '::1'

However, if the Management Server is on SELinux features and the operation component is executed on its Management Server, specify host name or IP address of the Management Server.

An argument error will occur if the host name or IP address is omitted.

The maximum length of the host name or IP address is 1,024 characters. An argument error will occur if this limit is exceeded.

(2) port

Port number or service name of the node for which connectivity is to be checked.

If you specify a service name, check its corresponding port number registered at /etc/services on the Management Server.

Multiple port numbers or service names can be specified. You may specify the port number and service name collectively.

An argument error will occur if the port number or service name is omitted.

The maximum allowable number of port numbers or service names is 100. An argument error will occur if this limit is exceeded.

The specification is in CSV format. Refer to "3.17 Notes on Specifying Multiple Input Parameters" for examples of multiple specifications.

Specify the port number or service name for the node for which connectability is to be checked as follows:

Example: To check whether a connection can be made via SSH: "ssh"

Example: To check whether connections can be made via ports 22 and 25: "22","25"

Advanced Options

(1) timeout

This is the completion timeout (in seconds) for executing the operation component.

Values between 300 and 86400 (1 day) can be specified.

Example: If the completion timeout is 10 minutes: 600

If the operation component has not finished executing even though the specified time has passed, the processing for the operation component will be interrupted with return value 201.

(2) retry

This is the retry count for executing the operation component.

Specify the number of retry attempts to be used when the operation component terminates with return value 161. Values between 0 and 5 can be specified.

If the operation component terminates with a return value other than "161" as a result of being re-executed from a retry, the execution of the operation component will terminate even if the specified number of retries has not been reached. The return value for the operation component will be the value from the last time the operation component was executed.

Example: To retry twice: 2

(3) retry_interval

This is the retry interval (in seconds) for the operation component.

Specify the time to wait before a retry is attempted if the operation component terminates with return value 161. Values between 1 and 14400 can be specified.

Example: To retry at 300 second intervals: 300


If the specification of the timeout, retry and retry_interval is omitted, and a value beyond the limits of the above-mentioned is input, the value specified with the operation components definition file becomes effective. Refer to "2.5 Definition File for Operation Components" for details.

Return Values

Icon

Name

Return Value

Description

Connection possible

0

Successfully confirmed the port connection. A connection can be established using the specified port.

Connection not possible

161

Failed to confirm the port connection. If a retry count has been specified, retries will be performed.

Failure

196

An option that cannot be specified when the Management Server is running on Linux or Windows has been specified.

197

There is an error with the input information.

198

There is an error with an option specification.

-

-

201

The execution of the operation component has timed out.

202

The operation component has not been executed due to a problem with the settings for executing the operation component.

203

The operation component has not been executed normally. There is a problem with the environment for the Management Server.

205

The operation component has not been executed. There is a problem with the input information specification of the operation component.

206

The operation component has not been executed normally. There is a problem with the output information specification of the operation component.

207

The operation component has not been executed. The operation component may not have been registered on the Management Server.

208

The Automated Operation Process has been canceled because the Automated Operation Process was recovered while the operation component was executing.

Output information

Variable

Description

message

  • If only one port number or service name is specified for the "port" option

    If the operation component checks the port connection successfully, and it is possible to connect to the port, this variable will be set to the following message.

    The operation component was successful.

    If an attempt to check the port connection fails, the content of the error will be set as a string.

  • If multiple port numbers or service names are specified for the "port" option

    If connections can be established to all ports, this variable will be set to the following message.

    The operation component was successful.

    If an attempt to check whether it is possible to connect to some or all of the ports fails, information for the ports that failed to be checked will be set using the same format as the "port_service_check_result" variable.

port_service_check_result

This variable is set to the result of executing the connection check request on the specified server.

port_disconnect_list

This variable is set to a list of port numbers for which connections cannot be established. The specification is in the CSV format.

returnCode

This variable is set to the return value.

The output format for the "port_service_check_result" variable is as follows:

[port],[return value],[output data],[message]


For [output data], nothing will be output.

For [message], one of the following will be output:

Example) If "22,25" was specified for the "port" option, and connections were only possible for port number 22:

"port",Return_code,"Output","Message"
"22",0,"","Success"
"25",161,"","Connection refused."


In the example above, the following will be output to the "message" variable.

Example:

"port",Return_code,"Output","Message"
"25",161,"","Connection refused."

Notes