Raised This Month: $90 Target: $400
 22% 

[Linux] HLDSWatch - hl/srcds monitoring and auto restarter script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 06-02-2012 , 01:42   [Linux] HLDSWatch - hl/srcds monitoring and auto restarter script
Reply With Quote #1

HLDSWatch
HLDS/SRCDS monitoring and auto restarter script


:: Intro ::
TL;DR..

Guy maintained bunch of game servers and hated dealing with stalled server processes which require his manual action to restart them. Wrote a bash script to automate those mundane routines so he could stop worrying..realized bash wasn't efficient enough for the job..rewrote the script from scratch with py. Satisfied with the result and posted it to public


:: Features ::
  • Supports both HLDS and SRCDS
  • Server status is determined by pinging server with UDP packet, instead of pid or process checking, for better reliability
  • Single py script thats run in the background..fire and forget
  • No webserver and database is required
  • Uses simple config file
  • On server crash, you can run your custom command or restart the server automatically
  • Logging to both console and file

:: Requirements ::
  • Linux
  • Python 2.6+ (installed by default on most Linux distros)
  • GNU screen
  • All servers must run from the same user account as HLDSWatch

:: Instructions ::
  1. Make sure you have all the requirements above
  2. Download the script and place it anywhere you want but it must be in the same user account as your servers
  3. Take a look at the sample config and edit it as needed
  4. Start the script with: screen -S hldswatcher ./hldswatch <config.cfg> (be sure to give the script chmod +x)

:: Download ::
Go to this Link (bitbucket)

Last edited by Mlk27; 10-24-2013 at 00:41. Reason: v2
Mlk27 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-02-2012 , 01:58   Re: [Linux] HLDSWatch
Reply With Quote #2

Down?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar,get_pcvar_num(pCvar) ? 1); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Mlk27
Veteran Member
Join Date: May 2008
Old 06-02-2012 , 13:42   Re: [Linux] HLDSWatch
Reply With Quote #3

First post updated with instructions, also script files attached. Have fun testing it. Feel free to post any suggestions, requests or report bugs and errors in the script
Mlk27 is offline
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 06-05-2012 , 06:13   Re: [Linux] HLDSWatch
Reply With Quote #4

yay python, good job!
kileedyg is offline
Send a message via Skype™ to kileedyg
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 06-08-2012 , 18:35   Re: [Linux] HLDSWatch
Reply With Quote #5

Can you make it so that it would be possible to specify a .sh file with all the needed launch parameters so I wouldn't have to write them in the scripts config file? For example, only leave the path like this: path = /home/path/to/hlds3/dir/start.sh And the script would use it to relaunch the server.

Last edited by BeasT; 06-08-2012 at 18:36.
BeasT is offline
Send a message via Skype™ to BeasT
Mlk27
Veteran Member
Join Date: May 2008
Old 06-11-2012 , 08:59   Re: [Linux] HLDSWatch
Reply With Quote #6

Quote:
Originally Posted by BeasT View Post
Can you make it so that it would be possible to specify a .sh file with all the needed launch parameters so I wouldn't have to write them in the scripts config file? For example, only leave the path like this: path = /home/path/to/hlds3/dir/start.sh And the script would use it to relaunch the server.
Hmm maybe, but why'd you want to place launch params in launcher script? I thought having all server launch params in a single config is much more convenient

By the way, next version will include support for SRCDS.
__________________
HLDSWatch - HLDS monitoring and auto restarter script
Mlk27 is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 06-11-2012 , 16:20   Re: [Linux] HLDSWatch
Reply With Quote #7

Not for me. I have all launch parameters in seperate script for each server. That way it's more easy to start the them. So if I'd change those scripts, I would have to change the params in HLDSWatch config also.

Last edited by BeasT; 06-11-2012 at 16:20.
BeasT is offline
Send a message via Skype™ to BeasT
BAMHS
Junior Member
Join Date: Dec 2010
Old 07-30-2013 , 19:23   Re: [Linux] HLDSWatch
Reply With Quote #8

was working fine when i tested, but when put on live servers with people, server full, server kept restarting every mins with it and was restarting 2 or 3 other servers that usually dont crash every min too! and lagging servers cuz indefinitely restarting one server or 2.
BAMHS is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 10-11-2013 , 03:42   Re: [Linux] HLDSWatch
Reply With Quote #9

So I revisited the restarter script and refactored few things while adding support for srcds along the way..I'm finalizing v2 as I speak and I'm in need of few testers to help me testing the new version since I don't have servers anymore. If you're interested, hit me a PM
__________________
HLDSWatch - HLDS monitoring and auto restarter script

Last edited by Mlk27; 10-11-2013 at 03:43.
Mlk27 is offline
Hackerpcs
Member
Join Date: Jul 2012
Location: Greece
Old 10-17-2013 , 19:59   Re: [Linux] HLDSWatch
Reply With Quote #10

Windows version anytime soon?
Hackerpcs is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:00.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode