admin/test_amt_connection.bat
lvfengfree 8b07d8f52a feat: 实现 AMT 设备自动添加功能(仅 Digest 认证)
- 添加 AMT Digest 认证服务 (AmtDigestService)
- 添加 AMT 模拟服务用于测试 (AmtMockService)
- 更新设备控制器支持 AMT 连接测试和设备信息获取
- 前端添加 AMT 自动添加方式,支持手动输入和凭证选择
- 移除 Basic 认证,仅使用 Digest 认证
- 添加 Apache HttpClient 依赖支持 Digest 认证
- 创建相关文档和测试脚本
2026-03-01 14:51:35 +08:00

44 lines
1.8 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
echo ========================================
echo AMT 连接测试工具
echo ========================================
echo.
set /p AMT_IP="请输入 AMT 设备 IP 地址: "
set /p AMT_USER="请输入 AMT 用户名 (默认: admin): "
if "%AMT_USER%"=="" set AMT_USER=admin
echo.
echo 正在测试连接到 %AMT_IP%...
echo.
REM 测试端口 16992 是否开放
echo [1/4] 测试端口 16992 (HTTP)...
powershell -Command "Test-NetConnection -ComputerName %AMT_IP% -Port 16992 -InformationLevel Detailed"
echo.
echo [2/4] 测试端口 16993 (HTTPS)...
powershell -Command "Test-NetConnection -ComputerName %AMT_IP% -Port 16993 -InformationLevel Detailed"
echo.
echo [3/4] 尝试 HTTP 连接...
curl -v -u %AMT_USER% http://%AMT_IP%:16992/wsman -H "Content-Type: application/soap+xml;charset=UTF-8" -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsmid=\"http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd\"><s:Header/><s:Body><wsmid:Identify/></s:Body></s:Envelope>"
echo.
echo [4/4] 尝试 HTTPS 连接...
curl -v -k -u %AMT_USER% https://%AMT_IP%:16993/wsman -H "Content-Type: application/soap+xml;charset=UTF-8" -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsmid=\"http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd\"><s:Header/><s:Body><wsmid:Identify/></s:Body></s:Envelope>"
echo.
echo ========================================
echo 测试完成
echo ========================================
echo.
echo 提示:
echo - 如果端口不通,请检查防火墙设置
echo - 如果返回 401请检查用户名和密码
echo - 如果返回 404AMT 可能未启用
echo - HTTP 端口: 16992, HTTPS 端口: 16993
echo.
pause