35 lines
1.1 KiB
PowerShell
35 lines
1.1 KiB
PowerShell
# 读取主账启动失败原因(不打印密钥)
|
|
$ErrorActionPreference = 'Continue'
|
|
$Err = 'E:\wwwroot\inquiry-new\logs\stderr.log'
|
|
$Out = 'E:\wwwroot\inquiry-new\logs\stdout.log'
|
|
Write-Output '=== process ==='
|
|
Get-CimInstance Win32_Process -Filter "Name='java.exe'" | ForEach-Object {
|
|
if ($_.CommandLine -like '*inquiry-new*') {
|
|
"pid=$($_.ProcessId) alive"
|
|
}
|
|
}
|
|
Write-Output '=== port 8180 ==='
|
|
$c = Get-NetTCPConnection -LocalPort 8180 -State Listen -EA SilentlyContinue | Select-Object -First 1
|
|
if ($c) { "LISTEN pid=$($c.OwningProcess)" } else { 'down' }
|
|
|
|
Write-Output '=== stderr tail ==='
|
|
if (Test-Path $Err) { Get-Content $Err -Tail 80 } else { 'no stderr' }
|
|
Write-Output '=== stdout tail ==='
|
|
if (Test-Path $Out) { Get-Content $Out -Tail 80 } else { 'no stdout' }
|
|
|
|
Write-Output '=== try health variants ==='
|
|
foreach ($u in @(
|
|
'http://127.0.0.1:8180/jeecgboot/',
|
|
'http://127.0.0.1:8180/jeecg-boot/',
|
|
'http://127.0.0.1:8180/actuator/health',
|
|
'http://127.0.0.1:8180/'
|
|
)) {
|
|
try {
|
|
$r = Invoke-WebRequest -Uri $u -UseBasicParsing -TimeoutSec 5
|
|
"OK $($r.StatusCode) $u"
|
|
} catch {
|
|
"FAIL $u"
|
|
}
|
|
}
|
|
Write-Output 'LEDGER_DIAG_DONE'
|