Simple server monitoring tool

Results 1 to 12 of 12
  1. #1
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    thumbs up Simple server monitoring tool

    Did your Cabal server go down and you only came to know about it from whining players? No worries! Here is a simple tool that will notify you when your server goes down so that you fix the issue ASAP!

    I have built a very rudimentary monitoring tool using NodeJS which can notify the server owner through Discord or Email if and when server port is not accessible i.e. server is down.

    Link: https://github.com/cyberinferno/simp...e-port-monitor

    You can run this tool anywhere and get real time notifications when your server goes down!

    Feedback on how to make this better is always appreciated


  2. #2
    Breaker of Codes GoldenHeaven is offline
    MemberRank
    Jan 2010 Join Date
    271Posts

    Re: Simple server monitoring tool

    Quote Originally Posted by cyberinferno View Post
    Did your Cabal server go down and you only came to know about it from whining players? No worries! Here is a simple tool that will notify you when your server goes down so that you fix the issue ASAP!

    I have built a very rudimentary monitoring tool using NodeJS which can notify the server owner through Discord or Email if and when server port is not accessible i.e. server is down.

    Link: https://github.com/cyberinferno/simp...e-port-monitor

    You can run this tool anywhere and get real time notifications when your server goes down!

    Feedback on how to make this better is always appreciated
    Suggests bot auto server reboot (dunno if possible to use/send telnet cmds thru discords bot)

  3. #3
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    Re: Simple server monitoring tool

    Quote Originally Posted by GoldenHeaven View Post
    Suggests bot auto server reboot (dunno if possible to use/send telnet cmds thru discords bot)
    It maybe possible to add SSH client to the tool. Hence restart commands (if configured to each service in the config) could be executed using that SSH client! Will look into it.

  4. #4
    ANTI emi is offline
    MemberRank
    Mar 2009 Join Date
    ZHLocation
    1,378Posts

    Re: Simple server monitoring tool

    Well, if you learn about server being down from player I would be wondering what server you are running in the first place :)
    This is like Poor man's version of monitoring of a server. You could clean up the code if you got time :)

  5. #5
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    Re: Simple server monitoring tool

    Quote Originally Posted by emi View Post
    Well, if you learn about server being down from player I would be wondering what server you are running in the first place :)
    Not every private has the luxury to keep a staff member online at every major timezone to monitor the server. At some point of the day there might be no staff online!

    Quote Originally Posted by emi View Post
    This is like Poor man's version of monitoring of a server.
    Do some research before posting such brainless comments. There are enterprise grade server monitoring tools like Nagios which are open source and free of cost. Hence one need not be poor to run such a service. I made this tool with only one thing in mind i.e. Simplicity. It is really easy to set this up and it does only port monitoring & notifications.

    Quote Originally Posted by emi View Post
    You could clean up the code if you got time :)
    I agree every code has room for improvement. But writing such vague statement does not help to improve it. If you tell something specific about the tool then I will try to improve it. Also it is an open source tool. So even you can contribute some code to improve it (If you are capable of doing it)

  6. #6
    ANTI emi is offline
    MemberRank
    Mar 2009 Join Date
    ZHLocation
    1,378Posts

    Re: Simple server monitoring tool

    I see some people got really attacked and took it very personal, which was far from my intention.

    Quote Originally Posted by cyberinferno View Post
    Not every private has the luxury to keep a staff member online at every major timezone to monitor the server. At some point of the day there might be no staff online!
    For the first point, if you need people to manually monitor a server of pretty much any kind in 2019, soon to be 2020, then you don't know what are you doing. This not a luxury, it's the standard. You can disagree or whatever, but it doesn't change the fact.

    Quote Originally Posted by cyberinferno View Post
    Do some research before posting such brainless comments. There are enterprise grade server monitoring tools like Nagios which are open source and free of cost. Hence one need not be poor to run such a service. I made this tool with only one thing in mind i.e. Simplicity. It is really easy to set this up and it does only port monitoring & notifications.
    Please refrain yourself from using insults, I have used none. I don't need to do any kind of research to answer basic topics such as monitoring.
    It looks like you got attacked because I used the phrase "Poor man's monitoring". That was not an insult, in fact I have been saying the exactly same thing.
    Quote from this article: https://edoverflow.com/2018/the-poor...itoring-setup/
    The reason why I call it the poor man’s monitoring setup is simply to indicate that this setup is not extremely sophisticated, but it does its job beautifully.
    Your welcome!

    Quote Originally Posted by cyberinferno View Post
    I agree every code has room for improvement. But writing such vague statement does not help to improve it. If you tell something specific about the tool then I will try to improve it. Also it is an open source tool. So even you can contribute some code to improve it (If you are capable of doing it)
    First of all, I assure you I am more than capable of contributing/improve it, write it from scratch.

    Want some concrete advice? Here's some examples:
    • Read about truthy and falsy values in Javascript so you don't have to write code such as:
      Code:
      config['services'].length===undefined|| config['services'].length==0
    • Avoid lines that are super long and require a second screen to read
    • Avoid vars, use const and let instead to avoid polluting the global space.
    • Use arrow functions and more broadly at least ES2018 to simplify the code.
      e.g.
      Code:
      .then(function (data) {
      becomes
      Code:
      .then((data) => {
    • Use async/await with Promises
    • If you have too many/lengthy parameters to a function, you can pass in an object
    • Avoid using magic numbers, put them as constants at the TOP.
    • Order your imports
    • Use string interpolation instead of concatenation.
    • For function discordNotification you don't verify the url is valid while for emailNotification you do a basic check. Typos happen all the time, you should have a config validator.
    • You can replace the ugly C-like for with Javascript forEach.
    • You could even use Observables instead of Promises.
    • Reduce the level of nesting. You could do that by creating tasks for each individual server config with a ".map" and then Promise.all on those.


    This is not a comprehensive list.

    Good enough for ya? I encourage everyone who got attacked to take a step back and relax.

    Happy holidays!

  7. #7
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    Re: Simple server monitoring tool

    Quote Originally Posted by emi View Post
    First of all, I assure you I am more than capable of contributing/improve it, write it from scratch.
    I don't see much of your code contributions to the RZ Cabal community. Why so?

    Quote Originally Posted by emi View Post
    Want some concrete advice? Here's some examples:
    • Read about truthy and falsy values in Javascript so you don't have to write code such as:
      Code:
      config['services'].length===undefined|| config['services'].length==0
    • Avoid lines that are super long and require a second screen to read
    • Avoid vars, use const and let instead to avoid polluting the global space.
    • Use arrow functions and more broadly at least ES2018 to simplify the code.
      e.g.
      Code:
      .then(function (data) {
      becomes
      Code:
      .then((data) => {
    • Use async/await with Promises
    • If you have too many/lengthy parameters to a function, you can pass in an object
    • Avoid using magic numbers, put them as constants at the TOP.
    • Order your imports
    • Use string interpolation instead of concatenation.
    • For function discordNotification you don't verify the url is valid while for emailNotification you do a basic check. Typos happen all the time, you should have a config validator.
    • You can replace the ugly C-like for with Javascript forEach.
    • You could even use Observables instead of Promises.
    • Reduce the level of nesting. You could do that by creating tasks for each individual server config with a ".map" and then Promise.all on those.


    This is not a comprehensive list.

    Good enough for ya? I encourage everyone who got attacked to take a step back and relax.

    Happy holidays!
    You should implement all these and give a pull request if it is bothering you so much as these are just code quality improvements. I don't really see any advantage of such a major refactoring of a working code that works without a hiccup in a production environment!
    Last edited by cyberinferno; 23-12-19 at 06:10 PM.

  8. #8
    ANTI emi is offline
    MemberRank
    Mar 2009 Join Date
    ZHLocation
    1,378Posts

    Re: Simple server monitoring tool

    Quote Originally Posted by cyberinferno View Post
    Why don't I see any of your code contributions to the RZ Cabal community?
    Probably because when I was doing that you weren't writing in this section. If you do an ordering by most viewed topics, you might still be able to find some.
    Quote Originally Posted by cyberinferno View Post
    You should implement all these and give a pull request if it is bothering you so much as these are just code quality improvements. I don't really see any advantage of such a major refactoring of a working code that works without a hiccup in a production environment!
    It's sad you don't see, but understandable.

    Good luck!

  9. #9
    Cya nerds PunkS7yle is offline
    MemberRank
    Feb 2010 Join Date
    1,448Posts

    Re: Simple server monitoring tool

    Quote Originally Posted by emi View Post
    ...pedantic bullshit...

    Happy holidays!
    This is the most BS list ever
    Avoid lines that are super long and require a second screen to read
    On which screen ? What resolution Word wrap ?! . If someone left me this line in a code review at work I'd slap them. If u have constructive criticism sure, give it. The guy did his best with an open source project to give back to the community in a language he's not comfortable in. I don't see you doin this anymore, even your stupid GM tools have so much bad code in them(hardcoded license keys in .net lmao), the list would be just as big or bigger. Truth be told there are simpler ways to do this, there are a lot of android apps for example that will call or ring your phone in alert mode when your services go down. Teaching the community to use them is another story though, so that's why these releases are nice, they raise awareness to these kind of things.

  10. #10
    ANTI emi is offline
    MemberRank
    Mar 2009 Join Date
    ZHLocation
    1,378Posts

    Re: Simple server monitoring tool

    Well, I hope you have an anti-harassment policy at work. Otherwise I suggest you read again what I wrote, starting from the first post.
    I am not going to sink to your level.

    Happy holidays!

  11. #11

    Re: Simple server monitoring tool

    I agree with @emi totally. Once this happens at my work and someone write similar as u listed above i just delete that line or comment it and write TODO: for those who did it to write it other way.

  12. #12
    Cya nerds PunkS7yle is offline
    MemberRank
    Feb 2010 Join Date
    1,448Posts

    Re: Simple server monitoring tool

    You can replace the ugly C-like for with Javascript forEach.
    This is the dumbest thing I read in a while, doesn't surprise me from a guy that does JS though lmao. For is faster in almost any situation than forEach. And since when is `for ugly ?



Advertisement