• SRCDS Server Monitor [Windows]
    50 replies, posted
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 [I]heavy[/I] 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 [url]https://github.com/blastehh/SRCDS-Server-Monitor[/url] 09/02/16 : Updated to 0.13.2 Fixed version numbers [URL="http://banana-ph.com/SRCDS_Server_Monitor-0.13.2.zip"]Download[/URL] 08/02/16 : Updated to 0.13.1 Added auto start option for servers to run when the program is opened. [URL="http://banana-ph.com/SRCDS_Server_Monitor-0.13.1.zip"]Download[/URL] 04/02/16 : Updated to 0.12.0 Added process priority and config import/export [URL="http://banana-ph.com/SRCDS_Server_Monitor-0.12.0.zip"]Download[/URL] 06/10/15 : Updated to 0.10.0 Servers will now restart on the map that was playing before the crash. [URL="http://banana-ph.com/SRCDS_Server_Monitor-0.10.0.zip"]Download[/URL] 13/04/15 : Updated to 0.9.11 [URL="http://banana-ph.com/SRCDS_Server_Monitor-09110.zip"]Download[/URL] 30/10/14 : Updated to 0.9.10 Redid columns, they're now resizable and no longer contain hidden crap. [URL="http://banana-ph.com/SRCDS_Server_Monitor-09100.zip"]Download[/URL] [URL="https://www.virustotal.com/en/file/5d6f9a55048518cb6510a9b67fe11675181b1737259a1ab28cef3727150a544c/analysis/1414627108/"]Virustotal report[/URL] 20/09/14 : Updated to 0.9.9 Missed a bug where the crash counter wasn't incrementing, introduced in 0.9.7b [URL="http://banana-ph.com/SRCDS_Server_Monitor-0990.zip"]Download[/URL] [URL="https://www.virustotal.com/en/file/d63c7ad03b4d01bedc7884868c582112ae0d6e74caea9bd15289e82b4a9c349e/analysis/1411236106/"]Virustotal report[/URL] 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. [URL="http://banana-ph.com/SRCDS_Server_Monitor-0980.zip"]Download[/URL] [URL="https://www.virustotal.com/en/file/19b962ab289b40dfc2004785041913c72dce693303d29e4415bcc6145e130e89/analysis/"]Virustotal report[/URL] 21/08/14 : Updated to 0.9.7b Added processor affinity and scheduled restarts [URL="http://banana-ph.com/SRCDS_Server_Monitor-0972.zip"]Download[/URL] [URL="https://www.virustotal.com/en/file/aabdb48f5484d4cb128550b09e5b3efe883fa4848910b324f5cc8f5f0c1d880a/analysis/1408579210/"]Virustotal report[/URL] 19/08/14 : Updated to 0.9.6b [URL="http://banana-ph.com/SRCDS_Server_Monitor-0960.zip"]Download[/URL] [URL="https://www.virustotal.com/en/file/98db83f656121538839d4161ec29e8c22665e12ead47df3c72074a21548adb22/analysis/1408482712/"]Virustotal report[/URL] Note: [B]Make sure you set the correct IP![/B] This will be the IP that your server reports when you type "status". [t]http://i.imgur.com/5Dtcm7E.jpg[/t] [t]http://i.imgur.com/jXgEuaQ.jpg[/t] [t]http://i.imgur.com/RylGmyH.jpg[/t] [B]Changes[/B] 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?
[QUOTE=Judd;45741437]maybe add tickrate options?[/QUOTE] 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?
[QUOTE=Judd;45743251]How can you see server console errors using this? Or can you not?[/QUOTE] It doesn't interact with the console, so you can't [QUOTE=crazyscouter;45742410]Source code pls.[/QUOTE] No
Would it be possible to add a setting to automatically restart the servers at a set time?
[QUOTE=datguyrick;45745744]Would it be possible to add a setting to automatically restart the servers at a set time?[/QUOTE] 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).."\n") 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!\n") 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.
[QUOTE=Blasteh;45745470] No[/QUOTE] Why.
[QUOTE=Blasteh;45745470]No[/QUOTE] 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.
[QUOTE=crazyscouter;45746381]Why.[/QUOTE] 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.
[QUOTE=ms333;45746717]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.[/QUOTE] 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...
[t]http://i.imgur.com/y2V5uGd.jpg[/t] [t]http://i.imgur.com/O5SDcDQ.jpg[/t] Wasn't that hard. :v:
[QUOTE=mijyuoon;45746829][t]http://i.imgur.com/y2V5uGd.jpg[/t] [t]http://i.imgur.com/O5SDcDQ.jpg[/t] Wasn't that hard. :v:[/QUOTE] 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.
[QUOTE=Blasteh;45746851]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.[/QUOTE] I don't need the source anyway, did it just because I had nothing better to do at the moment.
[QUOTE=Blasteh;45746754]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...[/QUOTE] The only problem is, that it will only restart if there are [B]no[/B] players on the server.
[QUOTE=ms333;45747053]The only problem is, that it will only restart if there are [B]no[/B] players on the server.[/QUOTE] The timer issue only exists if no players have ever joined the server since it was started, even if no players join after a map change, the timer will still run and you will get your restart [B]as long as at least 1 player has joined at any point[/B]. The only place where this will be an issue is: 1. Your map never changes 2. Your server never empties completely. 3. You have no players, ever. There are workarounds for #1, maybe a timer started by the player connection hook. For #2, you could modify it to announce a restart and restart regardless of number of players. For #3 why would it matter if people don't play on your server o.O
[url]http://www.dumbclan.co.uk/downloads/serverchecker/[/url] I would do something similar, with the timed restart, and I'd totally use this. Since I like my servers to restart via a hard close and relaunch. Seems to help with memory usage.
[QUOTE=Drak_Thing;45747503][url]http://www.dumbclan.co.uk/downloads/serverchecker/[/url] I would do something similar, with the timed restart, and I'd totally use this. Since I like my servers to restart via a hard close and relaunch. Seems to help with memory usage.[/QUOTE] This is what I used back when I ran servers, very good bit of kit. For those asking for source code - the author is under no obligation to release it so stop pestering him. Having said that, I'm an advocate of FOSS because it allows a huge degree of learning. Blasteh, as you mentioned learning C# a few times, you might find that releasing the source code for the program will allow more experienced developers to give you advice on ways to leverage the strengths of a language you're learning. C# is a wonderful programming language and I'd highly recommend you learn everything you can. [editline]20th August 2014[/editline] Couple of ideas for future versions: Split the project into a client GUI and a Windows service. The service does the monitoring work, while the client is used to view the status and configure the service. Using a WebSocket library like WebSocketSharp would make this pretty easy.
[QUOTE=Blasteh;45746468]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?[/QUOTE] No one once said you were obligated to. It was a request which you denied so I asked why. Not much more to it. If you don't feel like sharing it dont. We aren't making you. We are not entitled to anything you're right and we weren't demanding I said "please". But I only wanted it to ensure there was no malicious intent behind it. Again. If you don't want to share it dont. We can always decompile it ourselves. It would have just saved work is all.
[QUOTE=UberMensch;45747779]This is what I used back when I ran servers, very good bit of kit. For those asking for source code - the author is under no obligation to release it so stop pestering him. Having said that, I'm an advocate of FOSS because it allows a huge degree of learning. Blasteh, as you mentioned learning C# a few times, you might find that releasing the source code for the program will allow more experienced developers to give you advice on ways to leverage the strengths of a language you're learning. C# is a wonderful programming language and I'd highly recommend you learn everything you can. [editline]20th August 2014[/editline] Couple of ideas for future versions: Split the project into a client GUI and a Windows service. The service does the monitoring work, while the client is used to view the status and configure the service. Using a WebSocket library like WebSocketSharp would make this pretty easy.[/QUOTE] Thanks for understanding. My primary source for learning at the moment is google and stackoverflow, I don't really expect much C# help here because the majority of stuff being developed here is in Lua. I'll keep that idea in mind and it could be a fun challenge for me to try in the near future. [QUOTE=crazyscouter;45747957]No one once said you were obligated to. It was a request which you denied so I asked why. Not much more to it. If you don't feel like sharing it dont. We aren't making you. We are not entitled to anything you're right and we weren't demanding I said "please". But I only wanted it to ensure there was no malicious intent behind it. Again. If you don't want to share it dont. We can always decompile it ourselves. It would have just saved work is all.[/QUOTE] I think the way you phrase a request is important if you want a proper response, especially since you're not the only person asking for the same thing. If you have the skills to decompile the code yourself, I wouldn't have an issue with that; since if you can do that much, you are almost certainly capable of writing the program yourself.
[QUOTE=Blasteh;45748266]Thanks for understanding. My primary source for learning at the moment is google and stackoverflow, I don't really expect much C# help here because the majority of stuff being developed here is in Lua. I'll keep that idea in mind and it could be a fun challenge for me to try in the near future. I think the way you phrase a request is important if you want a proper response, especially since you're not the only person asking for the same thing. If you have the skills to decompile the code yourself, I wouldn't have an issue with that; since if you can do that much, you are almost certainly capable of writing the program yourself.[/QUOTE] Decompiling a .NET application requires literally zero knowledge
Could you add the ability to set the server affinity so it only uses specific cores?
[QUOTE=Blasphemy;45749778]Could you add the ability to set the server affinity so it only uses specific cores?[/QUOTE] Looking at how to implement this now
Wasn't there a rule, back when Binary Modules sub-section was still around that source code should be released as well? I understand that this is not part of the current set of rules, however this might be why so many are asking for it. Releasing the source code (on github for example) is ALWAYS a good idea. You will get more input, people offering to help, and suggestions for optimization. All round a decent way to get into the community. I fully understand that you are/were under no obligation to do so, but the rude replies you have given to those asking for the source code were, well, less than kind. I am sure many will find this a useful tool, although I prefer using Linux myself, that's not to say that others won't use it. Good job.
Sorry, you need to Log In to post a reply to this thread.