WickedMoonShiner

Looking for input on Multi Servers on 1 system with BEC

4 posts in this topic

So I might be doing this all wrong but wanted input from you all.

I have multi servers on a testing system that I would like to spin up at the same time. That is not the issue as I just change the port but what I have going on is that I use BEC to do my reboots Let me provide you some examples below. 

I have BEC that runs in the background to monitor my server and if anything goes down it auto restarts also when the 4 hours are up scheduler issues a stopserver.bat and then the monitor.bat restarts my startserver.bat.  Is there a easier way because I can't run the scripts as I have it watching the windows because it is going to start shutting down the wrong windows. I feel I might be working harder then I should at this. 

I currently have 1x Exile Server  1x Exile Dev  and  1x Altis Life server 

Scripts I just edit the scripts for each system and then down one to start the other.

restartserver.bat

@echo off
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

taskkill /f /im cmd.exe /fi "windowtitle eq Administrator:  servermonitor.bat"
echo Make sure all is clear

cd C:\Servers\Arma3Exile
timeout 3
start "arma3" "C:\Servers\Arma3Exile\arma3server.exe" "-serverMod=@ExileServer;@infiSTAR_servermod;" "-mod=@Exile;" -port=2302 "-config=C:\Servers\Arma3Exile\@ExileServer\config.cfg" "-cfg=C:\Servers\Arma3Exile\@ExileServer\basic.cfg" -profiles=logs -BEPath=C:\Servers\Arma3Exile\battleye -name=logs -malloc=tbbmalloc -nosplash -noSound -noPause -autoinit -enableHT
timeout 30
echo ARMA 3 Server has started
set becpath="C:\Servers\Exile_BEC"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg --dsc
timeout 3
echo Battleye has started.. 
echo.
echo.


set ServerMonitorPath="C:\Servers\Arma3Exile\"
cd /d %ServerMonitorPath%
start "" "servermonitor.bat"
echo Server Monitor has started. Have Fun
timeout 5
exit 

StopServer.bat

@echo off
::KILL ARMA3 SERVER
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1
::DOUBLE CHECK KILL
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

ServerMonitor.bat

@echo off
title servermonitor.bat
:start
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
echo Server is not running, will be started now 
start "" /min /wait "C:\Servers\Arma3Exile\restartserver.bat"
timeout 30
echo Server started succesfully
goto started
:loop
cls
echo Server is already running, running monitoring loop
:started
C:\Windows\System32\timeout /t 80
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
goto start

 

Is there another tool I should check into to help me manage multi servers? Any suggestion would be awesome.  I am open. But I am just a Basic programmer I can't do anything crazy. 

Share this post


Link to post
Share on other sites

Not sure if I get you'r core problem right, but if I do theres an easy solution:

 

rename your arma3server.exe corresponding to your server. Like, name it arma3exileDEV.exe, change all your scripts and .bats to fit the name and voila, it'll only kill/restart the specific server.

You could also go by PID, but thats actually too much hazzle as a secondary way for one that gets it fixed easy as pie.

 

Edit: same for your BEC - it auto-cancels the process when it doesnt find the server any more, but renaming it to easily keep track of which BEC belongs to which server cant hurt

Edited by Starfish
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Not sure if I get you'r core problem right, but if I do theres an easy solution:

 

rename your arma3server.exe corresponding to your server. Like, name it arma3exileDEV.exe, change all your scripts and .bats to fit the name and voila, it'll only kill/restart the specific server.

You could also go by PID, but thats actually too much hazzle as a secondary way for one that gets it fixed easy as pie.

 

Edit: same for your BEC - it auto-cancels the process when it doesnt find the server any more, but renaming it to easily keep track of which BEC belongs to which server cant hurt

Thanks that is kinf od what I was looking for. I have been toying with the idea of making a panel with like Server 1 and 2 and 3 in it can I can just click start and stop on it. 

 

Thanks for the input @StarFish

Share this post


Link to post
Share on other sites

This is easy

  1. setup servers (each server in its own folder,  1x Exile Server  1x Exile Dev  and  1x Altis Life server )
  2. install BEC to each server folder (check server messages and restart warning messages are working, use a working scheduler.xml)
  3. make 3 new bat files on your desktop name them the same as each server folder (so you know what monitor script is monitoring what server)
  4. paste a working monitor batch script code into each file then edit the command-lines  and file paths in each file to match your servers

here is a monitor script i put together for my epoch servers

https://epochmod.com/forum/topic/42995-release-serverbec-monitor-auto-restart-auto-backup-sql-db-script/

or edit Seths

@echo off
cls

set version=0.9.19
set wat=Arma3 Exile

title %wat% Watchdog
cd A3Master

:watchdog
echo (%time%) %wat% started.
start "Exile" /wait /high "arma3server.exe" -port=2302 "-serverMod=@ExileServer;@marma" "-mod=@Exile;" "-config=@ExileServer\config.cfg" "-cfg=@ExileServer\basic.cfg" -profiles=config_exile -name=exile -malloc=tbbmalloc -autoinit -enableHT
echo (%time%) %wat% closed or crashed, restarting.
goto watchdog

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.