OpenWISP Network Topology is a network topology collector and visualizer web application and API, it allows to collect network topology data from different networking software (dynamic mesh routing protocols, OpenVPN), store it, visualize it, edit its details, it also provides hooks (a.k.a Django signals) to execute code when the status of a link changes.
When used in conjunction with OpenWISP Controller and OpenWISP Monitoring, it makes the monitoring system faster in detecting change to the network.
This module is also available in docker-openwisp although its usage is not recommended for production usage yet, unless the reader is willing to invest effort in adapting the docker images and configurations to overcome any roadblocks encountered.
This module works by periodically collecting the network topology graph data of the supported networking software or formats. The data has to be either fetched by the application or received in POST API requests, therefore after deploying the application, additional steps are required to make the data collection and visualization work, read on to find out how.
Creating a topology
Create a topology object by going to Network Topology > Topologies > Add topology.
Give an appropriate label to the topology.
Select the topology format from the dropdown menu. The topology format determines which parser should be used to process topology data.
Select the Strategy for updating this topology.
If you are using FETCH strategy, then enter the URL for fetching topology data in the Url field.
If you are using RECEIVE strategy, you will get the URL for sending topology data. The RECEIVE strategy provides an additional field expiration time. This can be used to add delay in marking missing links as down.
Sending data for topology with RECEIVE strategy
Copy the URL generated by OpenWISP for sending the topology data.
E.g., in our case the URL is
Create a script (eg:
/opt/send-topology.sh) which sends the topology data using
POST, in the example script below we are sending the status log data of OpenVPN but the same code can be applied to other formats by replacing
cat /var/log/openvpn/tun0.statswith the actual command which returns the network topology output:
#!/bin/bash # Get OpenVPN topology data from OpenVPN management interface cat /var/log/openvpn/tun0.stats | # Upload the topology data to OpenWISP curl -s -X POST \ --data-binary @- \ --header "Content-Type: text/plain" \ http://127.0.0.1:8000/api/v1/network-topology/topology/d17e539a-1793-4be2-80a4-c305eca64fd8/receive/?key=cMGsvio8q0L0BGLd5twiFHQOqIEKI423
/opt/send-topology.shscript created in the previous step to the crontab, here’s an example which sends the topology data every 5 minutes:
# flag script as executable chmod +x /opt/send-topology.sh # open crontab crontab -e ## Add the following line and save echo */5 * * * * /opt/send-topology.sh
Once the steps above are completed, you should see nodes and links being created automatically, you can see the network topology graph from the admin page of the topology change page (you have to click on the View topology graph button in the upper right part of the page) or, alternatively, a non-admin visualizer page is also available at the URL
Find out more about OpenWISP Network Topology
For more information about the features offered by OpenWISP Network Topology we refer to the following sections of its documentation: