net/mwan3: add logging on ping success and fail
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 21 Mar 2018 13:13:57 +0000 (14:13 +0100)
committerYousong Zhou <yszhou4tech@gmail.com>
Sun, 8 Apr 2018 08:20:24 +0000 (16:20 +0800)
Add logging information during state change on ping success or fail

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/mwan3/files/usr/sbin/mwan3track

index e8080b59c02772c0b56c0378ea472ae10209acfc..fb72e99a3fdf4cc1bbdd28b421e833e00b600361 100755 (executable)
@@ -117,9 +117,15 @@ main() {
                                if [ $? -eq 0 ]; then
                                        let host_up_count++
                                        echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
+                                       if [ $score -le $up ]; then
+                                               $LOG info "Check ($track_method) success for target \"$track_ip\" on interface $1 ($2)"
+                                       fi
                                else
                                        let lost++
                                        echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
+                                       if [ $score -gt $up ]; then
+                                               $LOG info "Check ($track_method) failed for target \"$track_ip\" on interface $1 ($2)"
+                                       fi
                                fi
                        else
                                echo "skipped" > /var/run/mwan3track/$1/TRACK_${track_ip}