Deep Dive into Eve-ng === ## 動作をトレースする ます、各IOLは ``` /opt/unetlab/addons/iol/bin/L3-ADVENTERPRISEK9.bin -e 1 -s 0 -n 256 -q -m 512 -c startup-config 160 ``` などで立ち上がる。 /opt/unetlab/data/Logs/access.logにはWebのログが出てくる。REST APIのトレースができる。 ``` 192.168.9.1 - - [01/Nov/2017:15:02:54 +0200] "GET /api/labs/Lab1.unl/nodes/10/stop?_=1509541061739 HTTP/1.1" 200 362 "http://192.168.9.192/legacy/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" ``` みたいなかんじ。 ## API ``` curl -c cookies.txt -i -X POST -d '{"username":"admin","password":"eve", "html5" :"-1"}' http://127.0.0.1/api/auth/login ; echo curl -b cookies.txt -X GET http://127.0.0.1/api/folders/ | python -m json.tool curl -b cookies.txt -X GET http://127.0.0.1/api/labs/Lab1.unl/nodes | python -m json.tool" :"-1"}' http://127.0.0.1/api/auth/login ; echo 大切なものを抜粋> "11": { "config": "1", "id": 11, "name": "R15", "nvram": 256, "ram": 512, "url": "telnet://127.0.0.1:32779" ★ここがリスト }, ``` ## all start時にdelayを入れれる ``` root@eve-ng:/opt/unetlab# diff -ruN /opt/unetlab/html.orig /opt/unetlab/html diff -ruN /opt/unetlab/html.orig/themes/default/js/functions.js /opt/unetlab/html/themes/default/js/functions.js --- /opt/unetlab/html.orig/themes/default/js/functions.js 2017-08-18 01:11:16.000000000 +0300 +++ /opt/unetlab/html/themes/default/js/functions.js 2017-11-09 06:06:16.726374096 +0200 @@ -1864,7 +1864,7 @@ addMessage('danger', nodes[Object.keys(nodes)[i]]['name'] + ': ' + MESSAGES[76] + 'failed'); } if (i > 0) { - recursive_start(nodes, i); + setTimeout(recursive_start(nodes, i), 500); } else { addMessage('info', 'Start All: done'); } ```