You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/website/content/commands/troubleshoot/ports.mdx

48 lines
1.6 KiB

NET-3860 - [Supportability] consul troubleshoot CLI for verifying ports (#18329) * init * udp * added support for custom port * removed grpc * rename constants * removed udp * added change log * fix synopsis * pr comment chagnes * make private * added tests * added one more test case * defer close results channel * removed unwanted comment * licence update * updated docs * fix indent * fix path * example update * Update website/content/commands/troubleshoot/ports.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/commands/troubleshoot/ports.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update command/troubleshoot/ports/troubleshoot_ports.go Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/commands/troubleshoot/ports.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/commands/troubleshoot/index.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update command/troubleshoot/ports/troubleshoot_ports.go Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update command/troubleshoot/ports/troubleshoot_ports.go Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/commands/troubleshoot/ports.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/commands/troubleshoot/ports.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Update website/content/commands/troubleshoot/ports.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * pr comment resolved --------- Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com>
12 months ago
---
layout: commands
page_title: 'Commands: Troubleshoot Ports'
description: >-
The `consul troubleshoot ports` Helps troubleshoot TCP ports by printing if they are open or closed.
---
# Consul Troubleshoot Upstreams
Command: `consul troubleshoot ports`
The `troubleshoot ports` prints TCP port statuses to help you troubleshoot port connectivity.
## Usage
Usage: `consul troubleshoot ports [options]`
#### Command Options
- `-host=<value>` - Host name to troubleshoot TCP ports for. You can also set the `CONSUL_HTTP_ADDR` environment variable instead of using the `-host` flag.
- `-ports=<value>` - Specifies a comma-separated list of custom ports to check.
## Examples
The following example checks the default ports Consul server uses for TCP connectivity. Note that the `CONSUL_HTTP_ADDR` environment variable is set to `localhost`. As a result, the `-host` flag is not required.
Refer to [Required Ports](/consul/docs/install/ports) for additional information.
```shell-session
$ export CONSUL_HTTP_ADDR=localhost
$ consul troubleshoot ports
TCP: Port 8501 on localhost is open.
TCP: Port 8502 on localhost is open.
TCP: Port 8503 on localhost is open.
TCP: Port 8302 on localhost is open.
TCP: Port 8300 on localhost is open.
TCP: Port 8600 on localhost is open.
TCP: Port 8301 on localhost is open.
TCP: Port 8500 on localhost is open.
```
The following example checks TCP ports status on the `hashicorp.com` host.
```shell-session
$ consul troubleshoot ports -host hashicorp.com -ports 80,8077
TCP: Port 80 on hashicorp.com is open.
TCP: Port 8077 on hashicorp.com is closed, unreachable, or the connection timed out.
```