Add Idunn Raven capture mux watchdog
This commit is contained in:
parent
c3a021f96f
commit
6ad39e776e
6 changed files with 55 additions and 1 deletions
2
scripts/health-raven-capture-mux.cmd
Normal file
2
scripts/health-raven-capture-mux.cmd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\health-raven-capture-mux.ps1
|
||||
9
scripts/health-raven-capture-mux.ps1
Normal file
9
scripts/health-raven-capture-mux.ps1
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
param(
|
||||
[string] $RavenHost = "10.77.0.4",
|
||||
[string] $HealthUrl = "http://127.0.0.1:8801/health"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
& ssh.exe -o BatchMode=yes -o ConnectTimeout=5 $RavenHost "curl.exe -fsS $HealthUrl >NUL"
|
||||
exit $LASTEXITCODE
|
||||
2
scripts/restart-raven-capture-mux.cmd
Normal file
2
scripts/restart-raven-capture-mux.cmd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-raven-capture-mux.ps1
|
||||
28
scripts/restart-raven-capture-mux.ps1
Normal file
28
scripts/restart-raven-capture-mux.ps1
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
param(
|
||||
[string] $RavenHost = "10.77.0.4",
|
||||
[string] $MimirRepo = "E:\Projects\Mimir",
|
||||
[string] $TargetHost = "10.77.0.2",
|
||||
[int] $Port = 5200,
|
||||
[string] $ObsTargetHost = "10.77.0.2",
|
||||
[int] $ObsPort = 5204
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$remoteScript = @"
|
||||
`$ErrorActionPreference = "Stop"
|
||||
`$startScript = Join-Path "$MimirRepo" "scripts\start-raven-daemon.ps1"
|
||||
if (-not (Test-Path -LiteralPath `$startScript)) {
|
||||
throw "Raven Mimir start script not found at `$startScript"
|
||||
}
|
||||
Get-CimInstance Win32_Process |
|
||||
Where-Object { `$_.Name -ieq "dotnet.exe" -and `$_.CommandLine -like "*Mimir.RavenDaemon*" } |
|
||||
ForEach-Object {
|
||||
& taskkill.exe /PID `$_.ProcessId /T /F | Out-Null
|
||||
}
|
||||
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File `$startScript -TargetHost "$TargetHost" -Port $Port -ObsTargetHost "$ObsTargetHost" -ObsPort $ObsPort
|
||||
"@
|
||||
|
||||
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($remoteScript))
|
||||
& ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $RavenHost "powershell.exe -NoProfile -EncodedCommand $encoded"
|
||||
exit $LASTEXITCODE
|
||||
|
|
@ -55,6 +55,13 @@ $watchdogs = @(
|
|||
Restart = "$repoRoot\scripts\restart-voidbot.cmd"
|
||||
IntervalSeconds = 300
|
||||
},
|
||||
[pscustomobject]@{
|
||||
Id = "raven-capture-mux"
|
||||
Name = "Raven capture mux"
|
||||
Verse = "raven.local"
|
||||
Health = "$repoRoot\scripts\health-raven-capture-mux.cmd"
|
||||
Restart = "$repoRoot\scripts\restart-raven-capture-mux.cmd"
|
||||
},
|
||||
[pscustomobject]@{
|
||||
Id = "nightwing-gjallar"
|
||||
Name = "Nightwing Gjallar framebuffer compositor"
|
||||
|
|
|
|||
Loading…
Reference in a new issue