I have an embedded Linux/Busybox system that needs to monitor its own network connectivity. I'm trying to figure out if the device is "all alone" on the network for more than say 10 minutes, and take corrective action if it is. The system may be in a physically inaccessible location.
I'm mostly looking for a general solution to detect gross failures, e.g. the system is getting zero network traffic. Our server can monitor specific ports on its own.
The rootfs is rapidly approaching its maximum size of 16MB, so many common applications are not an option, e.g.
tcpdump would put us over the 16MB limit.
Here are my ideas:
- Some entry in
/proc/netmight indicate the time of the last TCP or UDP packet
- Find any random peer on the network and try to ping them (is anybody out there listening???)
/sys/class/net/eth0/rx_packetsto see if the number is increasing
What is going to be most reliable?