On my test DB server running a MariaDB cluster:
$ ./clustercheck
HTTP/1.1 503 Service Unavailable
Content-Type: text/plain
Connection: close
Content-Length: 44
Percona XtraDB Cluster Node is not synced
$ mysql -u clustercheckuser -p -e "SHOW STATUS LIKE 'wsrep_local_state';"
Enter password:
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| wsrep_local_state | 4 |
+-------------------+-------+
When I corrected the MYSQL_USERNAME to "clustercheckuser", the script now runs correctly. I have created a pull request for this.
$ ./clustercheck
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Content-Length: 40
Percona XtraDB Cluster Node is synced.