Coder Social home page Coder Social logo

ipviz's Introduction

ipviz

Transforms a list of json subnets to a heatmap png

Highlights:

  • Visualize your aws subnets as map to get an overview of available IP ranges and ip usage of each subnet.
  • Accepts input as
    • Feed with output from aws ec2 describe-subnets --output json
    • Simple JSON based list for custom input
  • Produces the following output:
    • PNG with a heatmap like usage vizualisation
    • (optional) JSON report with usage metrics of the subnets in an 'enhanced simple input format' for further processing

Based on https://github.com/measurement-factory/ipv4-heatmap

Find ready to run Docker images in my dockerhub repo

Run them e.g. with

aws ec2 describe-subnets --output json | docker run -i --rm -v $(pwd):/work olafrauch/ipviz:1.0.6

or with input file:

cat examples/example_1.json | docker run -i --rm -v $(pwd):/work olafrauch/ipviz -d -t simple -o examples/example_1.png

Transforms a list of subnets with allocated ips in a simple heatmap png
=======================================================================
usage: ipviz.sh [OPTIONS] [-c cidr_limit] [-o output_png] [-t aws|simple] input_json|STDIN

OPTIONS:
    -d : Debug output
    -? : This message
    -t : Input format type:
          AWS (default): Format as aws ec2 describe-subnets --output json
          SIMPLE : Format see below
    -c CIDR
       Limit the output to this CIDR
       Default to /16 subnet of the lowest IP in input
    -o output_png
       defaults to heatmap_<baseip_of_cidr>.png
    -r : Export input file as enhanced output file compatible with SIMPLE File format

input_json:
    file or stdin with json array and the following object structure:
    SIMPLE:
    [
      {
        "cidr": "10.107.0.0/28",
        "available": 5,
        "name": "public az1",
        "az": "eu-central-1"
      },
      {
        "cidr": "10.107.0.64/28",
        "available": 2,
        "name": "public az2",
        "az": "eu-central-1"
      }
    ]
 or
    AWS:
    Output as in aws ec2 describe-subnets ...

* each subnet is rendered as a block in the heatmap
* the allocated ips in a subnet are filled from left/top to right/down
* the free ips are rendered with a random background color in the block

Required tools:
 - ipv4-heatmap "make install" from: https://github.com/measurement-factory/ipv4-heatmap
 - jq
 - imagemagick
 - ipcalc
 - nmap
 - grepcidr

Example

./ipviz.sh -r -o examples/example_1.png -t simple examples/example_1.json

or

cat examples/example_1.json | ./ipviz.sh -r -o examples/example_1.png -t simple

Input JSON: Heatmap Example 1

Outputs:

Report JSON: Heatmap Example 1

Heatmap:

Heatmap Example 1

Source code and build

Release is made with npm release-it Package e.g.: release-it minor

ipviz's People

Contributors

olafrauch avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

ipviz's Issues

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.