-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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: Tailscale ping monitor #3178
feat: Tailscale ping monitor #3178
Conversation
Are you planning to add code to this PR? I don’t think PRs are meant for empty discussion. i do believe custom command line parsing might be quite complicated. Even if you were able to call an arbitrary executable from uptime kuma - how would you be able to parse it’s replies and get a response time from that. Would „no error“ mean a good response? What about executables that first output a status line such as „pinging host xyz now“ and only the following lines would be the actual thing (ping) |
It is likely for non-docker setup and I think it may be too powerful to run a custom command via Uptime Kuma web interface. Let say someone run a So I would not recommend to implement this. Instead, implementing a new monitor type for tailscale ping is better. |
Based on your suggestions, I would consider implementing a new monitor type for Tailscale ping, however, there is no available npm package that directly supports Tailscale functionality, the best approach might be to use Node's Having not worked on uptime kuma in the past, I'd like to ask for your thoughts and suggestions on the best way to approach this. Are there examples or resources you could point me to that would help implement this correctly? I want to ensure that I could handle this in a way that does not mess with the existing design of Uptime Kuma. |
50c7d65
to
69ea7a2
Compare
I'm not a fan of this feature.
Weird: I also wouldn't want the tailscale binary included with uptime-kuma, totally different product / different release cycle, so I think it is sensible to assume it exists. But this would just mean that this monitor calls a maybe existing binary including parameters in the backend, specifically For this particular instance: Tailscale ping really is different than a regular ping, I totally get that. Personally I am also using Tailscale in my network and I am totally fine with regular pinging my Tailscale IPs / hostnames since this also goes via the same Wireguard channel. It is an ICMP request so it also feels like a regular ping and can be handled by everything (e.g. firewall, Tailscale ACL rules etc.). I don't really see a benefit of using |
I get that one of the focuses is that we don't want to overwhelm Uptime Kuma's interface or functionality with a myriad of product-specific monitors. However, I believe that integrating Tailscale ping as a monitoring type could provide added value for users who use Tailscale and Uptime Kuma concurrently, as a heavy user myself, this offers a more seamless user experience for me, and also other users for the need for workarounds. It also aligns with Uptime Kuma's goa;l of being a user-friendly monitoring solution. Perhaps we could consider an approach that provides the flexibility of adding product-specific monitors without cluttering the interface or functionality. For instance, we could consider a plugin-like structure where users could add or remove specific monitors based on their needs. One, the core application remains lightweight, and also two, users will have the flexibility to expand functionality as required. |
I understand this might require more discussion and planning. I'm open to any thoughts, suggestions, or directions you both may have. |
I honestly don't see the benefit of using
I understand your wish and this feature request for a better user experience, I also believe that a plugin-type-system might be beneficial - in this case I am fine with using regular ping. |
I think we should stick to my last comment (#3178 (comment)), uses I won't say there is no advantage, because in addition to the ping value, ultimately we can use this monitor to check whether it is running under P2P or DERP. |
@DennisGaida, I understand your position on using a regular ping for Tailscale. It's practical and fits within current features. Regarding the discussion on product-specific monitors, I take your point about potential cluttering. Yet, I believe that the user base could benefit from the option to use specific tools they already use and trust. To strike a balance, I propose we address this by incrementally integrating product-specific monitor types based on user needs, while at the same time considering evolving Uptime Kuma towards a plugin-friendly platform in a future release. This way, users can develop their own product-specific monitoring types. If a monitor proves robust and widely useful, we could consider including it within Uptime Kuma's repository as an "certified" plugin. I believe this could enhance both usability and simplicity, providing flexibility for users to customize their monitoring setup... perhaps we can start a separate thread for this. I'll be proceeding with the integration using child_process to call Tailscale ping as suggested by @louislam once I have the time. |
Split check function into two methods and added async/await syntax for readability/modularity Switched to promise-based error handling (takes into account different types of error such as "Execution error", "Error in output", "no matching peer", and "is local Tailscale IP") and throws them as JavaScript errors.
I couldn't see the tailscale monitor type in the "add monitor" page after building in docker, I used my my dockerfile and added the line "COPY ./ /app/" with the changes made with both our commits; I assume that some other changes need to be made within uptime kuma, however, I'll request a review for now. |
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Hey @CommanderStorm, I handled all the changes suggested, if there's anything more that I should do, please let me know. Otherwise, it is now ready for review. |
I noticed that the actions are not run against this PR, given that this PR targets npm run lint-fix:js
npm run lint |
I've ran ESLint and fixed all the linting issues. |
…s-implementation # Conflicts: # server/uptime-kuma-server.js
How did you manage to build and run it, I can't seem to find the option for tailscale in the monitor type section. |
Normally, you have to setup a development environment in your local. In case you don't want to, you can use this special docker image to test your pr:
https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests |
I could not get to the web interface, docker builds and runs correctly up until Uptime Kuma tries to initialize in this section, then the container stops, and the data volume is removed:
|
Please pull the image again and remove the argument
|
now interval value is correctly passed to runTailscalePing
…s-implementation # Conflicts: # server/uptime-kuma-server.js
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 is a feature proposal to discuss the implementation of a new functionality within Uptime Kuma that would allow the use of custom flags for command-line tools. A prime example of this feature's application is Tailscale integration, as detailed in issue #1981 (Tailscale Ping Integration).
Consider the Tailscale example: by enabling custom flags, users could substitute a standard ICMP ping with
tailscale ping
, resulting in improved security (respecting ACLs) and better network segmentation. The utility of this feature extends to numerous other scenarios, enhancing Uptime Kuma's adaptability and versatility.I've initiated this pull request to foster discussion and to collect feedback from maintainers and members alike on these proposed changes.
Proposed Changes
The proposed changes include:
By introducing a feature allowing users to define their own monitoring commands and expected responses, we enable them to utilize specific tools or protocols, such as Tailscale, for their monitoring needs; It extends Uptime Kuma's functionality, catering to a broader range of monitoring requirements and scenarios.
Type of change
Checklist