xymonping - Xymon ping tool
xymonping [--retries=N] [--timeout=N] [IP-addresses]
xymonping(1) is used for ping testing of the hosts monitored by the xymon(7) monitoring system. It reads a list of IP addresses from stdin, and performs a "ping" check to see if these hosts are alive. It is normally invoked by the xymonnet(1) utility, which performs all of the Xymon network tests.
Optionally, if a list of IP-addresses is passed as command-line arguments, it will ping those IP's instead of reading them from stdin.
xymonping only handles IP-addresses, not hostnames: IPv4, or IPv6 with a link-local address given as address%interface. An IPv6 host is reported with its address as it was given, so that the caller finds it under the spelling it used.
xymonping was inspired by the fping(1) tool, but has been written from scratch to implement a fast ping tester without much of the overhead found in other such utilities. The output from xymonping is similar to that of "fping -Ae".
xymonping probes multiple systems in parallel, and the runtime is therefore mostly dependent on the timeout-setting and the number of retries. With the default options, xymonping takes approximately 18 seconds to ping all hosts (tested with an input set of 1500 IP addresses).
xymonping needs to send and receive ICMP Echo (ping) packets. IPv6 addresses are pinged on a second socket, for ICMPv6, opened only when the list holds one. When one of the two sockets cannot be opened, its hosts are reported as unreachable and the others are still pinged.
For each, xymonping first tries an unprivileged ICMP socket (SOCK_DGRAM). Linux allows one to a user whose group is inside the net.ipv4.ping_group_range sysctl; many distributions set that range to cover every group. To allow it everywhere:
sysctl -w net.ipv4.ping_group_range="0 2147483647"
If that socket is refused, xymonping falls back to a raw socket, which needs root: install xymonping suid-root. It drops root privileges immediately, and only regains them to open the raw socket; no user-supplied or network data is handled while privileged.
File capabilities work as well: setcap cap_net_raw+ep on the binary lets xymonping open the raw socket without being suid-root.