The example below is an example using bosh-lite
- Go on to a gorouter VM
$ bosh ssh router_z1
- Get the user, password info for the gorouter status endpoint
$ head /var/vcap/jobs/gorouter/config/gorouter.yml
---
status:
port: 8080
user: router
pass: "router"
- Fetch the routes info and dump to temp file
$ curl -s http://router:[email protected]:8080/routes | json_pp > routes-temp.json
Note: in the above "router:router" is the username / password in previous step. The ip address is the address that the gorouter is listening on, typically the well known IP address (not localhost or 127.0.0.1).
- View route info in file Open the file and search for the route your are looking for.
$ less routes-temp.json
For example: "proxy.bosh-lite.com"
. . .
"blobstore.bosh-lite.com" : [
{
"ttl" : 0,
"address" : "10.244.0.130:8080"
}
],
"proxy.bosh-lite.com" : [
{
"ttl" : 0,
"address" : "10.244.16.14:60002"
},
{
"ttl" : 0,
"address" : "10.244.16.14:60004"
}
],
"api.bosh-lite.com/networking" : [
{
. . .
I can't get it to run the command, but I did take the time to do this...
echo curl -s http://`head /var/vcap/jobs/gorouter/config/gorouter.yml| awk '/user: /{print $2}'`:`head /var/vcap/jobs/gorouter/config/gorouter.yml| awk '/pass: /{print $2}'`@`netstat -an|grep LISTEN |awk '/8080/ {print $4}'`/routes