Is there a way to take the output from mysqlshell and use it in a script or similar.
I have set up a basic cluster for testing (3 x MySQL 8.0.27 databases, running on Debian 11).
I am now trying to find a way to capture the output from mysqlshell's cluster.status() output.
As an example, from inside mysqlshell I can run:
cluster=dba.getCluster()
cluster.status().defaultReplicaSet.topology['test-1:3306'].replicationLag
to get the current replication lag. I would like to capture that so it can be monitored automatically.
I assumed most of these statistics would also exist in the performance_schema or mysql_innodb_cluster_metadata databases somewhere, but I can't see them.
Is there a way to do this?