Search the Community
Showing results for tags 'Keep Running'.
-
If you like me are running Emby Server on a Windows computer you know that it sometimes fails... if you like me sit in front of the TV with just a remote in your hand and want to watch your favorite show and Emby have failed, and in 99,9% of the time all you need to do is start it again you get somewhat annoyed. You can probably handle this a thousand ways but I wrote a small powershell script that checks if the website is responding, if it isn't stops the emby processes and starts them up again. I run this as a scheduled task and it have kept my Emby more up and running than before. I have tested this on a Windows 10 computer, I have no idea if this runs at all on any other version of Windows. I would guess that it does but you probably have to update Windows Powershell to use it. How to use it. Create a .ps1 textfile (Like C:\MyScripts\Emby-Monitor.ps1) with this content: $embywebsite = "http://localhost:8096" try{ $x=Invoke-RestMethod -Method Get -Uri $embywebsite -ea stop -TimeoutSec 5 } catch{ Write-EventLog -EntryType Error -LogName Application -Source “Emby-Monitor” -EventId 8096 -Message "Emby Website is DOWN - Shutdown and Startup again" Stop-Process -Name *Emby* -Force Start-Process $env:APPDATA\Emby-Server\system\EmbyServer.exe } You need to run the below command as an administrator once, this is to create the source for eventlog If you do not do this monitoring will still work but it wont write anything in the eventlog New-EventLog –LogName Application –Source “Emby-Monitor” Create a scheduled task that runs the scipt how ever often you like as the logged on user To test it simply exit Emby (taskbar icon, right click and exit) and run the scheduled task and Emby should start up again.
- 6 replies
-
- Windows
- Emby Server
-
(and 1 more)
Tagged with: