Git Product home page Git Product logo

network-to-database's Introduction

Demo: https://www.youtube.com/watch?v=koJc_LmFpAI&feature=youtu.be

This program will run though your Cisco gear, run a bunch of commands on the IP addresses in IPs.txt, and put data from those commands into a database. It will also find other devices in your network to pull data from and stick into the database, and repeat till it runs out of devices to hit.

You will need the textfsm files from https://github.com/networktocode/ntc-templates and put the ntc-templates-master folder in the same folder as everything else.

The IPs.txt file is where the crawler will start looking.

To update the network username/password go into explore_network.py and edit the get_username_password function

All the examples assume your using a windows docker build and have your files in d:/network_crawler/network_to_db

When I do this "//d/network_crawler/network_to_db:/network_crawler" I am just mapping my d:/network_crawler/network_to_db to the linux /network_crawler. All my files are in d:/network_crawler/network_to_db

To update the database location/name go into db_work and update there: 
	db_location is the MySQL server
	db_user is the user
	db_password is the database password
	perm_db is the perminate database
	temp_db is the temp database


From main docker:
	Build Images:
		docker build -t network_crawler_build_perm_db:latest -f ./Dockerfile-Build-perm-db .
		docker build -t network_crawler:latest -f ./Dockerfile-Explore-network .
		docker build -t network_crawler_build_reports:latest -f ./Dockerfile-Build-reports .		

Build the database (only the 1st time this is run)
	docker container run -v //d/network_crawler:/network_crawler network_crawler_build_perm_db
Crawl the network:
	docker container run -v //d/network_crawler:/network_crawler network_crawler
Build Reports:
	docker container run -v //d/network_crawler:/network_crawler network_crawler_build_reports
	
	
	
Popular SQL queries
	select local_host,localInterface,deviceId,interface,ipAddress from cdp;
	select local_host,intf,ipaddr from ip_int_brief;
	select local_host,nexthop_if,network,mask from connected_subnets;
	select local_host,interface,neighbor_id,state,address from ospf;


-----------------
Build a temporary MySQL server for demo purposes (assuming the server is at 192.168.0.183)

Run mysql container on server
docker run --detach --name=test-mysql --env="MYSQL_ROOT_PASSWORD=password" --publish 3306:3306 mysql
Connect to server from linux and create the DB
mysql -u root -p -h 192.168.0.183
create database network_data_db;
create database temp_db;

network-to-database's People

Contributors

eckelcu avatar gorenetwork avatar

Watchers

 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.