make gmap-probes
[sliver-openvswitch.git] / planetlab / scripts / sliver-ovs.in
index 08bef1c..c65d0d3 100755 (executable)
@@ -271,8 +271,8 @@ function gmap_report_once () {
     iface=$1; shift
     hostname=$1; shift
     linkid=$1; shift
-    rx_bytes=$(ovs-vsctl get interface $iface statistics:rx_bytes)
-    tx_bytes=$(ovs-vsctl get interface $iface statistics:tx_bytes)
+    rx_bytes=$(ovs-appctl netdev-tunnel/get-rx-bytes $iface)
+    tx_bytes=$(ovs-appctl netdev-tunnel/get-tx-bytes $iface)
     rx_bits=$(($rx_bytes*8))
     tx_bits=$(($tx_bytes*8))
     now=$(date +%s).$(date +%N)
@@ -295,6 +295,9 @@ function gmap_report () {
        [ -n "$pid" ] && kill $pid >& /dev/null
        rm $pid_file
     fi
+    # close std fds so that ssh invokations can return
+    exec <&-
+    exec >&-
     while true; do
        gmap_report_once $iface $hostname $linkid
        sleep $looptime