var sys = require('sys')
var exec = require('child_process').exec;
var child;
- child = exec("cd /home/pi && echo iperf > fifo", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && echo iperf > fifo", function(error, stdout, stderr) {
console.log("pingall");
res.send(stdout);
});
var sys = require('sys')
var exec = require('child_process').exec;
var child;
- child = exec("cd /home/pi && echo pingall > fifo", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && echo pingall > fifo", function(error, stdout, stderr) {
console.log("pingall");
res.send(stdout);
});
var sys = require('sys')
var exec = require('child_process').exec;
var child;
- child = exec("cd /home/pi && echo placement > fifo", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && echo placement > fifo", function(error, stdout, stderr) {
console.log("placement");
res.send(stdout);
});
var sys = require('sys')
var exec = require('child_process').exec;
var child;
- child = exec("cd /home/pi && cat aichivo 2>&1", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && cat aichivo 2>&1", function(error, stdout, stderr) {
console.log("getting vsorc data");
res.send(stdout);
});
var sys = require('sys')
var exec = require('child_process').exec;
var child;
- child = exec("cd /home/pi && cat controllerout 2>&1", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && cat controllerout 2>&1", function(error, stdout, stderr) {
console.log("getting controller data");
res.send(stdout);
});
var child;
//cd /home/pi && setsid $(cat /home/pi/ejecutarcontroller.sh | grep sudo) >/dev/null 2>&1 < /dev/null &
//cd /home/pi && ./ejecutarcontroller.sh > /dev/null 2>&1 < /dev/null & //comando anterior
- child = exec("cd /home/pi && touch controllerout && ./ejecutarcontroller.sh > controllerout 2>&1 &", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && touch controllerout && ./ejecutarcontroller.sh > controllerout 2>&1 &", function(error, stdout, stderr) {
console.log("controller started");
res.send(stdout);
});
var sys = require('sys')
var exec = require('child_process').exec;
var child;
- child = exec("cd /home/pi && rm controllerout && sudo kill $(ps aux | grep python | grep ryu | awk {'print $2'})", function(error, stdout, stderr) {
+ child = exec("cd /home/pi/scripts && rm controllerout && sudo kill $(ps aux | grep python | grep ryu | awk {'print $2'})", function(error, stdout, stderr) {
console.log("controller stopped");
res.send(stdout);
});
request = JSON.parse(req.query.topology)
console.log("Topology is : \n"+ request);
//controlar que solo se haga un arranque por vez y agregar el exec 3>fifo
- child0 = exec("cd /home/pi && echo \""+request+"\" > data", function(error, stdout, stderr) {
+ child0 = exec("cd /home/pi/scripts && echo \""+request+"\" > data", function(error, stdout, stderr) {
console.log(stdout + stderr);
answer+=stdout;
});
- child1 = exec("cd /home/pi && mkfifo fifo && touch aichivo", function(error, stdout, stderr) {
+ child1 = exec("cd /home/pi/scripts && mkfifo fifo && touch aichivo", function(error, stdout, stderr) {
console.log(stdout + stderr);
answer+=stdout;
});
- child2 = exec("exec 3>fifo", function(error, stdout, stderr) {
+ child2 = exec("cd /home/pi/scripts && exec 3>fifo", function(error, stdout, stderr) {
console.log(stdout + stderr);
answer+=stdout;
});
//child3 uses tail so it can read from fifo even after a EOF
- child3 = exec("cd /home/pi && tail -n +1 -f fifo | sudo ./clusterGRE.py > aichivo 2>&1 &", function(error, stdout, stderr) {
+ child3 = exec("cd /home/pi/scripts && tail -n +1 -f fifo | sudo ./clusterGRE.py > aichivo 2>&1 &", function(error, stdout, stderr) {
console.log(stdout + stderr);
answer+=stdout;
});
var child3;
var payload
console.log("erasing...");
- child1 = exec("cd /home/pi && exec 3>&- && rm fifo && rm aichivo", function(error, stdout, stderr) {
+ child1 = exec("cd /home/pi/scripts && exec 3>&- && rm fifo && rm aichivo", function(error, stdout, stderr) {
console.log(stdout);
payload+="rm done\n\n"+stdout;
payload+="killed\n\n"+stdout;
});
console.log("Multisshing and cleaning...");
- child3 = exec("cd /home/pi && ./multissh.sh sudo -E mn -c; sudo -E mn -c", function(error, stdout, stderr) {
+ child3 = exec("cd /home/pi/scripts && ./multissh.sh sudo -E mn -c; sudo -E mn -c", function(error, stdout, stderr) {
console.log(stdout);
console.log("multisshed");
payload+="Multisshed\n\n"+stdout;
<button type="button" name="button" onclick="pingall()">Ping all</button>
<button type="button" name="button" onclick="placement()">Placement</button>
<button type="button" name="button" onclick="iperf()">Iperf3</button>
+ <button type="button" name="button" onclick="net()">net</button>
+ <button type="button" name="button" onclick="nodes()">nodes</button>
+ <button type="button" name="button" onclick="status()">status</button>
</div>
</div>
let intervalController = null;//Para tener el id del interval para obtener data del controller
let intervalVsorc = null; //Para tener el id del interval para obtener data del vsorc
+ intervalVsorc = setInterval(getvsorcdata, timeVsorc);
+ intervalController=setInterval(getcontrollerdata, timeController);
+
function startcontroller() {
let xhr = new XMLHttpRequest();
xhr.open('GET', '/startcontroller', true);
}
}
xhr.send();
- intervalController=setInterval(getcontrollerdata, timeController);
+
}
function stopcontroller() {
}
}
xhr.send();
- clearInterval(intervalController);
+ //clearInterval(intervalController);
controllerout.value='';
}
function getcontrollerdata() {
}
}
xhr.send();
- intervalVsorc = setInterval(getvsorcdata, timeVsorc);
+
}
function stopvsorc() {
}
}
xhr.send();
- clearInterval(intervalVsorc);
+ //clearInterval(intervalVsorc);
vsorcout.value='';
}