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

feat(服务自检): 传统平台统一平台分类路径细分对齐 ps1/sh/auto

- 中间件 redis 日志路径按 meeting/unified 细分:
  传统统一平台(/var/www/java/redis) vs 会议预定(/var/www/redis), ps1/sh/auto 三端一致
- test_middleware_connections 改为基于平台类型(old/new)+sys.ujava.variant 映射路径,
  修复传统统一平台误用新平台 /data/middleware 路径的旧逻辑
- 宿主机 extapi 服务检测增加路径过滤: unified -> /var/www/java/unifiedPlatform/external-meeting-api
- 报告/日志系统类型识别输出传统平台细分(统一平台系统/会议预定系统)
- LogExport/FilePermission/ConfigIPCheck/DataBackup/ShellAdapter/config_check.sh
  增加 unified 细分路径(前端/后端/中间件/备份/权限/配置检查)
- 禁用遗漏的 extapi 自动修复调用(sh/auto), 改为 WARN + extapi.auto_repair=disabled
- 修复 sh 端 check_emqx_container_exception 分支结构错乱(bash -n 语法错误)
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
上级 d8a2ef45
...@@ -438,15 +438,15 @@ function Main { ...@@ -438,15 +438,15 @@ function Main {
# 检测系统类型 # 检测系统类型
$systemInfo = Get-SystemType -Server $server $systemInfo = Get-SystemType -Server $server
Write-Host "" Write-Host ""
# ✅ ujava 系统细分 # ✅ 传统平台系统细分(meeting / unified):只要是传统平台就细分,不依赖 ujava 容器是否存在
if ($systemInfo.HasUjava) { if ($platformType -eq "old") {
$ujavaVariant = Get-UjavaSystemVariant -Server $server $ujavaVariant = Get-UjavaSystemVariant -Server $server
$systemInfo.UjavaSystemVariant = $ujavaVariant $systemInfo.UjavaSystemVariant = $ujavaVariant
if ($ujavaVariant -eq "unified") { if ($ujavaVariant -eq "unified") {
Write-Log -Level "INFO" -Message " [系统细分] ujava -> 统一平台系统 (检测到 /var/www/java/unifiedPlatform)" Write-Log -Level "INFO" -Message " [系统细分] 传统平台 -> 统一平台系统 (检测到 /var/www/java/unifiedPlatform)"
} else { } else {
Write-Log -Level "INFO" -Message " [系统细分] ujava -> 会议预定系统 (未检测到 /var/www/java/unifiedPlatform)" Write-Log -Level "INFO" -Message " [系统细分] 传统平台 -> 会议预定系统 (未检测到 /var/www/java/unifiedPlatform)"
} }
} else { } else {
$systemInfo.UjavaSystemVariant = "N/A" $systemInfo.UjavaSystemVariant = "N/A"
...@@ -528,8 +528,8 @@ function Main { ...@@ -528,8 +528,8 @@ function Main {
Write-Log -Level "WARN" -Message "未检测到 ujava 容器,跳过容器内服务检测" Write-Log -Level "WARN" -Message "未检测到 ujava 容器,跳过容器内服务检测"
} }
# ujava 宿主机服务检测(传统平台extapi在/var/www/java/external-meeting-api # ujava 宿主机服务检测(extapi 路径按 meeting/unified 分支
$ujavaHostResults = Test-UjavaOldPlatformHostServices -Server $server $ujavaHostResults = Test-UjavaOldPlatformHostServices -Server $server -SystemInfo $systemInfo
# 如果检测到对外服务进程 ubains-meeting-api-1.0-SNAPSHOT.jar 未运行,则触发远程修复 # 如果检测到对外服务进程 ubains-meeting-api-1.0-SNAPSHOT.jar 未运行,则触发远程修复
$global:ExternalServiceRepairResult = $null # 供报告使用 $global:ExternalServiceRepairResult = $null # 供报告使用
...@@ -659,9 +659,15 @@ function Main { ...@@ -659,9 +659,15 @@ function Main {
$middlewareStorageLogPath = "/data/storage/storage/logs" $middlewareStorageLogPath = "/data/storage/storage/logs"
$middlewareTrackerLogPath = "/data/storage/tracker/logs" $middlewareTrackerLogPath = "/data/storage/tracker/logs"
} else { } else {
# 传统平台类型 # 传统平台类型:meeting 与 unified 的 redis 路径不同
$middlewareEmqxLogPath = "/var/www/emqx/log" $middlewareEmqxLogPath = "/var/www/emqx/log"
$middlewareRedisLogPath = "/var/www/redis/data/redis.log" $ujavaVariant = $null
if ($systemInfo -and $systemInfo.ContainsKey('UjavaSystemVariant')) { $ujavaVariant = $systemInfo.UjavaSystemVariant }
if ($ujavaVariant -eq 'unified') {
$middlewareRedisLogPath = "/var/www/java/redis/data/redis.log"
} else {
$middlewareRedisLogPath = "/var/www/redis/data/redis.log"
}
$middlewareMysqlLogPath = "/usr/local/docker/mysql/log" $middlewareMysqlLogPath = "/usr/local/docker/mysql/log"
$middlewareStorageLogPath = "/var/fdfs/storage/logs" $middlewareStorageLogPath = "/var/fdfs/storage/logs"
$middlewareTrackerLogPath = "/var/fdfs/tracker/logs" $middlewareTrackerLogPath = "/var/fdfs/tracker/logs"
...@@ -782,7 +788,7 @@ function Main { ...@@ -782,7 +788,7 @@ function Main {
$logExportResults = $null $logExportResults = $null
if ($exportChoice -eq "y" -or $exportChoice -eq "Y") { if ($exportChoice -eq "y" -or $exportChoice -eq "Y") {
$logExportResults = Export-ConfigAndLogs -Server $server -PlatformType $platformType $logExportResults = Export-ConfigAndLogs -Server $server -PlatformType $platformType -SystemInfo $systemInfo
} }
else { else {
Write-Log -Level "INFO" -Message "跳过配置文件与日志导出" Write-Log -Level "INFO" -Message "跳过配置文件与日志导出"
......
...@@ -92,10 +92,14 @@ NEW_PLATFORM_CONFIGS=( ...@@ -92,10 +92,14 @@ NEW_PLATFORM_CONFIGS=(
) )
# 传统平台配置文件 # 传统平台配置文件
# 统一平台细分下 nginx 位于 /var/www/java/unifiedPlatform/nginx-conf.d,redis 位于 /var/www/java/redis;
# 两个路径都检查,不存在的路径自动跳过(ls 展开为空),不影响其他平台
OLD_PLATFORM_CONFIGS=( OLD_PLATFORM_CONFIGS=(
"/var/www/java/nginx-conf.d/*.conf" "/var/www/java/nginx-conf.d/*.conf"
"/var/www/java/unifiedPlatform/nginx-conf.d/*.conf"
"/var/www/emqx/config/*.conf" "/var/www/emqx/config/*.conf"
"/var/www/redis/redis-*.conf" "/var/www/redis/redis-*.conf"
"/var/www/java/redis/redis-*.conf"
) )
# IP地址匹配模式(简单匹配,不覆盖所有情况) # IP地址匹配模式(简单匹配,不覆盖所有情况)
......
...@@ -245,14 +245,19 @@ function Test-TraditionalPlatformIPs { ...@@ -245,14 +245,19 @@ function Test-TraditionalPlatformIPs {
} }
$Paths = @( $Paths = @(
"/var/www/java/api-java-meeting2.0/config", "$webRoot/api-java-meeting2.0/config",
"/var/www/java/external-meeting-api/config", "$webRoot/external-meeting-api/config",
"$webRoot/ubains-web-2.0/static/config.json", "$webRoot/ubains-web-2.0/static/config.json",
"$webRoot/ubains-web-admin/static/config.json", "$webRoot/ubains-web-admin/static/config.json",
"/var/www/java/ubains-web-h5/static/h5/config.js",
"/var/www/java/ubains-web-h5/static/h5/config.json",
"$webRoot/nginx-conf.d" "$webRoot/nginx-conf.d"
) )
# ubains-web-h5 仅会议预定系统存在;统一平台无此目录
if ($ujavaVariant -ne "unified") {
$Paths += @(
"/var/www/java/ubains-web-h5/static/h5/config.js",
"/var/www/java/ubains-web-h5/static/h5/config.json"
)
}
$AllowedIPs = @("172.17.0.1", "127.0.0.1", $ServerIP) $AllowedIPs = @("172.17.0.1", "127.0.0.1", $ServerIP)
...@@ -488,14 +493,19 @@ function Test-TraditionalPlatformConsole { ...@@ -488,14 +493,19 @@ function Test-TraditionalPlatformConsole {
} }
$Paths = @( $Paths = @(
"/var/www/java/api-java-meeting2.0/config", "$webRoot/api-java-meeting2.0/config",
"/var/www/java/external-meeting-api/config", "$webRoot/external-meeting-api/config",
"$webRoot/ubains-web-2.0/static/config.json", "$webRoot/ubains-web-2.0/static/config.json",
"$webRoot/ubains-web-admin/static/config.json", "$webRoot/ubains-web-admin/static/config.json",
"/var/www/java/ubains-web-h5/static/h5/config.js",
"/var/www/java/ubains-web-h5/static/h5/config.json",
"$webRoot/nginx-conf.d" "$webRoot/nginx-conf.d"
) )
# ubains-web-h5 仅会议预定系统存在;统一平台无此目录
if ($ujavaVariant -ne "unified") {
$Paths += @(
"/var/www/java/ubains-web-h5/static/h5/config.js",
"/var/www/java/ubains-web-h5/static/h5/config.json"
)
}
$totalFiles = 0 $totalFiles = 0
$modifiedFiles = @() $modifiedFiles = @()
......
...@@ -242,13 +242,13 @@ function DataBakup { ...@@ -242,13 +242,13 @@ function DataBakup {
# 仅实现传统平台备份 # 仅实现传统平台备份
if ($PlatformType -eq 'old') { if ($PlatformType -eq 'old') {
# ✅ ujava:按 meeting/unified 分支备份 # ✅ 传统平台均需备份(不依赖 ujava 容器是否存在);路径按 meeting/unified 分支
if ($hasUjava) { if ($ujavaVariant -eq 'unified') {
if ($ujavaVariant -eq 'unified') { $cmds += "[ -d /var/www/java/unifiedPlatform ] && cp -a /var/www/java/unifiedPlatform $bakDir/"
$cmds += "[ -d /var/www/java/unifiedPlatform ] && cp -a /var/www/java/unifiedPlatform $bakDir/" $cmds += "[ -d /var/www/java/redis ] && cp -a /var/www/java/redis $bakDir/"
} else { } else {
$cmds += "[ -d /var/www/java ] && cp -a /var/www/java $bakDir/" $cmds += "[ -d /var/www/java ] && cp -a /var/www/java $bakDir/"
} $cmds += "[ -d /var/www/redis ] && cp -a /var/www/redis $bakDir/"
} }
if ($hasUpython) { if ($hasUpython) {
...@@ -256,7 +256,6 @@ function DataBakup { ...@@ -256,7 +256,6 @@ function DataBakup {
} }
$cmds += "[ -d /var/www/emqx ] && cp -a /var/www/emqx $bakDir/" $cmds += "[ -d /var/www/emqx ] && cp -a /var/www/emqx $bakDir/"
$cmds += "[ -d /var/www/redis ] && cp -a /var/www/redis $bakDir/"
} else { } else {
Write-Log -Level "INFO" -Message "[BAK] 新统一平台备份:开始执行..." Write-Log -Level "INFO" -Message "[BAK] 新统一平台备份:开始执行..."
......
...@@ -168,22 +168,29 @@ function Check-FilePermissions { ...@@ -168,22 +168,29 @@ function Check-FilePermissions {
$ujavaVariant = $null $ujavaVariant = $null
if ($SystemInfo -and $SystemInfo.ContainsKey('UjavaSystemVariant')) { $ujavaVariant = $SystemInfo.UjavaSystemVariant } if ($SystemInfo -and $SystemInfo.ContainsKey('UjavaSystemVariant')) { $ujavaVariant = $SystemInfo.UjavaSystemVariant }
$webRoot = "/var/www/java"
$redisRoot = "/var/www/redis"
if ($ujavaVariant -eq 'unified') {
$webRoot = "/var/www/java/unifiedPlatform"
$redisRoot = "/var/www/java/redis"
}
$targets += @( $targets += @(
"/var/www/java/api-java-meeting2.0/run.sh", "$webRoot/api-java-meeting2.0/run.sh",
"/var/www/java/external-meeting-api/run.sh", "$webRoot/external-meeting-api/run.sh",
"/var/www/html/start.sh", "/var/www/html/start.sh",
"/var/www/wifi-local/config.ini", "/var/www/wifi-local/config.ini",
"/var/www/wifi-local/startDB.sh", "/var/www/wifi-local/startDB.sh",
"/var/www/wifi-local/wifi*", "/var/www/wifi-local/wifi*",
"/var/www/paperless/run.sh", "/var/www/paperless/run.sh",
"/var/www/paperless/start.sh", "/var/www/paperless/start.sh",
"/var/www/redis/redis-*.conf", "$redisRoot/redis-*.conf",
"/var/www/emqx/config/*.conf", "/var/www/emqx/config/*.conf",
"/etc/rc.d/rc.local", "/etc/rc.d/rc.local",
"/usr/local/docker/mysql/my.cnf" "/usr/local/docker/mysql/my.cnf"
) )
# start.sh 路径分支:unified 优先检查 unifiedPlatform/start.sh # start.sh / nginx-conf.d 路径分支
if ($ujavaVariant -eq 'unified') { if ($ujavaVariant -eq 'unified') {
$targets += "/var/www/java/unifiedPlatform/start.sh" $targets += "/var/www/java/unifiedPlatform/start.sh"
$targets += "/var/www/java/unifiedPlatform/nginx-conf.d/*.conf" $targets += "/var/www/java/unifiedPlatform/nginx-conf.d/*.conf"
......
...@@ -82,12 +82,43 @@ $script:OldPlatformFrontend = @( ...@@ -82,12 +82,43 @@ $script:OldPlatformFrontend = @(
@{ Name = "web-vue-h5"; BaseDir = "/var/www/html/web-vue-h5"; Files = @("static/config.json") } @{ Name = "web-vue-h5"; BaseDir = "/var/www/html/web-vue-h5"; Files = @("static/config.json") }
) )
# 传统平台 unified 细分:前端服务(位于 /var/www/java/unifiedPlatform/)
$script:OldPlatformFrontendUnified = @(
@{ Name = "ubains-web-2.0"; BaseDir = "/var/www/java/unifiedPlatform/ubains-web-2.0"; Files = @("static/config.json") }
@{ Name = "ubains-web-admin"; BaseDir = "/var/www/java/unifiedPlatform/ubains-web-admin"; Files = @("static/config.json") }
@{ Name = "ubains-web-3.0"; BaseDir = "/var/www/java/unifiedPlatform/ubains-web-3.0"; Files = @("static/config.json") }
@{ Name = "ubains-unified-platform"; BaseDir = "/var/www/java/unifiedPlatform/ubains-unified-platform"; Files = @("static/config.json") }
@{ Name = "ubains-unified-platform-admin"; BaseDir = "/var/www/java/unifiedPlatform/ubains-unified-platform-admin"; Files = @("static/config.json") }
@{ Name = "ubains-video-web-3.0"; BaseDir = "/var/www/java/unifiedPlatform/ubains-video-web-3.0"; Files = @("static/config.json") }
@{ Name = "mobile-ubains-meeting-mobile"; BaseDir = "/var/www/java/unifiedPlatform/mobile/ubains-meeting-mobile"; Files = @("static/config.json") }
@{ Name = "mobile-ubains-unified-platform-mobile"; BaseDir = "/var/www/java/unifiedPlatform/mobile/ubains-unified-platform-mobile"; Files = @("static/config.json") }
@{ Name = "web-vue-rms"; BaseDir = "/var/www/html/web-vue-rms"; Files = @("static/config.json") }
@{ Name = "web-vue-h5"; BaseDir = "/var/www/html/web-vue-h5"; Files = @("static/config.json") }
)
$script:OldPlatformBackend = @( $script:OldPlatformBackend = @(
@{ Name = "api-java-meeting2.0"; BaseDir = "/var/www/java/api-java-meeting2.0"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) } @{ Name = "api-java-meeting2.0"; BaseDir = "/var/www/java/api-java-meeting2.0"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "external-meeting-api"; BaseDir = "/var/www/java/external-meeting-api"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) } @{ Name = "external-meeting-api"; BaseDir = "/var/www/java/external-meeting-api"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "html-ops"; BaseDir = "/var/www/html"; Files = @("setting.conf"; "log/uinfo.log"; "log/error.log"; "log/uwsgi.log") } @{ Name = "html-ops"; BaseDir = "/var/www/html"; Files = @("setting.conf"; "log/uinfo.log"; "log/error.log"; "log/uwsgi.log") }
) )
# 传统平台 unified 细分:后端服务(位于 /var/www/java/unifiedPlatform/)
$script:OldPlatformBackendUnified = @(
@{ Name = "api-java-meeting2.0"; BaseDir = "/var/www/java/unifiedPlatform/api-java-meeting2.0"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-cloudLink"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-cloudLink"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-dingding"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-dingding"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-meeting-control"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-meeting-control"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-smc-three"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-smc-three"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-smc-two"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-smc-two"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-tencent-meeting"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-tencent-meeting"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "api-dubbo-xylink"; BaseDir = "/var/www/java/unifiedPlatform/api-dubbo-xylink"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "auth-sso-auth"; BaseDir = "/var/www/java/unifiedPlatform/auth-sso-auth"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "auth-sso-gatway"; BaseDir = "/var/www/java/unifiedPlatform/auth-sso-gatway"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "auth-sso-system"; BaseDir = "/var/www/java/unifiedPlatform/auth-sso-system"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "external-meeting-api"; BaseDir = "/var/www/java/unifiedPlatform/external-meeting-api"; Files = @("logs/ubains-INFO-AND-ERROR.log"; "logs/ubains-ERROR.log"; @{ Path="logs/timeFile"; Type="mtime"; Days=3 }; @{ Path="config"; Type="ext-filter"; Extensions=@("*.yml","*.properties","*.json","*.js","*.xml") }) }
@{ Name = "html-ops"; BaseDir = "/var/www/html"; Files = @("setting.conf"; "log/uinfo.log"; "log/error.log"; "log/uwsgi.log") }
)
$script:OldPlatformMiddleware = @( $script:OldPlatformMiddleware = @(
@{ Name = "nginx"; BaseDir = "/var/www/java/nginx-conf.d"; Files = @("meeting443.conf"; "nginx_log") } @{ Name = "nginx"; BaseDir = "/var/www/java/nginx-conf.d"; Files = @("meeting443.conf"; "nginx_log") }
@{ Name = "redis"; BaseDir = "/var/www/redis"; Files = @("*.conf"; "data") } @{ Name = "redis"; BaseDir = "/var/www/redis"; Files = @("*.conf"; "data") }
...@@ -96,6 +127,15 @@ $script:OldPlatformMiddleware = @( ...@@ -96,6 +127,15 @@ $script:OldPlatformMiddleware = @(
@{ Name = "fdfs"; BaseDir = "/var/fdfs"; Files = @("storage/logs"; "tracker/logs") } @{ Name = "fdfs"; BaseDir = "/var/fdfs"; Files = @("storage/logs"; "tracker/logs") }
) )
# 传统平台 unified 细分:中间件(nginx 在 unifiedPlatform 下,redis 在 /var/www/java/redis)
$script:OldPlatformMiddlewareUnified = @(
@{ Name = "nginx"; BaseDir = "/var/www/java/unifiedPlatform/nginx-conf.d"; Files = @("meeting443.conf"; "nginx_log") }
@{ Name = "redis"; BaseDir = "/var/www/java/redis"; Files = @("*.conf"; "data") }
@{ Name = "emqx"; BaseDir = "/var/www/emqx"; Files = @("config"; "log") }
@{ Name = "mysql"; BaseDir = "/usr/local/docker/mysql"; Files = @("logs") }
@{ Name = "fdfs"; BaseDir = "/var/fdfs"; Files = @("storage/logs"; "tracker/logs") }
)
$script:OldPlatformThirdParty = @( $script:OldPlatformThirdParty = @(
@{ Name = "paperless"; BaseDir = "/var/www/paperless"; Files = @("application.yml"; "nohup.out") } @{ Name = "paperless"; BaseDir = "/var/www/paperless"; Files = @("application.yml"; "nohup.out") }
@{ Name = "wifi-local"; BaseDir = "/var/www/wifi-local"; Files = @("config.ini"; "nohup.out") } @{ Name = "wifi-local"; BaseDir = "/var/www/wifi-local"; Files = @("config.ini"; "nohup.out") }
...@@ -108,7 +148,8 @@ $script:OldPlatformThirdParty = @( ...@@ -108,7 +148,8 @@ $script:OldPlatformThirdParty = @(
function Export-ConfigAndLogs { function Export-ConfigAndLogs {
param( param(
[hashtable]$Server, [hashtable]$Server,
[string]$PlatformType [string]$PlatformType,
[hashtable]$SystemInfo
) )
Write-Host "" Write-Host ""
...@@ -127,14 +168,25 @@ function Export-ConfigAndLogs { ...@@ -127,14 +168,25 @@ function Export-ConfigAndLogs {
} }
} }
# Select service list by platform type # Select service list by platform type(传统平台按 meeting/unified 细分路径)
if ($PlatformType -eq "new") { if ($PlatformType -eq "new") {
Write-Log -Level "INFO" -Message "Platform: New" Write-Log -Level "INFO" -Message "Platform: New"
$allServices = $script:NewPlatformFrontend + $script:NewPlatformBackend + $script:NewPlatformMiddleware + $script:NewPlatformThirdParty $allServices = $script:NewPlatformFrontend + $script:NewPlatformBackend + $script:NewPlatformMiddleware + $script:NewPlatformThirdParty
} }
else { else {
Write-Log -Level "INFO" -Message "Platform: Old" $ujavaVariant = "meeting"
$allServices = $script:OldPlatformFrontend + $script:OldPlatformBackend + $script:OldPlatformMiddleware + $script:OldPlatformThirdParty if ($SystemInfo -and $SystemInfo.ContainsKey('UjavaSystemVariant') -and $SystemInfo.UjavaSystemVariant) {
$ujavaVariant = [string]$SystemInfo.UjavaSystemVariant
}
if ($ujavaVariant -eq "unified") {
Write-Log -Level "INFO" -Message "Platform: Old (unified 统一平台系统)"
$allServices = $script:OldPlatformFrontendUnified + $script:OldPlatformBackendUnified + $script:OldPlatformMiddlewareUnified + $script:OldPlatformThirdParty
}
else {
Write-Log -Level "INFO" -Message "Platform: Old (meeting 会议预定系统)"
$allServices = $script:OldPlatformFrontend + $script:OldPlatformBackend + $script:OldPlatformMiddleware + $script:OldPlatformThirdParty
}
} }
$remoteTmpBase = "/tmp/config_and_log" $remoteTmpBase = "/tmp/config_and_log"
......
...@@ -49,7 +49,16 @@ function Show-HealthReport { ...@@ -49,7 +49,16 @@ function Show-HealthReport {
$md += "" $md += ""
$md += "- 服务器地址: $($Server.IP)" $md += "- 服务器地址: $($Server.IP)"
$md += "- 服务器描述: $($Server.Desc)" $md += "- 服务器描述: $($Server.Desc)"
$md += "- 平台类型: $(if ($PlatformType -eq 'new') { '新统一平台' } else { '传统平台' })" # ✅ 系统细分:传统平台显示会议预定/统一平台子类型
$ujavaVariantLabel = $null
if ($PlatformType -eq 'old' -and $SystemInfo -and $SystemInfo.ContainsKey('UjavaSystemVariant')) {
$v = $SystemInfo.UjavaSystemVariant
if ($v -eq 'unified') { $ujavaVariantLabel = '统一平台系统' }
elseif ($v -eq 'meeting') { $ujavaVariantLabel = '会议预定系统' }
}
$platformLabel = if ($PlatformType -eq 'new') { '新统一平台' } else { '传统平台' }
if ($ujavaVariantLabel) { $platformLabel = "$platformLabel - $ujavaVariantLabel" }
$md += "- 平台类型: $platformLabel"
$md += "- 检测时间: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" $md += "- 检测时间: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
$md += "" $md += ""
...@@ -61,14 +70,29 @@ function Show-HealthReport { ...@@ -61,14 +70,29 @@ function Show-HealthReport {
# ✅ 系统类型识别:按 ujavaVariant 输出 # ✅ 系统类型识别:按 ujavaVariant 输出
$md += "## 系统类型识别" $md += "## 系统类型识别"
$hasKnownVariant = $false
if ($PlatformType -eq 'old' -and $SystemInfo -and $SystemInfo.ContainsKey('UjavaSystemVariant')) {
$v = $SystemInfo.UjavaSystemVariant
if ($v -eq 'unified' -or $v -eq 'meeting') {
$hasKnownVariant = $true
$label = if ($v -eq 'unified') { '统一平台系统' } else { '会议预定系统' }
$container = if ($SystemInfo.UjavaContainer) { " [$($SystemInfo.UjavaContainer)]" } else { '' }
$md += "- 传统平台细分: $label$container"
}
}
if ($SystemInfo.HasUjava) { if ($SystemInfo.HasUjava) {
$v = if ($SystemInfo.ContainsKey('UjavaSystemVariant')) { $SystemInfo.UjavaSystemVariant } else { $null } $v = if ($SystemInfo.ContainsKey('UjavaSystemVariant')) { $SystemInfo.UjavaSystemVariant } else { $null }
$label = if ($v -eq 'unified') { '统一平台系统' } else { '会议预定系统' } if ($v -ne 'unified' -and $v -ne 'meeting') {
$md += "- $label (ujava): 已部署 [$($SystemInfo.UjavaContainer)]" $label = if ($v -eq 'unified') { '统一平台系统' } else { '会议预定系统' }
$md += "- $label (ujava): 已部署 [$($SystemInfo.UjavaContainer)]"
}
} }
if ($SystemInfo.HasUpython) { $md += "- 运维集控系统 (upython): 已部署 [$($SystemInfo.UpythonContainer)]" } if ($SystemInfo.HasUpython) { $md += "- 运维集控系统 (upython): 已部署 [$($SystemInfo.UpythonContainer)]" }
if ($SystemInfo.HasUpythonVoice) { $md += "- 转录系统 (upython_voice): 已部署 [$($SystemInfo.UpythonVoiceContainer)]" } if ($SystemInfo.HasUpythonVoice) { $md += "- 转录系统 (upython_voice): 已部署 [$($SystemInfo.UpythonVoiceContainer)]" }
if (-not $SystemInfo.HasUjava -and -not $SystemInfo.HasUpython -and -not $SystemInfo.HasUpythonVoice) { $md += "- 未检测到已知系统容器" } if ($hasKnownVariant -and -not $SystemInfo.HasUjava -and -not $SystemInfo.HasUpython -and -not $SystemInfo.HasUpythonVoice) {
# 传统平台细分已展示,不再重复"未检测到已知系统容器"
}
if (-not $hasKnownVariant -and -not $SystemInfo.HasUjava -and -not $SystemInfo.HasUpython -and -not $SystemInfo.HasUpythonVoice) { $md += "- 未检测到已知系统容器" }
$md += "" $md += ""
# 统计信息 # 统计信息
......
...@@ -376,17 +376,23 @@ function Test-UjavaOldPlatformHostServices { ...@@ -376,17 +376,23 @@ function Test-UjavaOldPlatformHostServices {
.DESCRIPTION .DESCRIPTION
检测传统平台运行在宿主机上的 ujava 相关服务。 检测传统平台运行在宿主机上的 ujava 相关服务。
传统平台 extapi 路径为 /var/www/java/external-meeting-api。 会议预定系统 extapi 路径为 /var/www/java/external-meeting-api;
统一平台细分路径为 /var/www/java/unifiedPlatform/external-meeting-api。
.PARAMETER Server .PARAMETER Server
服务器信息哈希表 服务器信息哈希表
.PARAMETER SystemInfo
系统信息哈希表(可选,用于 traditional-unified 路径分支)
.EXAMPLE .EXAMPLE
Test-UjavaOldPlatformHostServices -Server $server Test-UjavaOldPlatformHostServices -Server $server
#> #>
param( param(
[Parameter(Mandatory=$false)] [Parameter(Mandatory=$false)]
[hashtable]$Server [hashtable]$Server,
[Parameter(Mandatory=$false)]
[hashtable]$SystemInfo
) )
Write-Host "" Write-Host ""
...@@ -394,11 +400,17 @@ function Test-UjavaOldPlatformHostServices { ...@@ -394,11 +400,17 @@ function Test-UjavaOldPlatformHostServices {
$results = @() $results = @()
# traditional-unified 路径分支:统一平台服务位于 /var/www/java/unifiedPlatform
$svcRoot = "/var/www/java"
$ujavaVariant = $null
if ($SystemInfo -and $SystemInfo.ContainsKey('UjavaSystemVariant')) { $ujavaVariant = $SystemInfo.UjavaSystemVariant }
if ($ujavaVariant -eq 'unified') { $svcRoot = "/var/www/java/unifiedPlatform" }
foreach ($serviceName in $UjavaOldPlatformHostServices.Keys) { foreach ($serviceName in $UjavaOldPlatformHostServices.Keys) {
$jarFileName = $UjavaOldPlatformHostServices[$serviceName] $jarFileName = $UjavaOldPlatformHostServices[$serviceName]
# 检测宿主机进程(传统平台路径为 /var/www/java/external-meeting-api) # 检测宿主机进程(传统平台路径为 $svcRoot/external-meeting-api)
$checkCmd = "ps aux 2>/dev/null | grep -v grep | grep '$jarFileName' | grep '/var/www/java/external-meeting-api' | wc -l" $checkCmd = "ps aux 2>/dev/null | grep -v grep | grep '$jarFileName' | grep '$svcRoot/external-meeting-api' | wc -l"
$result = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $checkCmd $result = Invoke-SSHCommand -HostName $Server.IP -User $Server.User -Pass $Server.Pass -Port $Server.Port -Command $checkCmd
$count = 0 $count = 0
......
...@@ -1101,8 +1101,12 @@ function Test-ConfigIPs-Shell { ...@@ -1101,8 +1101,12 @@ function Test-ConfigIPs-Shell {
"/data/middleware/mysql/conf/my.cnf" "/data/middleware/mysql/conf/my.cnf"
) )
} else { } else {
# 传统平台: nginx 配置文件在会议预定系统下位于 /var/www/java/nginx-conf.d,
# 统一平台细分下位于 /var/www/java/unifiedPlatform/nginx-conf.d,两个路径都检查
# (路径不存在时 ls 返回空,自动跳过,不影响其他平台)
$configFiles = @( $configFiles = @(
"/var/www/java/nginx-conf.d/*.conf", "/var/www/java/nginx-conf.d/*.conf",
"/var/www/java/unifiedPlatform/nginx-conf.d/*.conf",
"/var/www/emqx/config/*.conf" "/var/www/emqx/config/*.conf"
) )
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论