-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Change ping module to danielzzz/node-ping #2223
feat: Change ping module to danielzzz/node-ping #2223
Conversation
Not sure if it is worth it, but it could be a good idea to convert |
It will be beautiful and good. However, if it is just for Uptime Kuma, maybe it is not worth. Just brainstorming, maybe you can make your own ping library which based on this code, Uptime Kuma and other projects would benefit from it. In addition to ES6 format, you could also add support for async/await etc. Fyi, the current Uptime Kuma's |
Just did a quick search for node ping modules. I did find this one https://github.com/danielzzz/node-ping that seems to support most things we need. Did you see this when creating the ping monitor? (just wondering in case there was a reason you didn't use it) Edit: Also found this one that looks a bit more advanced https://github.com/nospaceships/node-net-ping How would you feel about replacing |
Yes, as I remember that I tested it and it only returns This one is not using Edit: Just read |
In which case, I will work on implementing this module using the promise based implementation if that is OK with you. |
Yes, looked its platform handling, I think it has better handling and no hardcoded path. We can switch to it. |
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> #Fixes 2126
This should be ready for review / testing now |
Added a check to see if the host is alive. This prevents failiures when the user specifies a hostname of `unknown`. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Tested and I changed some settings as previous (Timeout: 10s, 1 try), thanks. |
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Im not sure if this update is the culprit of a new problem after upgrade to 1.19.4, but after the upgrade, my monitors with ping are giving me false positives (down) almost every 10 minutes with the text: 1 packets transmited, 0 received, 100% packet loss, time 0ms, then 1 or 2 minutes later my monitors are backed up on uptime-kuma, im pretty sure that is a false positive. I have another uptime-kuma instance with older version and on that instance the same monitors do not present the problem |
I think it is unrelated, because it is eventually using your system's ping command.
It was reported by ping command. |
We could always add an option to alter how many packets are sent, a bit like the ping packet size pr |
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
This PR changes the ping module from ping-lite to danielzzz/node-ping. This fixes the hard coded ping path and also makes implementing packet size easier.
Fixes #2126
Type of change
Please delete any options that are not relevant.
Checklist
(including JSDoc for methods)