Dynamic Network Map

I have been working on a network map that shows the current reachability of my network devices.

The map is created using d3 (which fortunately is already available in node-red/dashboard).

One inject node describes the complete topology of the network, in basic form:

{
  "name": "Internet",
  "properties": {
    "type": "ping",
    "reachable": false,
    "ip": "google.com"
  },
  "children": [
    {
      "name": "router",
      "properties": {
        "type": "ping",
        "reachable": false,
        "ip": "192.168.1.1"
      }
    }
  ]
}

Default all devices should be set to false and it is injected as global object upon deploy, after which the flow will ping all the ip's it find in the topology, once every 30 seconds and updates the map. Using a http endpoint the global object will be retrieved in the map (will need some additional d3 work to only update the nodes instead of a refresh)

The topology can have many levels of depth.

The 'type' describes the type of check that will be done when a node is clicked. Currently, either ping or tasmota.
When the node is clicked, it will execute either a ping for 4 times and outputs the rtt/packetloss.

If it is tasmota, it will get the status 0 command from the tasmota device via http (note; if user/pass is used on tasmota device, the flow will need modifications), it will display the uptime/version/ssid/RSSI, can ofcourse all be customized. The ip address can be clicked to go to the device in a new tab/window.

Try it if you like :slight_smile:

Pending topic to remove the background from the "group" to make it transparent.

Flow

7 Likes

Hi Backman, looks very interesting.

I tried but alas it doesnt work on windows (ping format & grep are two immediate issues).

question: why use a cmd for pinging and not the PING node?

Perhaps a flag (indicating OS) could be employed?

Then if set for if windows, use a pipe and FINDSTR instead of grep?

(of course I am assuming something - you may rightly not give a monkeys about windoze :wink: )

question: why use a cmd for pinging and not the PING node?

Because it requires a node that is not included out of the box.

I tried but alas it doesnt work on windows

I will make a note that it is linux only and modify it to your liking :wink:

Then i guess we need to convince Dave & Nick to put the ping node in the default install :slight_smile: (it is maintained by Dave in the node-red repo after all)

Umm that would be counter productive since my "liking" is to support windows too :slight_smile:

it is already in the Pi default install...(due to history) - just not the generic default install as well... meh...

Slip it in to the default install Dave (ping is pretty much ubiquitous) :crossed_fingers:

only if you play with networks

2 Likes

This topic was automatically closed after 60 days. New replies are no longer allowed.