-
Notifications
You must be signed in to change notification settings - Fork 249
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
Comments
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? |
This feature seems to be available in fping, using the option |
Yes, --reachable does what I had in mind.
The DIAGNOSTICS portion of the man page currently (at least for what I have installed, which may not be the very latest) says
Exit status is 0 if all the hosts are reachable, 1 if some hosts were
unreachable, 2 if any IP addresses were not found, 3 for invalid command
line arguments, and 4 for a system call failure.
Perhaps it should say
Exit statius is 0 if all the hosts are reachable or the number of hosts specified by --reachable are reachable, [etc]
just so one doesn't have to read the entire man page to discover the exception.
… On Jan 9, 2024, at 04:14, Erik Auerswald ***@***.***> wrote:
This feature seems to be available in fping, using the option -x, --reachable.
@rlhamil <https://github.com/rlhamil>: Can this issue be closed?
—
Reply to this email directly, view it on GitHub <#99 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABMF3PKYCAHWU64S43T5U53YNUDALAVCNFSM4CLWXZQ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBYGI3DONRYGY2Q>.
You are receiving this because you were mentioned.
|
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.
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.
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.
The text was updated successfully, but these errors were encountered: