MySQL Forums
Forum List  »  MySQL Shell

capture mysqlshell output for monitoring
Posted by: IGG t
Date: January 26, 2022 06:10AM

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 (please correct me if I am wrong).

Is there a way to do this?

Options: ReplyQuote


Subject
Views
Written By
Posted
capture mysqlshell output for monitoring
811
January 26, 2022 06:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.