Le 26 janv. 2015 13:43, "Sébastien ROHAUT" <[email protected]>
a écrit :
>
> Hi,
>
> We're encountering a problem with a http-check expect ! string. here is a
sample of our check url :
>
> {
>   "hostname":"toto",
>   "type":"backend",
>   "isHealthy":true,
>   "healthStatus":"Healthy",
>   "healthyServices":2,
>   "unhealthyServices":0,
>   "services":[{
>     "name":"Elasticsearch",
>     "isServiceHealthy":true,
>     "serviceHealthStatus":"Healthy",
>     "message":"ES Cluster status is GREEN"
>   },{
>     "name":"ZooKeeper",
>     "isServiceHealthy":true,
>     "serviceHealthStatus":"Healthy",
>     "message":"ZK Cluster is available"
>   }],
>   "belisariusRelease":"96"
> }
>
> For the http-check, we want to test the value of  "healthStatus", which
can be "Healthy", "Unhealthy", "DegradedMode". Our server must be put out
of the backend only if value is ""Unhealthy". So, we tried this :
>
> http-check expect ! string "healthStatus":"Unhealthy"
>
> But it doesn't work as expected. In fact, whatever we put, if we use
negation (we didn't tried with something else than string), it doesn't
work. We event tried with "toto" (which we be never here), it's the same :
the server is always excluded from the backend's pool.
>
> At the end, we used to put a rstring :
>
> http-check expect  rstring "healthStatus":"(Healthy|DegradedMode)"
>
> and it seems to work.
>
> What is the problem ? Are we doing something bad, or perhaps we don't
understand the meaning of the negation ?
>
> Thank you for your help.
>
> Sébastien Rohaut
>

Hi,

What does your option httpchk look like?

Baptiste

Reply via email to