From 0ba9e2292d338bbe271fde079e26d6594116e55a Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Tue, 11 Aug 2020 10:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/socket/clientinfo/ClientInfoServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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());