• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Simple server monitoring tool

Joined
Jun 10, 2009
Messages
659
Reaction score
141
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/simple-remote-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 :thumbup1:
 
Experienced Elementalist
Joined
Jan 30, 2010
Messages
267
Reaction score
129
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/simple-remote-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 :thumbup1:

Suggests bot auto server reboot (dunno if possible to use/send telnet cmds thru discords bot)
 
Joined
Mar 22, 2009
Messages
1,231
Reaction score
502
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 :)
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
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!

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.

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)
 
Joined
Mar 22, 2009
Messages
1,231
Reaction score
502
I see some people got really attacked and took it very personal, which was far from my intention.

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.

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-mans-monitoring-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!

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[[COLOR=#032F62]'services'[/COLOR][COLOR=#24292E]].[/COLOR][COLOR=#005CC5]length[/COLOR][COLOR=#D73A49]===[/COLOR][COLOR=#005CC5]undefined[/COLOR][COLOR=#D73A49]||[/COLOR][COLOR=#24292E] config[[/COLOR][COLOR=#032F62]'services'[/COLOR][COLOR=#24292E]].[/COLOR][COLOR=#005CC5]length[/COLOR][COLOR=#D73A49]==[/COLOR][COLOR=#005CC5]0[/COLOR]
  • 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:
    .[COLOR=#005CC5]then[/COLOR][COLOR=#24292E]([/COLOR][COLOR=#D73A49]function[/COLOR][COLOR=#24292E] ([/COLOR][COLOR=#24292E]data[/COLOR][COLOR=#24292E]) {[/COLOR]
    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!
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
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?

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[[COLOR=#032F62]'services'[/COLOR][COLOR=#24292E]].[/COLOR][COLOR=#005CC5]length[/COLOR][COLOR=#D73A49]===[/COLOR][COLOR=#005CC5]undefined[/COLOR][COLOR=#D73A49]||[/COLOR][COLOR=#24292E] config[[/COLOR][COLOR=#032F62]'services'[/COLOR][COLOR=#24292E]].[/COLOR][COLOR=#005CC5]length[/COLOR][COLOR=#D73A49]==[/COLOR][COLOR=#005CC5]0[/COLOR]
  • 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:
    .[COLOR=#005CC5]then[/COLOR][COLOR=#24292E]([/COLOR][COLOR=#D73A49]function[/COLOR][COLOR=#24292E] ([/COLOR][COLOR=#24292E]data[/COLOR][COLOR=#24292E]) {[/COLOR]
    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:
Joined
Mar 22, 2009
Messages
1,231
Reaction score
502
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.
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!
 
Joined
Feb 26, 2010
Messages
1,374
Reaction score
780
...pedantic shenanigans...

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.
 
Joined
Mar 22, 2009
Messages
1,231
Reaction score
502
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! :laugh:
 
Initiate Mage
Joined
Dec 2, 2016
Messages
2
Reaction score
0
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.
 
Joined
Feb 26, 2010
Messages
1,374
Reaction score
780
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 ?
 
Back
Top