grpc-ecosystem / grpc-health-probe

A command-line tool to perform health-checks for gRPC applications in Kubernetes and elsewhere

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why echo $(/bin/grpc_health_probe -addr=localhost:50000) get nothing?

stevenlii opened this issue · comments

I want to use multiple liveness to checks the service. So I want put
grpc_health_status=$(/bin/grpc_health_probe -addr=localhost:50000)

and echo $grpc_health_status get the status, but I get nothing, so I want to know why and what's in grpc_health_probe?

`
[root@ed5e4724fc1a data]# grpc_health_status=$(/bin/grpc_health_probe -addr=localhost:50000)
status: SERVING
[root@ed5e4724fc1a data]# echo $grpc_health_status

[root@ed5e4724fc1a data]#
`

$() captures stdout. The printed message is in stderr, that's why it's printed on the screen and not captured.
The printed status is largely for human consumption; not for scripting. See exit status codes in README for programming around this tool.