Giter Site home page Giter Site logo

netbox-scripts's Introduction

NetBox custom scripts (Python 2.7)

This is an attempt to share some of my work with the NetBox community. I plan on adding more scripts later on.

Dependencies

Make sure you have all dependencies installed i.e.

$sudo pip install sys, time, re, socket, psycopg2

If you don't have pip installed then follow this guide

Installation

Clone the repository and modify db_con.py file with your DB information i.e.

import psycopg2
conn = psycopg2.connect("dbname='YOUR_NETBOX_DB_NAME' user='YOUR_NETBOX_USERNAME' host='YOUR_NETBOX_DB_IP_ADDRESS' password='YOUR_NETBOX_DB_PASSWORD'")
cur = conn.cursor()

ipam_mgmt.py

The script attmepts to resolve each hostname in netbox DB then creates a "mgmt" interface with its corresponding IPv4/IPv6 addresses.

fping_prefixes.py

Makes an API call to NetBox and returns the list of IPv4 prefixes, then saves the list of returned prefixes to fping_prefixes file.

fping.sh

Runs fping against each subnet found in fping_prefixes file and saves "Alive" hosts in fping_hosts file.

fping.py

Adds unique entries found fping_hosts file and ultimately adds them to NetBox.

netbox-scripts's People

Contributors

rkutsel avatar

Watchers

PG avatar  avatar

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.