SRCDS Server Monitor [Windows]

Unhappy with the current offerings available on the webs, I dived in to VS and created this in about 4-5 12 hour days; that includes learning C#.

It is currently fully functioning and does what it’s supposed to do, make sure your server comes back up if it goes down.
The development version used SSQLib, but I actually didn’t use it in the end. It was just too heavy for my needs.

I have to stress that this is a no-frills application, and aside from maybe some slight improvements here and there, there won’t be any fancy features added.

Feedback is appreciated, but I only just learned enough C# to make this… so…

04/07/16 : Uploaded to github

09/02/16 : Updated to 0.13.2
Fixed version numbers
Download

08/02/16 : Updated to 0.13.1
Added auto start option for servers to run when the program is opened.
Download

04/02/16 : Updated to 0.12.0
Added process priority and config import/export
Download

06/10/15 : Updated to 0.10.0
Servers will now restart on the map that was playing before the crash.
Download

13/04/15 : Updated to 0.9.11
Download

30/10/14 : Updated to 0.9.10
Redid columns, they’re now resizable and no longer contain hidden crap.
Download
Virustotal report

20/09/14 : Updated to 0.9.9
Missed a bug where the crash counter wasn’t incrementing, introduced in 0.9.7b
Download
Virustotal report

19/09/14 : Updated to 0.9.8
Increased supported core selection to 16, needs testing though, since I don’t have 16 cores to test with.
Download
Virustotal report

21/08/14 : Updated to 0.9.7b
Added processor affinity and scheduled restarts
Download
Virustotal report

19/08/14 : Updated to 0.9.6b
Download
Virustotal report

Note: Make sure you set the correct IP! This will be the IP that your server reports when you type “status”.

http://i.imgur.com/5Dtcm7E.jpg[/t]
[t]http://i.imgur.com/jXgEuaQ.jpg[/t]
[t]http://i.imgur.com/RylGmyH.jpg

Changes
19/08/14

  • Made buttons easier to distinguish between enabled and disabled.
  • Added a note in the options, settings don’t take effect until the server is restarted manually, or if the program is reloaded.
  • Fixed a bug where adding a new server breaks the status update… oops.

If I used windows for servers I ran I would definitely use this. But then again I don’t own any servers lol

Anyways nice job.

Looks useful XD certainly easier then going through PuTTy to check what servers are up

Release the source code

Small update to fix a bug, you can update without taking down your servers, just quit the program, replace the file and then run it. It should pick it up the servers automatically when you try to start them again.

maybe add tickrate options?

You can just add that to your extra commands, it works the same

Source code pls.

How can you see server console errors using this? Or can you not?

It doesn’t interact with the console, so you can’t

No

Would it be possible to add a setting to automatically restart the servers at a set time?

If it’s gmod, you can use a simple lua script like this:
[lua]
local minimumTime = 12 * 60 * 60 – Minimum time needed before restart, 12 hours.
local thinkTimer = CurTime() + 60
local function timeFormat( time ) – Taken from utime
local tmp = time
local s = tmp % 60
tmp = math.floor( tmp / 60 )
local m = tmp % 60
tmp = math.floor( tmp / 60 )
local h = tmp % 24
tmp = math.floor( tmp / 24 )
local d = tmp % 7
local w = math.floor( tmp / 7 )

return string.format( "%02iw %id %02ih %02im %02is", w, d, h, m, s )

end

hook.Add(“InitPostEntity”, “CheckTimeForRestart”,function()
if !file.Exists(“restart.txt”,“DATA”) then
file.Write(“restart.txt”, os.time())
else
local lastStart = file.Read(“restart.txt”)
local timeRunning = os.time() - lastStart
ServerLog(“Server has been running for “… timeFormat(timeRunning)…”
“)
local canReboot = false
local hour = tonumber(os.date(”%H”))
if (hour > 0 && hour < 11) then canReboot = true end – Checks to see if it’s between midnight and 11am
if (timeRunning > minimumTime) && canReboot then
timer.Create(“RebootTimer”, 120, 0, function()
if ( #player.GetAll() ) == 0 then – players loading in during a mapchange are not counted! The timer is important, to allow time for players to load in.
ServerLog(“Auto Restarting Server!
“)
file.Write(“restart.txt”, os.time())
RunConsoleCommand(”_restart”)
end
end)
end
end
end)
[/lua]

If you’re running gmod, the above method would be preferable.
I’ll see about implementing a scheduled restart next week, bit busy this weekend.

Why.

Generally, when people ask for the source code, it’s because it’s obligatory to release it so that it can be confirmed that it’s not malicious.

Because:

  1. I have no obligation to. If you can find it somewhere in the rules, point it out and I will happily close this for not following the rules.

  2. It is my personal project that I do not feel like sharing.

  3. It’s rude to demand source code just because something has been released for free; entitlement culture much?

  4. Why do you want it?

Your example of automatic restart will never restart the server, since the timer will only run if there are players. And if there are, your script won’t restart the server.

It works, it’s what I use on my servers.

The timer will run as long as there has been players on the server at some point, this is always true for my servers, so not an issue.

It was made intentionally to not restart while there are players on, which is why I would prefer this lua method over a program just terminating the server.

But now that you mention it, it’s possible to add a way for the program to check if the server is empty or not before forcing a restart…

http://i.imgur.com/y2V5uGd.jpg[/t]
[t]http://i.imgur.com/O5SDcDQ.jpg

Wasn’t that hard. :v:

Never said you can’t dig in yourself, if you’re able to do that, you’re more than capable of writing your own.

Doesn’t mean I’ll release the original source though.

GJ.

I don’t need the source anyway, did it just because I had nothing better to do at the moment.