From 2a22b514cc33c0352b9b1f0f77e3b18b08e325c2 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 3 Oct 2012 18:29:49 +0200 Subject: [PATCH] retrieve individual stats with ovs-vsctl instead of parsing the whole line --- planetlab/scripts/sliver-ovs.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in index 2a95797ad..9af130e10 100755 --- a/planetlab/scripts/sliver-ovs.in +++ b/planetlab/scripts/sliver-ovs.in @@ -271,9 +271,8 @@ function gmap_report_once () { iface=$1; shift hostname=$1; shift linkid=$1; shift - report=$(ovs-vsctl get interface $iface statistics) - rx_bytes=$(echo $report | sed -e 's/^.*rx_bytes=//' -e 's/,.*$//') - tx_bytes=$(echo $report | sed -e 's/^.*tx_bytes=//' -e 's/,.*$//') + rx_bytes=$(ovs-vsctl get interface $iface statistics:rx_bytes) + tx_bytes=$(ovs-vsctl get interface $iface statistics:tx_bytes) rx_bits=$(($rx_bytes*8)) tx_bits=$(($tx_bytes*8)) now=$(date +%s).$(date +%N) -- 2.43.0