...
|
...
|
@@ -5,6 +5,7 @@ import com.model.MObjectInfo; |
|
|
import com.model.RedisMonitor;
|
|
|
import com.monitor.common.util.HttpRestClient;
|
|
|
import com.monitor.common.util.RedisInfoUtil;
|
|
|
import com.monitor.common.util.TelnetUtils;
|
|
|
import com.monitor.middleware.redis.service.IRedisMonitorHandleService;
|
|
|
import com.monitor.mysql.mapper.MObjectInfoMapper;
|
|
|
import com.monitor.mysql.mapper.RedisMonitorMapper;
|
...
|
...
|
@@ -62,8 +63,11 @@ public class RedisMonitorHandleServiceImpl implements IRedisMonitorHandleService |
|
|
List<String> ipList=null;
|
|
|
for(MObjectInfo obj:mlist){
|
|
|
paramMonitor=new StringBuffer();
|
|
|
JSONObject response=httpRestClient.defaultGet("http://" + obj.getMoHostIp() + ":22222/", JSONObject.class);
|
|
|
//JSONObject response=httpRestClient.defaultPost("http://192.168.102.222:22222", null, JSONObject.class);
|
|
|
String result= TelnetUtils.getResult(obj.getMoHostIp(),22222);
|
|
|
if(StringUtils.isBlank(result)){
|
|
|
continue;
|
|
|
}
|
|
|
JSONObject response=JSONObject.parseObject(result);
|
|
|
if(null != response){
|
|
|
int total_connections=(Integer)response.get("total_connections");
|
|
|
int curr_connections=(Integer)response.get("curr_connections");
|
...
|
...
|
@@ -124,7 +128,7 @@ public class RedisMonitorHandleServiceImpl implements IRedisMonitorHandleService |
|
|
paramMonitor.append("内存碎片比率:" + result.get("mem_fragmentation_ratio") + ";");
|
|
|
// paramMonitor.append(":"+isSlave+";");
|
|
|
}
|
|
|
redisInfoList.add(new RedisMonitor(key,ipStr,3,paramMonitor.toString()));
|
|
|
redisInfoList.add(new RedisMonitor(key,ipStr,2,paramMonitor.toString()));
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|