Coder Social home page Coder Social logo

netreplica / graphite Goto Github PK

View Code? Open in Web Editor NEW
59.0 2.0 3.0 2.82 MB

Visualization for Network Topologies – NetBox, Containerlab, Netlab

Home Page: https://netreplica.com

License: Apache License 2.0

JavaScript 86.53% HTML 5.04% Dockerfile 2.92% Shell 2.76% CSS 2.75%
networking visualization containerlab nextui netbox

graphite's Introduction

Discord


Netreplica Graphite

Visualization for Network Topologies

Supported software

NetBox

Support for NetBox DCIM system includes:

  • Visualization of network topologies exported by netreplica/nrx command-line tool
  • Does not require installation of a plugin on a NexBox instance
  • Filtering based on Device role, site and/or tag information to select devices for visualization
  • User-customizable topology data definitions via Jinja2 templates

To export a topology for visualization from NetBox run nrx with the following parameters. See more in nrx documentation.

nrx.py --config netbox.conf --input netbox --output graphite --site SITE --tag TAG

Once the data is exported, run Graphite using of the methods described here to see the topology via a browser.

Containerlab

Support for Containerlab network emulation software includes:

  • Visualization of live topologies, including dynamic information about network nodes – for example, management IP addresses.
  • WebSSH access to running Containerlab nodes from the topology visualization.
  • Launching Graphite as part of Containerlab topology by including it as a node in the topology YAML file.

The easiest way to use Graphite with Containerlab is to add the following code to a topology YAML file under the nodes: section. For a full topology example see examples/2host.yaml.

    graphite:
      kind: linux
      image: netreplica/graphite
      env:
        HOST_CONNECTION: ${SSH_CONNECTION}
      binds:
        - __clabDir__/topology-data.json:/htdocs/default/default.json:ro
        - __clabDir__/ansible-inventory.yml:/htdocs/lab/default/ansible-inventory.yml:ro
      ports:
        - 8080:80
      exec:
        - sh -c 'graphite_motd.sh 8080'
      labels:
        graph-hide: yes

Once added, deploy the topology with sudo -E containerlab deploy -t <topology.yaml>. Note -E parameter for sudo – it is needed to pass SSH_CONNECTION variable.

Look for Graphite visualization 🎨 http://<ip_address>:8080/graphite Containerlab output. If you are running Containerlab on a VM via an SSH session, the <ip_address> in the URL should be the one you are using to connect to the VM, so there is a good chance the link will just work. If not, you might need to replace <ip_address> with proper address to connect to Graphite.

Graphite visualization 🎨 link

Detailed instructions on using Graphite with Containerlab

Follow step-by-step reference to learn how to use Graphite with ContainerLab.

Running Graphite as a standalone Docker container

To be able to visualize multiple Containerlab topologies, including those that are not currently running, you can launch Graphite as a standalone container. Follow the guide to learn how.

Copyright notice

Copyright 2022-2023 Netreplica Team

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

graphite's People

Contributors

bortok avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

graphite's Issues

Enable TELNET connection

For now, graphite web-ui authorize only SSH connection.
Is there a possibility to allow plain telnet connection method ?

i.e.: In node config define OOBM_CONNECTION=[ssh,telnet]
in the example above, ssh and telnet is allowed.

webssh connectivity when graphite is launched outside of clab yaml

If graphite is launched via "docker run" instead of from clab yaml, it ends up connected to a different bridge – this breaks webssh connectivity to emulated nodes. For example,

+---+------------------------+--------------+-----------------------------+-------+---------+---------------+--------------+
| # |          Name          | Container ID |            Image            | Kind  |  State  | IPv4 Address  | IPv6 Address |
+---+------------------------+--------------+-----------------------------+-------+---------+---------------+--------------+
| 1 | clab-h84_clab-centos1  | 965ef2bb8397 | nanoghackathon82/centos     | linux | running | 172.22.0.3/24 | N/A          |
| 2 | clab-h84_clab-centos2  | 233a38b80e07 | nanoghackathon82/centos     | linux | running | 172.22.0.5/24 | N/A          |

while

docker exec -it graphite sh
/usr/local/webssh2 # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
78: eth0@if79: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
       valid_lft forever preferred_lft forever

/usr/local/webssh2 # ping 172.22.0.1
PING 172.22.0.1 (172.22.0.1): 56 data bytes
64 bytes from 172.22.0.1: seq=0 ttl=64 time=0.062 ms
64 bytes from 172.22.0.1: seq=1 ttl=64 time=0.106 ms
^C
--- 172.22.0.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss

ping 172.22.0.3
PING 172.22.0.3 (172.22.0.3): 56 data bytes
^C
--- 172.22.0.3 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

Looks like this happens to do lack of a return route from the emulated nodes back to graphite IP address.

webssh2 release remaining items

Web UI:

  • page title: topology_name - clab@hostname
  • diagram panel: add header with topology name, footer with layout buttons
  • proof-read docs if topology file is .yml and not .yaml
  • show "unknown" topology name when nothing is defined
  • generate_offline_graph.sh: handle cases when filename doesn't match topology name + .yaml
  • pull topology name to show from URL when legacy graph json data is used
  • replace default graph.json with topology-data.json
  • add more parameters in node tooltips, improve formatting
  • try webssh connection over IPv6
  • add mask prefix length to IPv4/6
  • add copyright to the web page
  • add emoji to graphite link
  • add github repo link

Moved to backlog:

  • don't show webssh link if there is no mgmt IP address known

Update defaults to use live labels

TODO

  • Use Badged Link by default

  • Enable data fetch by default

  • Reduce data fetch frequency

  • Remove Static/Live labels UI

  • Zoom in twice by default - autoscales anyway

Add TLS

For WebSSH or whole Graphite

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • alpine 3.15
  • alpine 3.15
  • alpine 3.15
git-submodules
.gitmodules
  • docker/node-data main@a0b700c10da307c5b9c69097e1dd6c30aee82328
  • docker/webssh2 main@8c64f8e02657549e8706a7ef6d80ec8d132e17c4
  • docker/lighttpd1.4 master@c223201bb2966d90f4cac085473ec5faa1951ec8

  • Check this box to trigger a request for Renovate to run again on this repository

FR: Enable display of custom URLs in node tooltips

The idea is to take a custom URL specified under a node definition in a topology data and show it via a node tooltip. An example could be an admin UI to control the node – for example, for a PAN firewall. Or some monitoring system UI if such system is a part of the topology.

Documentation: when to use fixed mgmt IP

Add a note to use a fixed mgmt IP if everything else in the topo is on fixed. Otherwise the default yaml snippet can cause IP overlaps and one of the topology nodes might fail to boot.

Add node-data service to graphite container image

  • add node-data to graphite Dockerfile
  • working clab topo snippet for graphite
  • fix TLS handshake issue with cEOS
  • make it work without URL parameters for the clab topology it was deployed as part of
  • reduce image size with multi-stage
  • switch to production server
  • run prod server as non-privileged user
  • check for TODOs
  • fix npm audit issues
  • interface_full_name_map expand to 25/40/50/100/400/800/1600 and cover other NOSes like SRL

FR: prevent caching of visualization

When topology definitions (JSON files) change, it is not transparent to the web server or browser, and to refresh a visualization, a forced refreshed is needed by a user (shift-refresh). Need to introduce a mechanism to avoid caching that leads to this behavior.

Read source of topology data: Clab, Netbox, Netlab

topology-data.json:

{
  "name": "",
  "type": "TOPOLOGY_SOURCE",
  "nodes": {},
  "links": []
}

TOPOLOGY_SOURCE can be one of: clab, netbox, netlab

Show as "Containerlab", "NetBox" and "netlab" here:

colo_-_clab_localhost

Currently, if type is not clab then the following error is shown:

-_clab_localhost

Show BGP ASNs

Potentially use grouping capabilities to encircle all the nodes that belong to the same ASN

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.