Code Monkey home page Code Monkey logo

net-surveyor's Introduction

NET-SURVEYOR

About Net-Surveyor

Net-Surveyor is an LLDP based tool which purpose is to collect, agggregate and visualise network topology data from cloud environment, thus simplifying network configuration and troubleshooting.

Net-Surveyor bases on Link Layer Doscovery Protocol - LLDP - data about VLANs, switch port connectivity and link aggregation.

Usage

Net-Surveyor works with multiple sources of LLDP data. Currently the preferred way is using juju and magpie.

The tool generates 3 types of reports:

  • HTML web page with a table of all machines and interfaces with LLDP data in appropriate cells
  • SVG network topology map with the same information as above
  • Python NetworkX graph

Juju

Net-Surveyor can collect LLDP data from an existing juju environment. Please note that it will install LLDP on all the machines.

  1. Clone the Net-Surveyor repository
  2. Collect LLDP data:
./collect-lldp-juju.py -i 

This collects the data by default into /tmp/lldp/. -i installs LLDP on the machines. Note that if this is fresh LLDP install, this step may need to be repeated as LLDP data is collected over time, based on incoming LLDP PDUs.

  1. Build topology from the collected data:
./build_netmap.py -o netmap.json

This step merges the collected data into single JSON file.

  1. Create report:
./report_html.py -i netmap.json -o netmap.html

Juju and magpie

  1. Create a juju magpie bundle for your environment. Magpie charm can be deployed on both bare metal machines and containers. Make sure to enable LLDP collection on bare metal machines:
series: "bionic"
machines:
  '1':
    constraints: tags=foundation-nodes
  '2': 
    constraints: tags=foundation-nodes
services:
  magpie-bare:
    charm: "cs:~openstack-charmers-next/magpie"
    series: "bionic"
    num_units: 2
    constraints: spaces=oam-space
    bindings:
      "": oam-space
    options:
      check_dns: true
      check_iperf: false
      check_bonds: "bond0,bond1,bond2"
      use_lldp: true                 # required to be true
      check_port_description: false
    to:
      - 1
      - 2
  1. Deploy the bundle:
juju deploy ./magpie-bundle.yaml
  1. Wait for the bundle to deploy
  2. Clone the Net-Surveyor repository
  3. Collect LLDP data:
./collect-lldp-juju.py

This collects the data by default into /tmp/lldp/

  1. Build topology from the collected data:
./build_netmap.py -o netmap.json

This step merges the collected data into single JSON file.

  1. Create report:
./report_html.py -i netmap.json -o netmap.html

SSH

  1. Create txt fle conatining hostnames of all machines to connect to, eg: machines.txt
  2. Collect LLDP data:
./collect-lldp-ssh.sh machines.txt

This collects the data by default into /tmp/lldp/

  1. Build topology from the collected data:
./build_netmap.py -o netmap.json

This step merges the collected data into single JSON file.

  1. Create report:
./report_html.py -i netmap.json -o netmap.html

Future work

  1. Update and publish plugin to collect MAAS comissioning data.
  2. Improve SVG graph to group host interfaces into VLANs
  3. Add VLAN and host filtering for report generation
  4. Create Net-Surveyor SNAP
  5. Create Net-Surveyor server and integrate with Magpie for single bundle deployment

Bugs and feature requests

Use issues reporting feature in this repository to report bugs and feature requests.

All contributions are heartily welcome.

net-surveyor's People

Contributors

majduk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

net-surveyor's Issues

Pre-create /tmp/lldp dir

If you do not have /tmp/lldp (or any other chosen dir) pre-created, it just errors out on each "juju scp" instead of gracefully aborting. It could send a nice error message or pre-create the dir for you.

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.