From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Fri, 5 Oct 2012 11:46:45 +0000 (+0200)
Subject: make gmap-probes
X-Git-Tag: sliver-openvswitch-1.8.90-5~17
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=329e9f423619177b33174b1704f1702da3a01c1f;p=sliver-openvswitch.git

make gmap-probes
---

diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile
index 8f5f29c31..98a6af1dd 100644
--- a/planetlab/exp-tool/Makefile
+++ b/planetlab/exp-tool/Makefile
@@ -295,6 +295,23 @@ graph.dot:
 graph.ps: graph.dot
 	dot -Tps < $^ > $@	
 
+####################
+# googlemap stuff
+# Uses:
+# GMAP_SERVER, the hostname that runs an ndnmap instance
+# GMAP_PROBES, a list of tuples of the form
+# <linkid>=<nodeid>=<internal_linkid>=<frequency>
+# e.g.
+# SENDER-MUX=SENDER=3=0.5
+# which would mean, the link 'SENDER-MUX' should be monitored at the 'SENDER' node and is coded 
+# in links.json with id=3, every half second
+# sliver-ovs gmap-report is designed to run in background,
+# and so that a new run will kill any previously running instance
+gmap-probes: $(foreach probe,$(GMAP_PROBES),gprobe-$(probe))
+
+gprobe-%: FORCE
+	$(SSH) -n $(call solve,$(word 2,$(subst @, ,$(*F)))) $(SUDO) \
+	sliver-ovs gmap-report L$(word 1,$(subst @, ,$(*F))) $(GMAP_SERVER) $(word 3,$(subst @, ,$(*F))) $(word 4,$(subst @, ,$(*F)))
 
 ####################
 # 'virtual' targets in that there's no real file attached
diff --git a/planetlab/exp-tool/Makefile.help b/planetlab/exp-tool/Makefile.help
index cab6c7948..a7d618237 100644
--- a/planetlab/exp-tool/Makefile.help
+++ b/planetlab/exp-tool/Makefile.help
@@ -62,3 +62,8 @@ make stop
 make status
         list status of db and switch processes in all slivers
 ====================
+make gmap-probes
+	Uses GMAP_SERVER and GMAP_PROBES to run probes in selected slivers
+	that can update a googlemap server for animating link speeds
+	This of course is mostly a demo thing, based on a one-host ndnmap deployment for now
+====================
diff --git a/planetlab/exp-tool/conf.mk.example b/planetlab/exp-tool/conf.mk.example
index c554a805b..e2fdaf832 100644
--- a/planetlab/exp-tool/conf.mk.example
+++ b/planetlab/exp-tool/conf.mk.example
@@ -38,5 +38,3 @@ LINKS += MUX-END1
 LINKS += MUX-END2
 
 ####################
-
-
diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in
index d58c1d2d1..c65d0d390 100755
--- a/planetlab/scripts/sliver-ovs.in
+++ b/planetlab/scripts/sliver-ovs.in
@@ -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