Check target health statuses
CLI
If you don't have the Yandex.Cloud command line interface yet, install it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI's get attached resource status command:
$ yc load-balancer network-load-balancer target-states --help
-
Get a list of all network load balancers:
$ yc load-balancer network-load-balancer list +----------------------+--------------------+-------------+----------+----------------+------------------------+----------+ | ID | NAME | REGION ID | TYPE | LISTENER COUNT | ATTACHED TARGET GROUPS | STATUS | +----------------------+--------------------+-------------+----------+----------------+------------------------+----------+ ... | b7r97ah2jn5rmo6k1dsk | test-load-balancer | ru-central1 | EXTERNAL | 1 | b7roi767je4c574iivrk | ACTIVE | ... +----------------------+--------------------+-------------+----------+----------------+------------------------+----------+
-
Choose the
ID
of the load balancer and the target group that is attached to it. -
Request the status of the target group resources:
$ yc load-balancer network-load-balancer target-states b7r97ah2jn5rmo6k1dsk --target-group-id b7roi767je4c574iivrk +----------------------+-----------+-----------+ | SUBNET ID | ADDRESS | STATUS | +----------------------+-----------+-----------+ | e9bc0iisdf7b00b7d4v0 | 10.10.0.4 | UNHEALTHY | | e9bc0iisdf7b00b7d4v0 | 10.10.0.7 | UNHEALTHY | +----------------------+-----------+-----------+