...
|
...
|
@@ -137,30 +137,30 @@ public class MysqlMonitorServiceImpl { |
|
|
}
|
|
|
result=1;
|
|
|
} catch (SQLException e) {
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus 查询数据库失败",e);
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus 查询数据库失败 "+ipAndPort,e);
|
|
|
} catch (Exception e) {
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus 查询数据库失败",e);
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus 查询数据库失败 "+ipAndPort,e);
|
|
|
} finally {
|
|
|
try {
|
|
|
if(rs!=null){
|
|
|
rs.close();
|
|
|
}
|
|
|
} catch (SQLException e) {
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus finally 关闭resultset异常",e);
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus finally 关闭resultset异常 "+ipAndPort,e);
|
|
|
}
|
|
|
try {
|
|
|
if(st!=null){
|
|
|
st.close();
|
|
|
}
|
|
|
} catch (SQLException e) {
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus finally 关闭Statement异常", e);
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus finally 关闭Statement异常 "+ipAndPort, e);
|
|
|
}
|
|
|
try {
|
|
|
if(con!=null){
|
|
|
con.close();
|
|
|
}
|
|
|
} catch (SQLException e) {
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus finally 关闭connect异常", e);
|
|
|
log.error("MysqlMonitorServiceImpl detectMysqlStatus finally 关闭connect异常 "+ipAndPort, e);
|
|
|
}
|
|
|
//把结果写到influx中
|
|
|
String[] array_ipAndPort=ipAndPort.split(":");
|
...
|
...
|
|