Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freddielunchbird/d0eef43a5dfa6e643b9979e19eda2250 to your computer and use it in GitHub Desktop.
Save freddielunchbird/d0eef43a5dfa6e643b9979e19eda2250 to your computer and use it in GitHub Desktop.
#include "common/mysql_helper.js"
function main()
{
var hosts = cluster::mySqlNodes();
var advisorMap = {};
for (idx = 0; idx < hosts.size(); ++idx)
{
host = hosts[idx];
map = host.toMap();
// here you can see what props you have:
// print(map);
slaveIoState = map["replication_slave"]["slave_io_running"];
slaveSqlState = map["replication_slave"]["slave_sql_running"];
if (slaveIoState == #N/A || slaveIoState =="" )
continue;
if (slaveSqlState == #N/A || slaveSqlState =="" )
continue;
print(host, " ", slaveIoState);
print(host, " ", slaveSqlState);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment