Often, in applications that I develop, I like to include a network status indicator for various devices on the network. The easiest way to monitor these devices is by pinging them. But ICMP echoes are often difficult to integrate into an application due to security requirements with raw sockets, or performance issues with shelling out to ping
. Also, for situations where this isn't a problem, I'm kind of over writing slightly different variations of the same ping code for various situations.
Most of the devices that I monitor are embedded devices with minimal network capabilities (but always include ICMP echo), so I do have to stick with this protocol, things like Echo Protocol (pointed out by Mark in comments below, thanks!) usually aren't available to me.
Is there a service that already exists that can provide low-overhead ICMP ping services to a non-root application?
I am considering writing a service that runs as root and allows other non-root applications to connect to it, add devices to monitor, and then query ping times and network status from it, but I don't want to reinvent a wheel and I'm wondering if something like this exists already.
ping
command itself. It has options to make it silent, and then you can just check the termination status to see if it was successful or not.