* [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output
@ 2015-09-28 16:56 Germano Massullo
2015-09-28 17:35 ` Simon Wunderlich
0 siblings, 1 reply; 6+ messages in thread
From: Germano Massullo @ 2015-09-28 16:56 UTC (permalink / raw)
To: b.a.t.m.a.n
I created three Fedora virtual machines to get some alfred jsondoc
format output. I followed [1] and [2] but I edited some commands because
virtual machines obviously do not own wireless network interfaces. Since
it is the first time I use batman+alfred I want to show you the entire
list of commands (that have been runned on all the virtual machines.) I
used before asking my question
# ip link set dev enp0s3 mtu 1532
# batctl if add enp0s3
# ip link set bat0 up
# alfred -i enp0s3 -m
The # ip addr of all virtual machines is [3]
Then I opened a new console
# cat /etc/hostname | alfred -s 65
# alfred -r 65
then I got [4] as the Examples paragraph [2] suggested
# batadv-vis --format=jsondoc
and I got [5]
Question: do you have any suggestion how I can extend the jsondoc
output, to get an output similar to [6]?
Thank you for your time
[1] http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide
[2] http://downloads.open-mesh.org/batman/manpages/alfred.8.html
[3] http://i.imgur.com/IR9pSJg.jpg
[4] http://i.imgur.com/hEP4oV7.jpg
[5] http://i.imgur.com/Tb1hRHl.jpg
[6]
https://github.com/ninuxorg/netdiff/blob/master/tests/static/batman-1%2B1.json
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output
2015-09-28 16:56 [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output Germano Massullo
@ 2015-09-28 17:35 ` Simon Wunderlich
2015-09-28 21:10 ` Germano Massullo
0 siblings, 1 reply; 6+ messages in thread
From: Simon Wunderlich @ 2015-09-28 17:35 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]
On Monday 28 September 2015 18:56:11 Germano Massullo wrote:
> I created three Fedora virtual machines to get some alfred jsondoc
> format output. I followed [1] and [2] but I edited some commands because
> virtual machines obviously do not own wireless network interfaces. Since
> it is the first time I use batman+alfred I want to show you the entire
> list of commands (that have been runned on all the virtual machines.) I
> used before asking my question
>
> # ip link set dev enp0s3 mtu 1532
> # batctl if add enp0s3
> # ip link set bat0 up
> # alfred -i enp0s3 -m
>
> The # ip addr of all virtual machines is [3]
> Then I opened a new console
>
> # cat /etc/hostname | alfred -s 65
> # alfred -r 65
> then I got [4] as the Examples paragraph [2] suggested
Yup this looks good. :)
> # batadv-vis --format=jsondoc
> and I got [5]
This looks kind of incomplete - there are no neighbor information at all.
>
> Question: do you have any suggestion how I can extend the jsondoc
> output, to get an output similar to [6]?
I'd suggest to create a new output type (maybe call it netjson?) next to the
existing ones. If you look in the source code [1] You'll find a couple of
hooks which are prepared exactly for this purpose.
Thanks!
Simon
[1] http://git.open-mesh.org/alfred.git/blob/HEAD:/vis/vis.c#l724
>
> Thank you for your time
>
>
> [1] http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide
> [2] http://downloads.open-mesh.org/batman/manpages/alfred.8.html
> [3] http://i.imgur.com/IR9pSJg.jpg
> [4] http://i.imgur.com/hEP4oV7.jpg
> [5] http://i.imgur.com/Tb1hRHl.jpg
> [6]
> https://github.com/ninuxorg/netdiff/blob/master/tests/static/batman-1%2B1.js
> on
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output
2015-09-28 17:35 ` Simon Wunderlich
@ 2015-09-28 21:10 ` Germano Massullo
2015-09-28 23:24 ` Simon Wunderlich
0 siblings, 1 reply; 6+ messages in thread
From: Germano Massullo @ 2015-09-28 21:10 UTC (permalink / raw)
To: b.a.t.m.a.n
Il 28/09/2015 19:35, Simon Wunderlich ha scritto:
>
>> # batadv-vis --format=jsondoc
>> and I got [5]
> This looks kind of incomplete - there are no neighbor information at all.
I would like to debug this thing. Virtual machines firewall have been
deactivated. I don't understand why
# alfred -r 65
returns a correct output about the three nodes and instead the jsondoc
output only mentions one node...
>> Question: do you have any suggestion how I can extend the jsondoc
>> output, to get an output similar to [6]?
> I'd suggest to create a new output type (maybe call it netjson?) next to the
> existing ones. If you look in the source code [1] You'll find a couple of
> hooks which are prepared exactly for this purpose.
>
> Thanks!
> Simon
>
> [1] http://git.open-mesh.org/alfred.git/blob/HEAD:/vis/vis.c#l724
Thank you, I will check it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output
2015-09-28 21:10 ` Germano Massullo
@ 2015-09-28 23:24 ` Simon Wunderlich
2015-09-29 8:45 ` Germano Massullo
0 siblings, 1 reply; 6+ messages in thread
From: Simon Wunderlich @ 2015-09-28 23:24 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 708 bytes --]
On Monday 28 September 2015 23:10:44 Germano Massullo wrote:
> Il 28/09/2015 19:35, Simon Wunderlich ha scritto:
> >> # batadv-vis --format=jsondoc
> >> and I got [5]
> >
> > This looks kind of incomplete - there are no neighbor information at all.
>
> I would like to debug this thing. Virtual machines firewall have been
> deactivated. I don't understand why
> # alfred -r 65
> returns a correct output about the three nodes and instead the jsondoc
> output only mentions one node...
batadv-vis is also a daemon which must run in background to collect data from
batman-adv and push it (periodically) into alfred. Maybe you are not running
it but only used the client part to query?
Cheers,
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output
2015-09-28 23:24 ` Simon Wunderlich
@ 2015-09-29 8:45 ` Germano Massullo
2015-09-29 16:17 ` Germano Massullo
0 siblings, 1 reply; 6+ messages in thread
From: Germano Massullo @ 2015-09-29 8:45 UTC (permalink / raw)
To: b.a.t.m.a.n
Il 29/09/2015 01:24, Simon Wunderlich ha scritto:
> batadv-vis is also a daemon which must run in background to collect
> data from batman-adv and push it (periodically) into alfred. Maybe you
> are not running it but only used the client part to query? Cheers, Simon
Yeah that was the problem, thank you very much!
I attach again the whole and fixed procedure I followed, hoping that it
can be useful to other people. At the end of the e-mail you can find
also the jsondoc output I got.
1) Install a Fedora VirtualBox virtual machine;
2) In the virtual machine VirtualBox settings, set the network interface
in bridge mode;
3) Clone two times the virtual machine, enabling the "re-initialise MAC
addresses" option;
4) Start them and then run the following commands on each of them:
Maybe not required, but to avoid all possible problems, I also
disabled the firewall
# systemctl disable firewalld; systemctl stop firewalld
# dnf -y install batctl
then download and install alfred from git source code (certain
guides show alfredadv-vis , I instead got batadv-vis)
# ip link set dev enp0s3 mtu 1532
# batctl if add enp0s3
# ip link set bat0 up
# alfred -i enp0s3 -m
Then I opened a new console (tty2)
# cat /etc/hostname | alfred -s 65
# batadv-vis -s
Then I opened a new console (tty3)
# cat /etc/hostname | alfred -s 65
# alfred -r 65 (note: this one will show the info sent from the
three nodes only if you entered the previous command on all the VMs)
# batadv-vis --format=jsondoc
And here we go!
{
"source_version" : "2015.1-2-g4384c2b",
"algorithm" : 4,
"vis" : [
{ "primary" : "08:00:27:8f:b1:c2",
"neighbors" : [
{ "router" : "08:00:27:8f:b1:c2",
"neighbor" : "08:00:27:a9:8d:af",
"metric" : "1.000" },
{ "router" : "08:00:27:8f:b1:c2",
"neighbor" : "08:00:27:83:e5:59",
"metric" : "1.000" }
],
"clients" : [
"33:33:00:00:00:01",
"33:33:ff:f4:13:fb",
"d6:ba:c2:f4:13:fb",
"01:00:5e:00:00:01"
]
},
{ "primary" : "08:00:27:83:e5:59",
"neighbors" : [
{ "router" : "08:00:27:83:e5:59",
"neighbor" : "08:00:27:a9:8d:af",
"metric" : "1.000" },
{ "router" : "08:00:27:83:e5:59",
"neighbor" : "08:00:27:8f:b1:c2",
"metric" : "1.016" }
],
"clients" : [
"1a:7c:e9:74:cc:47",
"33:33:00:00:00:01",
"33:33:ff:74:cc:47",
"01:00:5e:00:00:01"
]
},
{ "primary" : "08:00:27:a9:8d:af",
"neighbors" : [
{ "router" : "08:00:27:a9:8d:af",
"neighbor" : "08:00:27:8f:b1:c2",
"metric" : "1.000" },
{ "router" : "08:00:27:a9:8d:af",
"neighbor" : "08:00:27:83:e5:59",
"metric" : "1.004" }
],
"clients" : [
"4e:ae:15:0e:ba:a2",
"33:33:00:00:00:01",
"01:00:5e:00:00:01",
"33:33:ff:0e:ba:a2"
]
}
]
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output
2015-09-29 8:45 ` Germano Massullo
@ 2015-09-29 16:17 ` Germano Massullo
0 siblings, 0 replies; 6+ messages in thread
From: Germano Massullo @ 2015-09-29 16:17 UTC (permalink / raw)
To: b.a.t.m.a.n
Errata corrige: change
Then I opened a new console (tty3)
# cat /etc/hostname | alfred -s 65
in
Then I opened a new console (tty3)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-29 16:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 16:56 [B.A.T.M.A.N.] Suggestions to get extended jsondoc alfred output Germano Massullo
2015-09-28 17:35 ` Simon Wunderlich
2015-09-28 21:10 ` Germano Massullo
2015-09-28 23:24 ` Simon Wunderlich
2015-09-29 8:45 ` Germano Massullo
2015-09-29 16:17 ` Germano Massullo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox