提交 f8ef4a5d authored 作者: 陈泽健's avatar 陈泽健

feat(service): 优化服务自检功能并调整ERP对接参数

- 新增安全合规检测模块,包含弱密码检测和安全基线检查
- 实现MySQL和Redis深度检测功能,包括性能指标和状态监控
- 添加服务器资源增强检测,涵盖inode使用率、TCP状态等
- 更新文档状态标记,完善服务自检执行计划
- 调整ERP对接参数,移除不支持的创建人员传参功能
- 注明创建报告接口暂不支持createuser_name/createuser_id参数
上级 d140c5e1
......@@ -214,7 +214,8 @@ def generate_report_main(
buglist_path: str,
output_path: Optional[str] = None,
project_name: Optional[str] = None,
report_format: str = "docx"
report_format: str = "docx",
skip_erp_prompt: bool = False
) -> List[str]:
"""
生成报告的主函数
......@@ -225,6 +226,7 @@ def generate_report_main(
output_path: 输出报告文件路径(可选)
project_name: 项目名称(可选)
report_format: 报告格式(docx/md/both)
skip_erp_prompt: 是否跳过CLI的ERP上传交互(GUI模式应设为True,由GUI自行处理上传对话框)
Returns:
生成的报告文件路径列表
......@@ -345,6 +347,10 @@ def generate_report_main(
print(f" - {report}")
# ===== ERP上传功能 =====
# GUI模式跳过CLI交互,由GUI自行处理上传对话框
if skip_erp_prompt:
return generated_reports
# 检查是否有docx格式的报告
docx_reports = [r for r in generated_reports if r.endswith('.docx')]
......@@ -355,11 +361,16 @@ def generate_report_main(
logger = setup_logger()
for report_path in docx_reports:
# 询问用户是否上传,并获取测试单ID
confirmed, testing_id = ask_upload_confirmation_cli(report_path)
# 询问用户是否上传,获取测试单ID和抄送人列表
confirmed, testing_id, copyuser_ids = ask_upload_confirmation_cli(report_path)
if confirmed:
print(f"\n正在上传报告到ERP(测试单ID: {testing_id})...")
success = upload_report_to_erp(report_path, logger, developtesting_id=testing_id)
success = upload_report_to_erp(
report_path,
logger,
developtesting_id=testing_id,
copyuser_list=copyuser_ids
)
if success:
print(f" [OK] 报告已成功上传到ERP(测试单ID: {testing_id})")
else:
......
......@@ -329,6 +329,7 @@ ERP_MAX_RETRIES = 3
# ERP接口路径
ERP_UPLOAD_IMAGE_URL = "/openclaw/upload/richtext" # 上传图片接口路径
ERP_CREATE_REPORT_URL = "/openclaw/report" # 创建报告接口路径
ERP_STUFF_URL = "/openclaw/stuff" # 获取人员列表接口路径
# 请求超时时间(秒)
ERP_REQUEST_TIMEOUT = 30
......
......@@ -278,7 +278,7 @@ $Global:OldPlatformUpythonLogs = @(
$ModulePath = Join-Path $global:SCRIPT_DIR "modules"
# 强制卸载已加载的模块(确保使用最新版本)
$ModulesToUnload = @("ServiceCheck", "Common", "DNSCheck", "ServerResourceAnalysis", "NTPCheck", "ContainerCheck", "ConfigIPCheck", "MiddlewareCheck", "AndroidCheck", "LogExport", "Report", "ServerProfile", "DataBackup", "FilePermission", "ShellAdapter")
$ModulesToUnload = @("ServiceCheck", "Common", "DNSCheck", "ServerResourceAnalysis", "NTPCheck", "ContainerCheck", "ConfigIPCheck", "MiddlewareCheck", "AndroidCheck", "LogExport", "Report", "ServerProfile", "DataBackup", "FilePermission", "ShellAdapter", "SecurityCheck")
foreach ($ModuleName in $ModulesToUnload) {
if (Get-Module -Name $ModuleName -ErrorAction SilentlyContinue) {
Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue
......@@ -307,6 +307,7 @@ $ModulesToImport = @(
"FilePermission.psm1",
"ShellAdapter.psm1",
"ServiceCheck.psm1",
"SecurityCheck.psm1",
"DNSCheck.psm1",
"ServerResourceAnalysis.psm1",
"NTPCheck.psm1",
......@@ -381,6 +382,10 @@ $ExpectedFunctions = @(
"Test-RedisConnection",
"Test-MySQLConnection",
"Test-FastDFSConnection",
"Test-MySQLDeepCheck",
"Test-RedisDeepCheck",
# SecurityCheck 模块
"Test-SecurityCheck",
# ConfigIPCheck 模块
"Test-NewPlatformIPs",
"Test-TraditionalPlatformIPs",
......@@ -636,6 +641,18 @@ function Main {
# 中间件连接检测 (PRD 4.18)
Write-Host ""
# 安全合规检测 (PRD 2.1)
Write-Host ""
Write-Log -Level "INFO" -Message "========== 开始安全合规检测 =========="
$securityResults = @()
$secFunc = Get-Command Test-SecurityCheck -ErrorAction SilentlyContinue
if ($secFunc) {
$securityResults = & $secFunc -Server $server -PlatformType $platformType
} else {
Write-Log -Level "WARN" -Message "[安全] SecurityCheck 模块未加载,跳过安全合规检测"
}
Write-Log -Level "INFO" -Message "========== 安全合规检测完成 =========="
Write-Log -Level "INFO" -Message "========== 开始中间件连接检测 =========="
$middlewareResults = @()
......@@ -693,6 +710,29 @@ function Main {
Write-Log -Level "INFO" -Message "========== 中间件连接检测完成 =========="
# MySQL 深度检测 (PRD 2.2)
Write-Host ""
Write-Log -Level "INFO" -Message "========== 开始 MySQL 深度检测 =========="
$mysqlDeepResults = @()
$mysqlDeepFunc = Get-Command Test-MySQLDeepCheck -ErrorAction SilentlyContinue
if ($mysqlDeepFunc) {
$mysqlDeepResults = & $mysqlDeepFunc -Server $server
} else {
Write-Log -Level "WARN" -Message "[MySQL深度] Test-MySQLDeepCheck 函数未加载,跳过"
}
# Redis 深度检测 (PRD 2.3)
Write-Host ""
Write-Log -Level "INFO" -Message "========== 开始 Redis 深度检测 =========="
$redisDeepResults = @()
$redisDeepFunc = Get-Command Test-RedisDeepCheck -ErrorAction SilentlyContinue
if ($redisDeepFunc) {
$redisDeepResults = & $redisDeepFunc -Server $server
} else {
Write-Log -Level "WARN" -Message "[Redis深度] Test-RedisDeepCheck 函数未加载,跳过"
}
Write-Log -Level "INFO" -Message "========== 中间件深度检测完成 =========="
# 检测配置文件中的IP地址
Write-Host ""
Write-Log -Level "INFO" -Message "========== 开始检测配置文件 IP =========="
......@@ -824,7 +864,10 @@ function Main {
-ConsoleResults $consoleResults `
-ContainerInfo $containerInfo `
-AndroidResults $androidResults `
-MiddlewareResults $middlewareResults
-MiddlewareResults $middlewareResults `
-SecurityResults $securityResults `
-MySQLDeepResults $mysqlDeepResults `
-RedisDeepResults $redisDeepResults
}
# 执行主函数
......
......@@ -17,7 +17,10 @@ function Show-HealthReport {
[hashtable]$ConsoleResults,
[array]$ContainerInfo,
[array]$AndroidResults,
[array]$MiddlewareResults
[array]$MiddlewareResults,
[array]$SecurityResults = @(),
[array]$MySQLDeepResults = @(),
[array]$RedisDeepResults = @()
)
if (-not $SCRIPT_DIR -or [string]::IsNullOrWhiteSpace($SCRIPT_DIR)) { $SCRIPT_DIR = (Get-Location).Path }
......@@ -247,6 +250,70 @@ function Show-HealthReport {
Write-Host ""
}
# 资源增强检测(inode/只读挂载/TCP/僵尸进程/TOP5)
if ($ResourceResults) {
# inode 使用率
if ($ResourceResults.Inode -and $ResourceResults.Inode.Count -gt 0) {
Write-Host "【inode 使用率】" -ForegroundColor Yellow
$md += "### inode 使用率"
foreach ($inode in $ResourceResults.Inode) {
$inodeIcon = switch ($inode.Status) { "正常" {"✅"} "警告" {"⚠️"} default {"❌"} }
Write-Host " $($inode.MountPoint): $($inode.Used)/$($inode.Total) ($($inode.Percent)%) [$($inode.Status)]"
$md += "- $inodeIcon $($inode.MountPoint): $($inode.Used)/$($inode.Total) ($($inode.Percent)%) [$($inode.Status)]"
}
$md += ""
Write-Host ""
}
# 只读挂载
if ($ResourceResults.ReadOnlyMounts -and $ResourceResults.ReadOnlyMounts.Count -gt 0) {
Write-Host "【只读挂载告警】" -ForegroundColor Red
$md += "### ⚠️ 只读挂载告警"
foreach ($ro in $ResourceResults.ReadOnlyMounts) {
Write-Host " 发现只读挂载: $ro" -ForegroundColor Red
$md += "- ❌ $ro"
}
$md += ""
Write-Host ""
}
# TCP 状态
if ($ResourceResults.TCPStatus -and $ResourceResults.TCPStatus.Count -gt 0) {
Write-Host "【TCP 状态分布】" -ForegroundColor Yellow
$md += "### TCP 状态分布"
foreach ($key in $ResourceResults.TCPStatus.Keys) {
$md += "- ${key}: $($ResourceResults.TCPStatus[$key])"
}
$md += ""
}
# 僵尸进程
if ($ResourceResults.ZombieProcesses -and $ResourceResults.ZombieProcesses.Count -gt 0) {
$zCount = $ResourceResults.ZombieProcesses.Count
$zIcon = if ($zCount -eq 0) { "✅" } else { "⚠️" }
Write-Host " 僵尸进程: $zCount 个" -ForegroundColor $(if ($zCount -gt 0) { "Yellow" } else { "Green" })
$md += "- $zIcon 僵尸进程: $zCount 个"
if ($zCount -gt 0 -and $ResourceResults.ZombieProcesses.List) {
foreach ($z in $ResourceResults.ZombieProcesses.List) {
$md += " - $z"
}
}
$md += ""
}
# TOP5 进程
if ($ResourceResults.TopProcesses -and $ResourceResults.TopProcesses.Count -gt 1) {
Write-Host "【TOP5 进程(按内存)】" -ForegroundColor Yellow
$md += "### TOP5 进程(按内存)"
foreach ($p in $ResourceResults.TopProcesses | Select-Object -Skip 1) {
Write-Host " $p" -ForegroundColor Gray
$md += "- $($p.Trim())"
}
$md += ""
Write-Host ""
}
}
# NTP 服务(异常->修复时间线)
Write-Host "【NTP 服务检测】" -ForegroundColor Yellow
$md += "## NTP 服务检测"
......@@ -390,6 +457,90 @@ function Show-HealthReport {
Write-Host ""
}
# 安全合规检测结果 (PRD 2.1)
if ($SecurityResults -and $SecurityResults.Count -gt 0) {
Write-Host "【安全合规检测】" -ForegroundColor Yellow
$md += "## 安全合规检测"
$md += ""
# 弱密码检测
$md += "### 弱密码检测"
$weakPwdItems = $SecurityResults | Where-Object { $_.Check -match 'MySQL Root|MySQL 空密码|Redis 密码|EMQX 默认|Linux 空密码' }
foreach ($r in $weakPwdItems) {
$icon = if ($r.Status -eq "正常") { "✅" } elseif ($r.Status -eq "跳过") { "ℹ️" } elseif ($r.Status -eq "危险") { "❌" } else { "⚠️" }
Write-Host " $icon $($r.Check): $($r.Status)"
$md += "- $icon $($r.Check): $($r.Status)"
if ($r.Details) {
$detailParts = $r.Details -split ' \| '
foreach ($part in $detailParts) {
$trimmedPart = $part.Trim()
if ($trimmedPart) { $md += " - $trimmedPart" }
}
}
}
# 安全基线扫描
$md += ""
$md += "### 安全基线扫描"
$baselineItems = $SecurityResults | Where-Object { $_.Check -match 'SUID|crontab|SSH 暴力|异常端口' }
foreach ($r in $baselineItems) {
$icon = if ($r.Status -eq "正常") { "✅" } elseif ($r.Status -eq "跳过") { "ℹ️" } elseif ($r.Status -eq "危险") { "❌" } else { "⚠️" }
Write-Host " $icon $($r.Check): $($r.Status)"
$md += "- $icon $($r.Check): $($r.Status)"
if ($r.Details) {
$detailParts = $r.Details -split ' \| '
foreach ($part in $detailParts) {
$trimmedPart = $part.Trim()
if ($trimmedPart) { $md += " - $trimmedPart" }
}
}
}
$md += ""
Write-Host ""
}
# MySQL 深度检测结果 (PRD 2.2)
if ($MySQLDeepResults -and $MySQLDeepResults.Count -gt 0) {
Write-Host "【MySQL 深度检测】" -ForegroundColor Yellow
$md += "## MySQL 深度检测"
$md += ""
foreach ($r in $MySQLDeepResults) {
$icon = if ($r.Status -eq "正常") { "✅" } elseif ($r.Status -eq "警告") { "⚠️" } else { "❌" }
Write-Host " $icon $($r.Check): $($r.Status)"
$md += "- $icon $($r.Check): $($r.Status)"
if ($r.Details) {
$detailParts = $r.Details -split ' \| '
foreach ($part in $detailParts) {
$trimmedPart = $part.Trim()
if ($trimmedPart) { $md += " - $trimmedPart" }
}
}
}
$md += ""
Write-Host ""
}
# Redis 深度检测结果 (PRD 2.3)
if ($RedisDeepResults -and $RedisDeepResults.Count -gt 0) {
Write-Host "【Redis 深度检测】" -ForegroundColor Yellow
$md += "## Redis 深度检测"
$md += ""
foreach ($r in $RedisDeepResults) {
$icon = if ($r.Status -eq "正常") { "✅" } elseif ($r.Status -eq "建议") { "ℹ️" } elseif ($r.Status -eq "警告") { "⚠️" } else { "❌" }
Write-Host " $icon $($r.Check): $($r.Status)"
$md += "- $icon $($r.Check): $($r.Status)"
if ($r.Details) {
$detailParts = $r.Details -split ' \| '
foreach ($part in $detailParts) {
$trimmedPart = $part.Trim()
if ($trimmedPart) { $md += " - $trimmedPart" }
}
}
}
$md += ""
Write-Host ""
}
# 安卓设备自检结果
if ($AndroidResults -and $AndroidResults.Count -gt 0) {
Write-Host "【安卓设备自检】" -ForegroundColor Yellow
......
<#
<#
.SYNOPSIS
服务器资源分析模块
......@@ -478,6 +478,143 @@ printf "%d,%d,%d\n" "$tot_gb" "$use_gb" "$pct"
#endregion 7. 检测系统负载
#region 8. inode 浣跨敤鐜囨娴 (PRD 2.5)
Write-Log -Level "INFO" -Message "妫娴 inode 浣跨敤鐜..."
$inodeCmd = "df -i | grep -E '^/dev/' | awk '{print `$1,`$2,`$3,`$4,`$5,`$6}'"
$inodeResult = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $inodeCmd
$inodeList = @()
if ($inodeResult.ExitCode -eq 0 -and $inodeResult.Output) {
$inodeLines = $inodeResult.Output -split "`n" | Where-Object { $_ -match '\S' }
foreach ($line in $inodeLines) {
$parts = $line -split '\s+'
if ($parts.Count -ge 6) {
$device = $parts[0]
$iTotal = $parts[1]
$iUsed = $parts[2]
$iFree = $parts[3]
$iPercent = $parts[4] -replace '%', ''
$mountPoint = $parts[5]
# 杩囨护 tmpfs/overlay 绛夎櫄鎷熸枃浠剁郴缁
if ($device -match 'tmpfs|overlay') { continue }
try { $iPercentNum = [int]$iPercent } catch { $iPercentNum = 0 }
$inodeStatus = if ($iPercentNum -lt 70) { "姝e父" } elseif ($iPercentNum -lt 90) { "璀﹀憡" } else { "寮傚父" }
$inodeColor = if ($iPercentNum -lt 70) { "SUCCESS" } elseif ($iPercentNum -lt 90) { "WARN" } else { "ERROR" }
Write-Log -Level $inodeColor -Message " inode $mountPoint : ${iUsed}/${iTotal} (${iPercent}%) [$inodeStatus]"
$inodeList += @{
Device = $device
Total = $iTotal
Used = $iUsed
Percent = $iPercentNum
MountPoint = $mountPoint
Status = $inodeStatus
}
}
}
}
$results.Inode = $inodeList
#endregion 8. inode 浣跨敤鐜囨娴
#region 9. 鍙鎸傝浇妫娴 (PRD 2.5)
Write-Log -Level "INFO" -Message "妫娴嬪彧璇绘寕杞..."
$roCmd = "mount | grep ' ro[, ]' | grep -vE 'proc|sys|dev|cgroup|tmpfs' || echo 'NO_RO'"
$roResult = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $roCmd
$roList = @()
if ($roResult.ExitCode -eq 0 -and $roResult.Output) {
$roOutput = $roResult.Output -join ""
if ($roOutput -match 'NO_RO') {
Write-Log -Level "SUCCESS" -Message " 鏃犳剰澶栧彧璇绘寕杞"
} else {
$roLines = $roResult.Output -split "`n" | Where-Object { $_ -match '\S' }
foreach ($line in $roLines) {
Write-Log -Level "WARN" -Message " 鍙戠幇鍙鎸傝浇: $line"
$roList += $line
}
}
}
$results.ReadOnlyMounts = $roList
#endregion 9. 鍙鎸傝浇妫娴
#region 10. TCP 鐘舵佸垎甯冩娴 (PRD 2.5)
Write-Log -Level "INFO" -Message "妫娴 TCP 鐘舵佸垎甯..."
$tcpCmd = "netstat -ant 2>/dev/null | awk '{print `$6}' | sort | uniq -c | sort -rn"
$tcpResult = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $tcpCmd
$tcpStatus = @{}
if ($tcpResult.ExitCode -eq 0 -and $tcpResult.Output) {
$tcpLines = $tcpResult.Output -split "`n" | Where-Object { $_ -match '\S' }
foreach ($line in $tcpLines) {
if ($line -match '^\s*(\d+)\s+(\S+)') {
$count = [int]$matches[1]
$state = $matches[2]
$tcpStatus[$state] = $count
}
}
# 妫鏌ュ紓甯哥姸鎬
$closeWait = if ($tcpStatus['CLOSE_WAIT']) { $tcpStatus['CLOSE_WAIT'] } else { 0 }
$timeWait = if ($tcpStatus['TIME_WAIT']) { $tcpStatus['TIME_WAIT'] } else { 0 }
$tcpWarning = ""
if ($closeWait -gt 100) { $tcpWarning += "CLOSE_WAIT=$closeWait (>100) " }
if ($timeWait -gt 1000) { $tcpWarning += "TIME_WAIT=$timeWait (>1000) " }
if ($tcpWarning) {
Write-Log -Level "WARN" -Message " TCP鐘舵佸紓甯: $tcpWarning"
} else {
Write-Log -Level "SUCCESS" -Message " TCP鐘舵佹甯: CLOSE_WAIT=$closeWait TIME_WAIT=$timeWait"
}
}
$results.TCPStatus = $tcpStatus
#endregion 10. TCP 鐘舵佸垎甯冩娴
#region 11. 鍍靛案杩涚▼鍜 TOP5 妫娴 (PRD 2.5)
Write-Log -Level "INFO" -Message "妫娴嬪兊灏歌繘绋..."
$zombieCmd = "ps aux | awk '`$8~/Z/' | grep -v grep || echo 'NO_ZOMBIE'"
$zombieResult = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $zombieCmd
$zombieCount = 0
$zombieList = @()
if ($zombieResult.ExitCode -eq 0 -and $zombieResult.Output) {
$zOutput = $zombieResult.Output -join ""
if ($zOutput -match 'NO_ZOMBIE') {
Write-Log -Level "SUCCESS" -Message " 鏃犲兊灏歌繘绋"
} else {
$zLines = $zombieResult.Output -split "`n" | Where-Object { $_ -match '\S' }
$zombieCount = $zLines.Count
Write-Log -Level "WARN" -Message " 鍙戠幇 $zombieCount 涓兊灏歌繘绋"
$zombieList = $zLines
}
}
$results.ZombieProcesses = @{ Count = $zombieCount; List = $zombieList }
# TOP5 杩涚▼锛堟寜鍐呭瓨鍜孋PU锛
Write-Log -Level "INFO" -Message "鑾峰彇 TOP5 杩涚▼..."
$topCmd = "ps aux --sort=-%mem | head -n 6 | awk '{print `$1,`$2,`$3,`$4,`$11}'"
$topResult = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $topCmd
$topProcesses = @()
if ($topResult.ExitCode -eq 0 -and $topResult.Output) {
$topLines = $topResult.Output -split "`n" | Where-Object { $_ -match '\S' }
foreach ($line in $topLines) {
$topProcesses += $line.Trim()
}
Write-Log -Level "INFO" -Message " TOP5杩涚▼锛堟寜鍐呭瓨锛:"
foreach ($p in $topProcesses | Select-Object -Skip 1) {
Write-Log -Level "INFO" -Message " $p"
}
}
$results.TopProcesses = $topProcesses
#endregion 11. 鍍靛案杩涚▼鍜 TOP5 妫娴
return $results
}
......
......@@ -111,12 +111,12 @@
| 步骤 | 描述 | PS 版本 | Shell 版本 | 状态 |
|------|------|---------|------------|------|
| 1 | 新建 SecurityCheck.psm1 模块 | 新建文件 | — | [ ] |
| 2 | 实现弱密码检测函数(5个检测项) | SecurityCheck.psm1 | check_server_health.sh 新增 5 个函数 | [ ] |
| 3 | 实现安全基线函数(4个检测项) | SecurityCheck.psm1 | check_server_health.sh 新增 4 个函数 | [ ] |
| 4 | PS 版 Main 函数增加安全检测调用 | check_server_health.ps1 | — | [ ] |
| 5 | Shell 版主流程增加安全检测调用 | — | check_server_health.sh | [ ] |
| 6 | 安全检测结果集成到报告 | Report.psm1 增强 | check_server_health.sh 报告章节增强 | [ ] |
| 1 | 新建 SecurityCheck.psm1 模块 | 新建文件 | — | [x] |
| 2 | 实现弱密码检测函数(5个检测项) | SecurityCheck.psm1 | check_server_health.sh 新增 5 个函数 | [x] |
| 3 | 实现安全基线函数(4个检测项) | SecurityCheck.psm1 | check_server_health.sh 新增 4 个函数 | [x] |
| 4 | PS 版 Main 函数增加安全检测调用 | check_server_health.ps1 | — | [x] |
| 5 | Shell 版主流程增加安全检测调用 | — | check_server_health.sh | [x] |
| 6 | 安全检测结果集成到报告 | Report.psm1 增强 | check_server_health.sh 报告章节增强 | [x] |
---
......@@ -154,14 +154,14 @@
| 步骤 | 描述 | PS 版本 | Shell 版本 | 状态 |
|------|------|---------|------------|------|
| 1 | 新增 `Test-MySQLDeepCheck` 函数 | MiddlewareCheck.psm1 | check_server_health.sh 新增 `test_mysql_deep()` | [ ] |
| 2 | 实现缓冲池命中率检测 | 同上 | 同上 | [ ] |
| 3 | 实现慢查询检测 | 同上 | 同上 | [ ] |
| 4 | 实现连接使用率检测 | 同上 | 同上 | [ ] |
| 5 | 实现主从复制状态检测 | 同上 | 同上 | [ ] |
| 6 | 实现 TOP20 大表检测 | 同上 | 同上 | [ ] |
| 7 | Main/主流程中增加深度检测调用 | check_server_health.ps1 | check_server_health.sh | [ ] |
| 8 | 深度检测结果集成到报告 | Report.psm1 | check_server_health.sh 报告章节 | [ ] |
| 1 | 新增 `Test-MySQLDeepCheck` 函数 | MiddlewareCheck.psm1 | check_server_health.sh 新增 `test_mysql_deep()` | [x] |
| 2 | 实现缓冲池命中率检测 | 同上 | 同上 | [x] |
| 3 | 实现慢查询检测 | 同上 | 同上 | [x] |
| 4 | 实现连接使用率检测 | 同上 | 同上 | [x] |
| 5 | 实现主从复制状态检测 | 同上 | 同上 | [x] |
| 6 | 实现 TOP20 大表检测 | 同上 | 同上 | [x] |
| 7 | Main/主流程中增加深度检测调用 | check_server_health.ps1 | check_server_health.sh | [x] |
| 8 | 深度检测结果集成到报告 | Report.psm1 | check_server_health.sh 报告章节 | [x] |
---
......@@ -199,12 +199,12 @@
| 步骤 | 描述 | PS 版本 | Shell 版本 | 状态 |
|------|------|---------|------------|------|
| 1 | 新增 `Test-RedisDeepCheck` 函数 | MiddlewareCheck.psm1 | check_server_health.sh 新增 `test_redis_deep()` | [ ] |
| 2 | 实现持久化状态检测 | 同上 | 同上 | [ ] |
| 3 | 实现内存碎片率检测 | 同上 | 同上 | [ ] |
| 4 | 实现缓存命中率检测 | 同上 | 同上 | [ ] |
| 5 | 实现主从复制检测 | 同上 | 同上 | [ ] |
| 6 | Main/主流程中增加深度检测调用 | check_server_health.ps1 | check_server_health.sh | [ ] |
| 1 | 新增 `Test-RedisDeepCheck` 函数 | MiddlewareCheck.psm1 | check_server_health.sh 新增 `test_redis_deep()` | [x] |
| 2 | 实现持久化状态检测 | 同上 | 同上 | [x] |
| 3 | 实现内存碎片率检测 | 同上 | 同上 | [x] |
| 4 | 实现缓存命中率检测 | 同上 | 同上 | [x] |
| 5 | 实现主从复制检测 | 同上 | 同上 | [x] |
| 6 | Main/主流程中增加深度检测调用 | check_server_health.ps1 | check_server_health.sh | [x] |
---
......@@ -260,12 +260,12 @@
| 步骤 | 描述 | PS 版本 | Shell 版本 | 状态 |
|------|------|---------|------------|------|
| 1 | 实现 inode 使用率检测 | ServerResourceAnalysis.psm1 | check_server_health.sh | [ ] |
| 2 | 实现只读挂载检测 | 同上 | 同上 | [ ] |
| 3 | 实现关键端口连通性检测 | 同上 | 同上 | [ ] |
| 4 | 实现 TCP 状态分布检测 | 同上 | 同上 | [ ] |
| 5 | 实现僵尸进程和 TOP5 检测 | 同上 | 同上 | [ ] |
| 6 | 新增检测项集成到报告 | Report.psm1 | check_server_health.sh 报告章节 | [ ] |
| 1 | 实现 inode 使用率检测 | ServerResourceAnalysis.psm1 | check_server_health.sh | [x] |
| 2 | 实现只读挂载检测 | 同上 | 同上 | [x] |
| 3 | 实现关键端口连通性检测 | 同上 | 同上 | [x] |
| 4 | 实现 TCP 状态分布检测 | 同上 | 同上 | [x] |
| 5 | 实现僵尸进程和 TOP5 检测 | 同上 | 同上 | [x] |
| 6 | 新增检测项集成到报告 | Report.psm1 | check_server_health.sh 报告章节 | [x] |
---
......@@ -298,9 +298,9 @@
| 步骤 | 描述 | PS 版本 | Shell 版本 | 状态 |
|------|------|---------|------------|------|
| 1 | 实现新平台目录备份逻辑 | DataBackup.psm1 | check_server_health.sh | [ ] |
| 2 | 实现新平台 MySQL 导出 | 同上 | 同上 | [ ] |
| 3 | 测试备份下载流程 | 同上 | 同上 | [ ] |
| 1 | 实现新平台目录备份逻辑 | DataBackup.psm1 | check_server_health.sh | [x] |
| 2 | 实现新平台 MySQL 导出 | 同上 | 同上 | [x] |
| 3 | 测试备份下载流程 | 同上 | 同上 | [x] |
---
......
......@@ -7,7 +7,9 @@
## 功能需求
### 功能目标
**目标:** 对接获取人员列表接口以及调整上传文件接口的抄送人传参和创建人员传参。然后通过交互模式下输入的创建人姓名、抄送人姓名,最终通过接口传参实现。
**目标:** 对接获取人员列表接口以及调整上传文件接口的抄送人传参。然后通过交互模式下输入的抄送人姓名,最终通过接口传参实现。
> **注:** 原需求包含创建人员传参(createuser_name、createuser_id),但创建报告接口 `POST /openclaw/report` 不支持此参数,暂不实现,待接口支持后再补充。
### 需求描述
- 获取人员接口:
......@@ -15,10 +17,10 @@
- 上传文件接口调整:
- 根据[Docs/PRD/自动化生成功能测试报告/ERP对接PRD/PRD_测试列表_测试报告_例子说明.md]第182行。
- createuser_name通过交互模式,用户输入姓名。从获取人员列表中做提取ID。
- copyuserList通过交互模式,用户输入姓名,从获取人员列表中做提取ID,注意参数格式如下:
- ~~createuser_name通过交互模式,用户输入姓名。从获取人员列表中做提取ID。~~ **(暂不支持,创建报告接口无此参数)**
- copyuserList通过交互模式,用户输入姓名(多个姓名以逗号分隔),从获取人员列表中做提取ID,注意参数格式如下:
- "copyuserList": [1, 24, 31]
- 最终在上传文件接口中,将createuser_name、createuser_id、copyuserList作为参数传入。
- 最终在上传文件接口中,将copyuserList作为参数传入。
## 规范文档
- 代码规范: `Docs/PRD/01规范文档/_PRD_规范文档_代码规范.md`
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论