SRCDS Steam group


srcds monitoring software
#16
BehaartesEtwas Wrote:NMAX=24 defines a maximum number of consecutive failures before it kills the server.

you are still using a wrong version. I forget to remove my own rcon password (don't try, it's already changed Toungue), so copy the whole script from my post above again.

"LD_PRELOAD=" does nothing and can be removed :-)

ok it seems to work now :

Code:
Watching ports: 27015 27016 27017
27015 27016 27017 27015 27016 27017 27015 27016 27017 27015 27016 27017

explane pls what is gonna happent when the server hang ? is it going to start the same process with the same user

This is on Xubuntu
Reply
#17
I left your tool during the night and in the morning one of my screens was shuted down along with the server on it ,so pls explane in detiles what sould be done to statrt the server again ....

I'm just keep trying and on my sevvers like on test servers .... i have players on them ... pls give me correct info not guessing.I explaned you that i run the server under user not root and it;s startin on a background screen

pls give correct info why the script terminating the screen and never start the server again ....
Reply
#18
sorry, you should always try this on non-productive servers first. there are just too many thinks that could be different for you. I can only guess what you are do to run your servers...

you need to run the server with -autoupdate to they restart e.g. if you write quit in the console or kill them... the script does not restart the servers, it actually just kills them (after NMAX attempts to connect via rcon have failed).
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#19
can you make your script to suit my needs ... i need the same watching but when it kills the server to run in 10 sec the server with for examle :

cd /home/myaccount/Install/New
./startzmsrcds.sh

that's how i start my server with one click ... would you do that for me pls ?
Reply
#20
sorry I don't understand. if it kills your server they do restart in 10 seconds? are the 10 secs your problem (try -timeout 1)? or aren't they restarting at all?
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#21
my server runs in screen so when your script kills the server it kills also the screen ... what i need is after it kills the screen the run a command :

Examlpe :

cd /home/myaccount/Install/New
./startdeadm.sh

but i have 3 servers so it needs to check all 3 of them are running or not ...

the prcesses are:

19009.deadmach (Detached)
9573.zombie (Detached)
9409.classic (Detached)

so it should be also checking if the processes are runing
Reply
#22
run the server inside the screen with e.g. srcds_run -autoupdate ...
then it will not kill the screen. I am running the servers in screens as well...
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#23
BehaartesEtwas Wrote:run the server inside the screen with e.g. srcds_run -autoupdate ...
then it will not kill the screen. I am running the servers in screens as well...


I don't want to run the server with -autoupdate i need the following:

1. checking ports how it is now
2. If the server doesn't respond in the time set = kill server
3. Start server on the killed server port

classic = 27015
zombie = 27016
deadmatch = 27017

command for stating the servers

classic = cd /home/myaccount/Install/New
./startsrcds.sh

zombie = cd /home/myaccount/Install/New
./startzmsrcds.sh

deadmatch = cd /home/myaccount/Install/New
./startdeadm.sh

the script to wait 10 sec before it stats the screen with the server again

I hope u undestood what i need now ,I'll pay for this 10 $ for taking your free time

Thank you and i hope i'll use this script soon

Waiting for your reply
Reply
#24
@ zhelev81
I've made something you might find useful. Look at http://css.setti.info/development/monit_srcds_plugin/. This requires you install also lightweight monitoring software called Monit [ http://mmonit.com/monit/ ].

Monit is very useful in creating this kind of monitoring scripts. In the script Monit tries to restart the game server three times (by executing ./stopsrcds.sh for example) if it's not responding for couple minutes. If the server isn't running after it's been restarted three times, then Monit will send you email telling that the server needs maintenance.

Here's the Monit code, which is the most important. Anybody with little linux scripting skills can create the start.sh and stop.sh, but you find them from the aforementioned site too.

Store the file to /etc/monit.d/srcds and then restart monit. Remember to change the name and address from the first line (eg. myserver = zombie, address = xxx.yyy.zzz.xxx). Then change START PROGRAM and STOP PROGRAM lines to your startup and stop scripts. The UID and GID "user" should be changed to whatever username and group you use to run your server (for example "root"). The fourth line is PORT 27015 (change to 2701x accordingly). In very end there is also ALERT user@gmail.com, which you should change to your email address so you get email warning when Monit doesn't get the server running by itself.

Code:
CHECK HOST myserver ADDRESS 1.2.3.4
START PROGRAM = "/home/user/csds/start.sh" AS UID user AND GID user
STOP PROGRAM = "/home/user/csds/stop.sh" AS UID user AND GID user
IF FAILED PORT 27015 TYPE UDP
  SEND "\0xFF\0xFF\0xFF\0xFFi"
  EXPECT ""
  WITH TIMEOUT 3 SECONDS
  FOR 5 CYCLES
THEN RESTART
EVERY 5 CYCLES
IF 3 RESTARTS WITHIN 20 CYCLES THEN TIMEOUT
ALERT user@gmail.com ON {timeout}
  WITH MAIL-FORMAT {
   from: monit@$HOST
   subject: Game server at $HOST is down
   message: Game server is down since $DATE.
   Note that I already tried restarting three times.

   Yours, Monit.
  }
Reply
#25
There is actually thread on this forum too: http://forums.srcds.com/viewtopic/9038
Reply
#26
Code:
while true; do
  <start your server here>
  sleep 10
done
this will restart your server after quit/kill/crash with a wait time of 10 seconds even without -autoupdate. run this inside your screen so you can actually terminate the server by pressing ctrl+c inside the screen... else this could be annoying ;-)
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#27
CSS thank you for the big help u gave me ,u spent so much of your free time and we finaly we got it working ,now my 3 server are monitored and i can say i'm happy Toungue) BehaartesEtwas i also thank you ,but i coudn't make your script working so i went for the other script ...

Thank you both once again and i wish you all the best
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)