# External-check command is not working with MySQL servers

**URL:** https://discourse.haproxy.org/t/external-check-command-is-not-working-with-mysql-servers/56
**Category:** Help!
**Created:** [January 3, 2016, 3:44am UTC](https://discourse.haproxy.org/t/external-check-command-is-not-working-with-mysql-servers/56 "2016-01-03T03:44:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ikapriz](https://avatars.discourse-cdn.com/v4/letter/i/e8c25b/32.png) [@ikapriz](https://discourse.haproxy.org/u/ikapriz)
#### Post date: [January 3, 2016, 3:44am UTC](https://discourse.haproxy.org/t/external-check-command-is-not-working-with-mysql-servers/56/1 "2016-01-03T03:44:01Z")

</div>

Trying to use the external-check settings and it does not seem to work at all. Servers are permanently marked down.

Config that is using mysql-check works fine:  
` global  
log /dev/log local0  
log /dev/log local1 notice  
chroot /var/lib/haproxy  
stats socket /run/haproxy/admin.sock mode 660 level admin  
stats timeout 30s  
user haproxy  
group haproxy  
daemon  
external-check  
debug

```
defaults
    log global
    retries 2
    timeout connect 3000
    timeout server 5000
    timeout client 5000

frontend mysql-cluster
    bind 0.0.0.0:3306
    default_backend servers

backend servers
    log global
    mode tcp
    option mysql-check
    #option external-check
    #external-check command /bin/true
    #external-check path "/usr/bin:/bin"
    option tcplog
    balance roundrobin
    option log-health-checks
    server mysql-1 aurora-test-1.cgqagbohyssb.us-east-1.rds.amazonaws.com:3306 check
    server mysql-2 aurora-test-2.cgqagbohyssb.us-east-1.rds.amazonaws.com:3306 check

```

`` # pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate\_lim,rate\_max,check\_status,check\_code,check\_duration,hrsp\_1xx,hrsp\_2xx,hrsp\_3xx,hrsp\_4xx,hrsp\_5xx,hrsp\_other,hanafail,req\_rate,req\_rate\_max,req\_tot,cli\_abrt,srv\_abrt,comp\_in,comp\_out,comp\_byp,comp\_rsp,lastsess,last\_chk,last\_agt,qtime,ctime,rtime,ttime,  
mysql-cluster,FRONTEND,0,0,2000,0,0,0,0,0,0,OPEN,1,2,0,0,0,0,0,0,0,0,0,0,0,0,  
servers,mysql-1,0,0,0,0,0,0,0,0,0,0,0,0,UP,1,1,0,0,0,461,0,1,3,1,0,2,0,0,L7OK,0,3,0,0,0,-1,5.6.10,0,0,0,0,  
servers,mysql-2,0,0,0,0,0,0,0,0,0,0,0,0,UP,1,1,0,0,0,461,0,1,3,2,0,2,0,0,L7OK,0,1,0,0,0,-1,5.6.10,0,0,0,0,  
servers,BACKEND,0,0,0,0,200,0,0,0,0,0,0,0,0,0,UP,2,2,0,0,461,0,1,3,0,0,1,0,0,0,0,0,0,0,0,-1,0,0,0,0,  
`

Same exact config with external-check always shows servers down:  
` global  
log /dev/log local0  
log /dev/log local1 notice  
chroot /var/lib/haproxy  
stats socket /run/haproxy/admin.sock mode 660 level admin  
stats timeout 30s  
user haproxy  
group haproxy  
daemon  
external-check  
debug

```
defaults
    log global
    retries 2
    timeout connect 3000
    timeout server 5000
    timeout client 5000

frontend mysql-cluster
    bind 0.0.0.0:3306
    default_backend servers

backend servers
    log global
    mode tcp
    #option mysql-check
    option external-check
    external-check command /bin/true
    external-check path "/usr/bin:/bin"
    option tcplog
    balance roundrobin
    option log-health-checks
    server mysql-1 aurora-test-1.cgqagbohyssb.us-east-1.rds.amazonaws.com:3306 check
    server mysql-2 aurora-test-2.cgqagbohyssb.us-east-1.rds.amazonaws.com:3306 check

```

`` # pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate\_lim,rate\_max,check\_status,check\_code,check\_duration,hrsp\_1xx,hrsp\_2xx,hrsp\_3xx,hrsp\_4xx,hrsp\_5xx,hrsp\_other,hanafail,req\_rate,req\_rate\_max,req\_tot,cli\_abrt,srv\_abrt,comp\_in,comp\_out,comp\_byp,comp\_rsp,lastsess,last\_chk,last\_agt,qtime,ctime,rtime,ttime,  
mysql-cluster,FRONTEND,0,0,2000,0,0,0,0,0,0,OPEN,1,2,0,0,0,0,0,0,0,0,0,0,0,0,  
servers,mysql-1,0,0,0,0,0,0,0,0,0,0,0,0,DOWN,1,1,0,1,1,3,3,1,3,1,0,2,0,0,PROCERR,255,0,0,0,0,-1,0,0,0,0,  
servers,mysql-2,0,0,0,0,0,0,0,0,0,0,0,0,DOWN,1,1,0,1,1,2,2,1,3,2,0,2,0,0,PROCERR,255,0,0,0,0,-1,0,0,0,0,  
servers,BACKEND,0,0,0,0,200,0,0,0,0,0,0,0,0,0,DOWN,0,0,0,1,2,2,1,3,0,0,1,0,0,0,0,0,0,0,0,-1,0,0,0,0,

`

What is the correct way to specify the external checks for mysql servers? Optimal would be to be able to run mysql-check and then external-check script.

---

<div class="post-metadata">

### Author: ![ikapriz](https://avatars.discourse-cdn.com/v4/letter/i/e8c25b/32.png) [@ikapriz](https://discourse.haproxy.org/u/ikapriz)
#### Post date: [January 14, 2016, 1:50pm UTC](https://discourse.haproxy.org/t/external-check-command-is-not-working-with-mysql-servers/56/2 "2016-01-14T13:50:07Z")

</div>

Just to answer my own question - the external check does not work with chroot. Do not specify chroot in global session.

---

<div class="post-metadata">

### Author: ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)
#### Post date: [January 15, 2016, 3:29am UTC](https://discourse.haproxy.org/t/external-check-command-is-not-working-with-mysql-servers/56/3 "2016-01-15T03:29:45Z")

</div>

Or create a chroot with all the binaries and libraries required by your check…
