make gmap-probes
[sliver-openvswitch.git] / planetlab / exp-tool / Makefile
index ba4f69a..98a6af1 100644 (file)
@@ -98,6 +98,9 @@ sshchecks: $(foreach id,$(ALL_NODE_IDS),sshcheck-$(id))
 .PHONY: sshchecks
 ovsversions: $(foreach id,$(ALL_NODE_IDS),ovsversion-$(id))
 .PHONY: ovsversions
+# more general form; run with  make sshs SSH-COMMAND="bla bla bla"
+sshs: $(foreach id,$(ALL_NODE_IDS),ssh-$(id))
+.PHONY: sshs
 
 DBS=$(foreach id,$(ALL_NODE_IDS),cache/db.$(id))
 dbs: $(DBS)
@@ -136,6 +139,9 @@ sshcheck-%: FORCE
 ovsversion-%: FORCE
        @OVSVERSION=$$($(SSH) $(HOST_$*) rpm -q sliver-openvswitch); echo $(call display,$*) has $$OVSVERSION
 
+ssh-%: FORCE
+       @$(SSH) $(HOST_$*) $(SUDO) $(SSH-COMMAND)
+
 # should probably replace sshcheck
 cache/status.%: FORCE
        @echo "=== DB and SWITCH processes on $(call display,$*)"
@@ -165,7 +171,7 @@ cache/controller.%: cache/bridge.%
 # xxx this probably needs a more thorough cleanup in cache/
 cache/stop.%: del-bridge.%
        @echo "Stopping switch & db on $(call display,$*)"
-       @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop && rm cache/switch.% cache/db.%
+       @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop && rm cache/switch.$* cache/db.$*
 
 ### link-oriented targets
 # L/<nodeid>-<node_id>
@@ -195,7 +201,7 @@ del-db.%:
        @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-db
        @rm -f cache/db.$*
 
-del-controller.%:
+del-controller-%:
        @echo "Removing controller for $(call display,$*)"
        @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-controller $(BRIDGE)
        @rm -f cache/controller.$*
@@ -289,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