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

request new option to support connectivity tests #99

Open
rlhamil opened this issue Aug 5, 2016 · 3 comments
Open

request new option to support connectivity tests #99

rlhamil opened this issue Aug 5, 2016 · 3 comments

Comments

@rlhamil
Copy link

rlhamil commented Aug 5, 2016

I'd like to see a new option to change the return code behavior from the default, so that if ANY host pings succeeded, the return code would be zero, even if not all succeeded or some IP lookups failed. Alternatively, a more generic option could take a numeric argument, and in addition to the above behavior, would randomly pick that number (after address resolution?) of hosts to ping out of a larger (potentially much larger) list. That would allow scripts doing such things to be used by many people, yet spread the load to the point that they weren't effectively causing a DoS attack on any one host.

Say the new option was -x (not suggesting that, although it is unused); for the simpler implementation, something like
fping -x -q host1 host2 host3
would return zero if any of the three was resolvable and responded. For the more complicated approach,
fping -x 2 -q host1 ... host99
would pick two hosts out of those of the 99 that resolved or didn't need name resolution, and if either responded, would return zero.

@filbo
Copy link

filbo commented May 4, 2017

I came here to request this, so, since the request already exists I'll just "me too".

Application: in my case, I want to bring up NIS to my corporate network when and only when I have IP connectivity to at least one of the N YP servers. Connectivity could be via direct LAN, on-campus wifi, or VPN from any other sort of network anywhere. And of course Everything Sucks when YP is "up" but connectivity is severed, so it has to die quickly when connectivity goes down; and rise from the dead reasonably quickly when connection is established.

fping, or even regular ping, already provides the needed functionality. A "tell me if any of these hosts are reachable" exit status is just a triviality to make scripting slightly easier. But still.

Seems like a generic "cause service P to be alive whenever any host in set Q is reachable (and not-alive when not, with some sort of tunable latency / hysteresis)" daemon should already exist; maybe I just need someone to remind me of its name?

@auerswal
Copy link
Collaborator

auerswal commented Jan 9, 2024

This feature seems to be available in fping, using the option -x, --reachable.
@rlhamil: Can this issue be closed?

@rlhamil
Copy link
Author

rlhamil commented Jan 9, 2024 via email

auerswal added a commit to auerswal/fping that referenced this issue Jan 10, 2024
With the options -x and -X, fping does not require all hosts to
be reachable for an exit status of 0.

This addresses a comment in issue schweikert#99 suggesting such a man page
update.
schweikert pushed a commit that referenced this issue Feb 4, 2024
With the options -x and -X, fping does not require all hosts to
be reachable for an exit status of 0.

This addresses a comment in issue #99 suggesting such a man page
update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants