增加日志打印输出
This commit is contained in:
@@ -275,22 +275,26 @@ public class AgentUtil {
|
||||
|
||||
while (interfaces.hasMoreElements()) {
|
||||
NetworkInterface ni = interfaces.nextElement();
|
||||
String ipv4 = getIPv4Address(ni);
|
||||
AssertLog.info("ipv4={},接口状态={}",ipv4,ni.isUp());
|
||||
|
||||
// 跳过回环、虚拟、关闭的接口
|
||||
if (ni.isLoopback() || ni.isVirtual() || !ni.isUp()) continue;
|
||||
|
||||
// 判断是否为 Ethernet(通过名称约定:eth*, en*, 等)
|
||||
String name = ni.getName();
|
||||
AssertLog.info("ipv4={},名称={}",ipv4,name);
|
||||
if (!isEthernetInterface(name)) continue;
|
||||
|
||||
AssertLog.info("ipv4={},物理链路状态={}",ipv4,isInterfaceConnected(name));
|
||||
// 检查是否“已连接”(物理链路状态)
|
||||
if (!isInterfaceConnected(name)) continue;
|
||||
|
||||
String ipv4 = getIPv4Address(ni);
|
||||
// 检查IP4信息
|
||||
if (ipv4.equals("N/A")) continue;
|
||||
|
||||
String gateway = getGatewayAddress();
|
||||
AssertLog.info("ipv4={},网关={}",ipv4,gateway);
|
||||
// 检查IP4信息
|
||||
if (gateway.equals("N/A")) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user