Giter Club home page Giter Club logo

netbox's Introduction

TOC:

  1. TLDR - goto installation
  2. What is Netbox?
  3. Architecture
  4. Netbox on RPI
  5. How to manage all your (environment) variables
  6. Installation
  7. Configuration details
  8. Troubleshooting

1. What is Netbox?

NetBox is a fully open-sourced platform for modern network automation and infrastructure resource management, with:

  • IPAM: IP address management.
    • IP addresses, networks, VRFs, and VLANs
  • DCIM: datacenter infrastructure management
    • Equipment racks
    • Devices - Type and where they are installed
    • Connections - Network,power,..
    • Virtualization - Virtual machines and clusters
    • Data circuits - Long-haul communications circuits and providers

It has a feature rich API build upon a 'DJANGO framework' what makes it extremely suitable for optional automation and integration of other operational systems like monitoring, ticketing etc

๐Ÿ† Benefits
Single pane of glass
Single source of truth

Ref: see live demo on www

Design Philosophy

"Replicate the Real World"

2. Architecture

3. Netbox on RPI

This part describes the installation on a raspberry pi for learning, testing purposes or 'home use'. We deploy the solution with 'docker' and 'docker-compose'. We therfore asume that you have a RPI with docker installed.

The total "Netbox solution" consist of 3 main functionalities and we will give each of them a separate docker container:

  • netbox (application/nginx) -> A will be named 'netbox'
  • postgres database -> B will be named 'netbox-db'
  • redis cache server -> C will be named 'netbox-cache'

Basic concept

Remark: If you deploy this on Azure, AWS or GCP then we would only containerize A (netbox). The B (postgres) & C (redis) functionality would be provided as a PAAS service. This way the cloud PAAS service would do the 'heavy lifting' of redundancy, upgrades, security etc.

4. How to manage all your (environment) variables

Look carefully at the 'Docker-compose.yml' file

  1. '.env' file is automatically picked up and read when executing 'docker-compose xxx'

    Important:

    • this is for variables used in the compose file but NOT in the containers itself!
    • if you prefere another filename than '.env', then you will have to specify that file(eg 'my.env') when launching docker-compose: eg 'docker-compose -f my.env up
    • Attention: Be aware that if the same environment variable exists on the host machine (RPI) as specified in your file, the variable value of the 'host' will take precedence!
  2. The keys 'environment:' (not used in my docker-compose.yml) and 'env_file:', specify the environment variables that will be injected INTO THE CONTAINERS. Example: We define 'POSTGRES_USER=netbox' in the 'postgres.env' file. If we start a shell into the running postgres container(netbox-db) we should see this environment variable

# first we have to geta shell into the running container
docker exec -it netbox-cache sh

# test if we see the variable
echo $POSTGRES_USER
netbox

Important: Varibles defined under the key 'environment' will take precedence over those defined in the file under 'env_file:'. Best practice is not to use both keys at the same time in order to avoid mistakes.

5. Installation

How to install on RPI

6. Configuration details

Here you find some extra info about Redis and Postgres and how to configure and test both containers without launching the total netbox solution.

6.1 Detail configuration Redis

Redis

6.2 Detail configuration Postgres

Postgres

7. Troubleshooting

7.1 Starting only 1 or 2 containers of the 3

Whenever you experiencee problems, start by making sure that your redis(netbox-cache) and postgres(netbox-db) is working properly.

Start only that server from the compose file that you want to test and then perform all checks as described in 6.1 or 6.2

# This will only start the redis container
docker-compose up netbox-cache

# if ok then take it down again
docker-compose down

# if netbox-cache works, proceed testing postgres
# This will only start the postgres container
docker-compose up netbox-db

# if ok then take it down again
docker-compose down

netbox's People

Contributors

tribp avatar

Stargazers

Tomas Rezucha avatar Michael Madsen avatar

Watchers

 avatar

Forkers

ndom91

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.