Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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