diff --git a/cloud-central-control-client/src/main/java/com/cm/central/control/client/socket/service/socket/clientinfo/ClientInfoServiceImpl.java b/cloud-central-control-client/src/main/java/com/cm/central/control/client/socket/service/socket/clientinfo/ClientInfoServiceImpl.java index 4b5ff2d..632582a 100644 --- a/cloud-central-control-client/src/main/java/com/cm/central/control/client/socket/service/socket/clientinfo/ClientInfoServiceImpl.java +++ b/cloud-central-control-client/src/main/java/com/cm/central/control/client/socket/service/socket/clientinfo/ClientInfoServiceImpl.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; import com.cm.central.control.client.socket.config.properties.SocketClientProperties; import com.cm.central.control.client.socket.service.socket.BaseSocketService; import com.cm.common.utils.DateUtil; -import com.cm.socket.enums.SocketMessageEnum; import com.cm.socket.enums.SocketTypeMessageEnum; import com.cm.socket.pojo.Message; import com.sun.management.OperatingSystemMXBean; @@ -98,7 +97,6 @@ public class ClientInfoServiceImpl extends BaseSocketService { clientInfoMap.put("memory", getMemory(operatingSystemMXBean, currentTime)); clientInfoMap.put("jvmMemory", getJVMMemory(currentTime)); clientInfoMap.put("cpu", getCPU(systemInfo, currentTime)); - // clientInfoMap.put("netIO", listNetIO(systemInfo)); return clientInfoMap; } @@ -233,6 +231,9 @@ public class ClientInfoServiceImpl extends BaseSocketService { HardwareAbstractionLayer hardwareAbstractionLayer = systemInfo.getHardware(); List> netIOList = new ArrayList<>(); for (NetworkIF net : hardwareAbstractionLayer.getNetworkIFs()) { + if(net.getIPv4addr() == null || net.getIPv4addr().length == 0) { + continue; + } Map netIOMap = getHashMap(10); netIOMap.put("name", net.getName()); netIOMap.put("displayName", net.getDisplayName());