So, I decided that it would be easier to simply send the raw output of the shell to the fronted and do the parsing in JS. This way the person working on the dashboard can work on this component with JS skills + minimal shell knowledge instead of having to learn Go or awk or whatever. Here's a preliminary commit:

https://github.com/sudomesh/peoplesopen-dash/commit/d50c7a5602411f27a7d6bf51028ac497caa425c6

On Wed, Jan 25, 2017 at 3:44 AM, Nemesis <nemesis@ninux.org> wrote:
There are two potential projects on the Freifunk GSOC 2017 ideas list:

-
https://wiki.freifunk.net/Ideas#Implement_NetJSON_DeviceMonitoring_in_ubus_.28OpenWRT.2FLEDE.29
- https://wiki.freifunk.net/Ideas#LibreMesh_NetJSON_Agent

I believe some code from Wlan Slovenia can be reused for this purpose
(NetJSON DeviceMonitoring was guided and inspired by their suggestions):

https://github.com/wlanslovenija/nodewatcher-agent#monitoring-report-format

But we'll have to wait to see if we get accepted as Freifunk.

Federico


On 01/24/2017 05:40 PM, Jehan Tremback wrote:
> This NetJSON looks pretty good. Should be pretty easy to rename some
> fields to conform to it. Looks like we could get some nice
> visualizations for free if we do
> this: https://github.com/netjson/netjsongraph.js
>
> We'll have to add some other info to the data as well though to support
> the full functionality of the routers.
>
> On Tue, Jan 24, 2017 at 1:22 AM, Nemesis <nemesis@ninux.org
> <mailto:nemesis@ninux.org>> wrote:
>
>     Have you guys looked at http://netjson.org/ ?
>
>     There are a few visualizers implemented already:
>     http://netjson.org/docs/implementations.html#network-topology-visualizers
>     <http://netjson.org/docs/implementations.html#network-topology-visualizers>
>
>     Federico
>
>     On 01/24/2017 03:30 AM, Marc Juul wrote:
>     > Alright! I hadn't considered go but as long as it compiles to the
>     > processor on the routers we use then that does simplify things quite a
>     > bit :)
>     >
>     > On Mon, Jan 23, 2017 at 6:19 PM, Jehan Tremback
>     > <jehan.tremback@gmail.com <mailto:jehan.tremback@gmail.com>
>     <mailto:jehan.tremback@gmail.com <mailto:jehan.tremback@gmail.com>>>
>     wrote:
>     >
>     >     Oh yea, here's what it outputs right now:
>     >
>     >     {
>     >        "Interfaces":{
>     >           "eth0":{
>     >              "Neighbors":{
>     >                 "10.0.0.2":{
>     >                    "Routes":{
>     >                       "10.0.0.2":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.2",
>     >                          "Destination":"10.0.0.2"
>     >                       },
>     >                       "10.0.0.6":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.2",
>     >                          "Destination":"10.0.0.6"
>     >                       }
>     >                    }
>     >                 },
>     >                 "10.0.0.3":{
>     >                    "Routes":{
>     >                       "10.0.0.1":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.3",
>     >                          "Destination":"10.0.0.1"
>     >                       },
>     >                       "10.0.0.3":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.3",
>     >                          "Destination":"10.0.0.3"
>     >                       },
>     >                       "10.0.1.0/24 <http://10.0.1.0/24>
>     <http://10.0.1.0/24>":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.3",
>     >                          "Destination":"10.0.1.0/24
>     <http://10.0.1.0/24> <http://10.0.1.0/24>"
>     >                       },
>     >                       "10.0.1.2":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.3",
>     >                          "Destination":"10.0.1.2"
>     >                       },
>     >                       "default":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.3",
>     >                          "Destination":"default"
>     >                       }
>     >                    }
>     >                 },
>     >                 "10.0.0.5":{
>     >                    "Routes":{
>     >                       "10.0.0.5":{
>     >                          "Protocol":"babel",
>     >                          "Interface":"eth0",
>     >                          "Neighbor":"10.0.0.5",
>     >                          "Destination":"10.0.0.5"
>     >                       }
>     >                    }
>     >                 }
>     >              }
>     >           }
>     >        }
>     >     }
>     >
>     >     On Mon, Jan 23, 2017 at 6:15 PM, Jehan Tremback
>     >     <jehan.tremback@gmail.com <mailto:jehan.tremback@gmail.com>
>     <mailto:jehan.tremback@gmail.com <mailto:jehan.tremback@gmail.com>>>
>     wrote:
>     >
>     >         As part of the new node dashboards, we need to gather info from
>     >         the nodes and pass it to the frontend dashboard app. There were
>     >         some shell scripts but they weren't very complete and I couldn't
>     >         find them yesterday, so I sat down to learn awk. Awk is very
>     >         graceful for parsing data out of text, but I found it cumbersome
>     >         generating json from the data in its memory.
>     >
>     >         SO I just did it with Go. Go compiles to machine code that will
>     >         run easily on the routers (unlike js). Also, it will be good for
>     >         doing other things to build up the data, like pinging endpoints
>     >         etc. Here is the repo: https://github.com/sudomesh/node-info-go
>     <https://github.com/sudomesh/node-info-go>
>     >         <https://github.com/sudomesh/node-info-go
>     <https://github.com/sudomesh/node-info-go>>
>     >
>     >         I will be at the meeting tomorrow to talk about how to harvest
>     >         the rest of the data we need to build a full dashboard.
>     >
>     >         -Jehan
>     >
>     >
>     >
>     >     _______________________________________________
>     >     mesh mailing list
>     >     mesh@lists.sudoroom.org <mailto:mesh@lists.sudoroom.org>
>     <mailto:mesh@lists.sudoroom.org <mailto:mesh@lists.sudoroom.org>>
>     >     https://sudoroom.org/lists/listinfo/mesh
>     <https://sudoroom.org/lists/listinfo/mesh>
>     >     <https://sudoroom.org/lists/listinfo/mesh
>     <https://sudoroom.org/lists/listinfo/mesh>>
>     >
>     >
>     >
>     >
>     > _______________________________________________
>     > mesh mailing list
>     > mesh@lists.sudoroom.org <mailto:mesh@lists.sudoroom.org>
>     > https://sudoroom.org/lists/listinfo/mesh
>     <https://sudoroom.org/lists/listinfo/mesh>
>     >
>
>
>