I know to check the Galera cluster status, the command that should be used after login to the mysql client is:
SHOW STATUS LIKE 'wsrep%';
but, how to get the output directly from the command line?
The command below result in error:
[root@mariadb01 ~]# mysql -u root -p "SHOW STATUS LIKE 'wsrep%';"
Enter password:
ERROR 1049 (42000): Unknown database 'SHOW STATUS LIKE 'wsrep%';'
I plan to create a simple monitoring using cron and bash, thus the requirement to get the output using command line
After browsing the website http://www.fromdual.com/making-haproxy-high-available-for-mysql-galera-cluster , I found my own answer.
The answer to monitor Galera cluster status from command line is this command:
Example: