Created
July 27, 2017 08:10
-
-
Save freddielunchbird/d0eef43a5dfa6e643b9979e19eda2250 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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