Skip to content
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

Enhanced ping monitor with advanced options (count, timeout, numeric) #5588

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

filippolauria
Copy link

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
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]:

  • I have read and understand the pull request rules.

Description

This PR enhances ping monitoring capabilities by introducing advanced configuration options that give users more control over ping behavior:

  • Max Packets (count): Specify how many packets to send before stopping
  • Maximum Duration (deadline): Set total time limit for the ping operation
  • Response Timeout (timeout): Control how long to wait for each packet response
  • Numeric Output (numeric): Choose between IP addresses or hostnames in ping output

These options match the standard ping command features, making the monitoring system more flexible and suitable for different network scenarios. Each option has been implemented with proper validation boundaries and default values.

This PR is kinda related to issue #5552

Type of change

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

image

Sorry, something went wrong.

filippolauria and others added 10 commits January 31, 2025 13:51
…vior:

- ping_count: number of packets to send
- ping_deadline: maximum total duration
- ping_timeout: time to wait for each response
- ping_numeric: output IP addresses instead of hostnames
Added MIN/MAX/DEFAULT constants for:
- ping count
- ping deadline
- ping timeout
- and packet size, too.
…dation using ping MIN/MAX constants in monitor
- Added advanced parameters (count, deadline, timeout)
- Updated parameter names for clarity
- Used constants for default values
- Improved method and parameter documentation
Added form fields to configure:
- packet count
- timeout
- deadline
- numeric output option
in monitor creation/edit view
@filippolauria
Copy link
Author

Hi @louislam and other mainteiners!

Just checking in on this PR.

All checks are passing and I'm happy to address any feedback or concerns you might have.

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a quick glance over the code and commented where things need a bit more work.
Seems overall reasonable to me.
I have not had time to properly test that all code works as advertised ^^.

I don't like how messy the code for EditMonitor is becoming and that whole verifying parameters 2x and in different places is not great..
This is not your fault and should not be fixed in this PR.

You also stumbled into the big old_migrations pit.. sorry for that

@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label Feb 16, 2025
@dredvard
Copy link

dredvard commented Feb 22, 2025

Does this pr have the ability to satisfuy this feature request?

@filippolauria
Copy link
Author

@dredvard This PR maps some advanced options (-c, -n, -w, -W, as referenced in the ping manual) into the graphical interface. Of course, these options have always been available in the ping tool but were never included in the UI until now (hopefully).

@CommanderStorm CommanderStorm added pr:needs review this PR needs a review by maintainers or other community members and removed pr:please address review comments this PR needs a bit more work to be mergable labels Mar 4, 2025
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still not happy with the third timeout field. This is not something that requires being "special" => let's not be special

@filippolauria
Copy link
Author

@CommanderStorm ,
I have removed the deadline field and changed the existing timeout field to represent a global timeout (ping's -w option). Also, I have introduced the ping_per_request_timeout field for individual ICMP echo request timeout (ping's -W option).

@CommanderStorm CommanderStorm added pr:depends on other pending other things to be done first and removed pr:needs review this PR needs a review by maintainers or other community members labels Mar 24, 2025
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my side then.

@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:depends on other pending other things to be done first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants