# Parameters to monitor Internet gateway connectivity
#
# ICMP Ping
# Internet Gateway ping timings, can be used to measure "Internet Line Quality"
UserParameter=ipfire.net.gateway.pingtime,sudo /usr/sbin/fping -c 3 gateway 2>&1 | tail -n 1 | awk '{print $NF}' | cut -d '/' -f2
# Internet Gateway availability, can be used to check Internet connection
UserParameter=ipfire.net.gateway.ping,sudo /usr/sbin/fping -q -r 3 gateway; [ ! $? == 0 ]; echo $?
# ARP Ping
# Internet Gateway ping timings, can be used to measure "Internet Line Quality" when ICMP ping is not available
UserParameter=ipfire.net.gateway.arpingtime,sudo /usr/sbin/arping -i red0 -c 3 gateway | awk 'match($0, /time=([0-9\.]+) (\w+)$/, arr) { n++; if (arr[2] == "usec") { arr[1]/=1000; }; sum+=arr[1] } END { print sum / n }'
# Internet Gateway availability, can be used to check Internet connection when ICMP ping is not available
UserParameter=ipfire.net.gateway.arping,sudo /usr/sbin/arping -q -c 3 gateway; [ ! $? == 0 ]; echo $?
