Skip to content

Commit 3747ccd

Browse files
committed
New Release v0.7.4: Merge branch 'dev' of github.com:yantisj/netgrph
2 parents 0bc97cf + d2f7cdf commit 3747ccd

35 files changed

Lines changed: 446 additions & 47 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ fairly easily. It relies on both the py2neo and neo4j bolt driver (install via
374374
pip3). The plan is to eventually convert all driver code to the bolt driver as
375375
it matures.
376376

377-
NetGrph requires [CSV files](csv/) with all of your Switches/Routers, Networks,
377+
NetGrph requires [CSV files](test/csv/) with all of your Switches/Routers, Networks,
378378
VLANs, and CDP/LLDP Neighbors in order to be multi-vendor compatible. I provide
379379
IOS and NXOS configuration parsers, as well as a sample network topology to play
380380
with. For Cisco-based networks, a generic CDP/LLDP mapper is all that's missing.

docs/INSTALL.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
## Install Notes
22

33
Netgrph was built on Ubuntu 14.04 LTS but should be portable to any other Python
4-
3.4+ system. I have done limited testing at this point on other systems (MacOS),
5-
so I highly recommend this OS right now. In the near future, I plan to ship a
6-
set of ansible scripts for easy install, but at first this is what I have.
4+
3.4+ system. I have done testing on Ubuntu 16.04 and MacOS, and I highly
5+
recommend Ubuntu trusty or xenial for support purposes. I provide ansible
6+
scripts for an easy install on a base Ubuntu system, and will be creating a
7+
Docker file before long.
78

8-
### Test Install Instructions
9+
### Ansible Install
10+
- See the README.md in docs/playbooks/
11+
- Install ansible on your machine, and point the playbook towards localhost as
12+
documented, or a remote host if you are familiar with Ansible.
13+
14+
### Manual Install Instructions
915

1016
- For testing, you can install everything but the database under your user on any system
1117
- If you do not have root access to your system, use virtualenv to satisfy the pip requirements
@@ -56,17 +62,21 @@ sudo pip3 install -r requirements.txt
5662
./netgrph.py -nf all
5763
./netgrph.py -nf all -o tree
5864
./ngreport.py -dev ".*"
65+
./ngreport.py -vrf "perim|default"
5966
./netgrph.py abc4mdf
6067
./netgrph.py abc4mdf -o json
6168
./netgrph.py abc4mdf -o yaml
6269
./netgrph.py -sp abc2sw1 xyz2sw1
6370
./netgrph.py -sp abc.* xyz.* -o csv
71+
./netgrph.py -rp 10.1.120.50 10.7.206.0/23
6472
./netgrph.py 120
6573
./netgrph.py 1246
6674
./netgrph.py -fp 10.1.120.50 8.8.8.8
6775
./netgrph.py -nlist test_group
6876
./netgrph.py -nlist test_group -o tree
6977
./netgrph.py -group ABC
78+
./ngreport.py -vrf "perim|default"
79+
./ngreport.py -vlans
7080
```
7181

7282
## Sample Reporting (to be expanded)
@@ -98,6 +108,6 @@ ngupdate --clearNodes --hours 12
98108
```
99109

100110
## Adding firewalls and third-party devices
101-
- Examine the csv files in csv/ to understand the required datasources for importing third-party data
111+
- Examine the csv files in test/csv/ to understand the required datasources for importing third-party data
102112
- Examine the cyp/buildfw.cyp for understanding how to insert a L2 firewall between VRFs
103113
- Examine the cyp/sample-queries.cyp to start querying the Neo4j database directly for data

docs/TODO

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ Maintenance:
1818
- Add switch skip on certain neighbors
1919
- Rewrite nglib.net_update using Bolt as Pythonic
2020
- Emulate dict with ngtree
21+
- Rewrite py2neo cypher queries with py2neo v3.0
22+
- Change py2neo to use bolt driver by default
23+
2124

docs/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.7.3
1+
v0.7.4

docs/WORKFLOW.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# All development done on the dev branch
2+
3+
# For release to master, checkout master, advance version, then pull from dev with no fast forward
4+
```
5+
edit docs/VERSION
6+
git tag v0.7.x
7+
git merge --no-ff --log origin/dev
8+
git push origin master
9+
```

docs/netgrph.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ dist_exclude = (noexclusion)
4242

4343

4444
[ngfiles]
45-
vrfs = ./csv/vrfs.csv
46-
devices = ./csv/devices.csv
47-
device_info = ./csv/devinfo.csv
48-
neighbors = ./csv/nd.csv
49-
networks = ./csv/allnets.csv
50-
vlans = ./csv/allvlans.csv
51-
supernets = ./csv/supernets.csv
52-
firewalls = ./csv/firewalls.csv
45+
vrfs = ./test/csv/vrfs.csv
46+
devices = ./test/csv/devices.csv
47+
device_info = ./test/csv/devinfo.csv
48+
neighbors = ./test/csv/nd.csv
49+
networks = ./test/csv/allnets.csv
50+
vlans = ./test/csv/allvlans.csv
51+
supernets = ./test/csv/supernets.csv
52+
firewalls = ./test/csv/firewalls.csv
5353

5454
# ASA FW Directory
5555
[ngfw]

docs/playbooks/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Ansible NetGrph Playbooks
2+
3+
These playbooks will install NetGrph via Ansible on Ubuntu 14.04 or 16.04 for
4+
you. It will not set your database password or configure your netgrph.ini file
5+
for now, so you need to do that manually. Once the scripts run, browse to
6+
http://machine:7474 and setup your password. Set that same password in
7+
/home/netgrph/docs/netgrph.ini, and run the /home/netgrph/test/first_import.sh.
8+
9+
#### Setting up Ansible to run via localhost
10+
11+
```
12+
sudo su -
13+
apt-get install ansible
14+
echo '[netgrph]' >> /etc/ansible/hosts
15+
echo localhost ansible_connection=local >> /etc/ansible/hosts
16+
exit
17+
```
18+
19+
#### Run playbooks against localhost (installs under netgrph user)
20+
21+
```
22+
git clone https://github.com/yantisj/netgrph.git /tmp/netgrph/
23+
cd /tmp/netgrph/docs/playbooks/
24+
ansible-playbook netgrph.yml --ask-sudo-pass
25+
```
26+
27+
#### Test the install
28+
29+
```
30+
sudo su - netgrph
31+
cd netgrph
32+
```
33+
34+
##### Use an insecure DB password for testing (not recommended)
35+
```
36+
./test/set_neo4j_password.sh
37+
```
38+
39+
##### Test a database import
40+
```
41+
./test/first_import.sh
42+
```
43+
44+
- See the INSTALL.md file for test queries and production install information

docs/playbooks/netgrph.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Configure your nguser account under vars: below
2+
# Add your server to [netgrph] in Ansible Hosts
3+
# Add your sudo user to [netgrp:vars]
4+
# ansible_ssh_user = yantisj
5+
6+
- hosts: netgrph
7+
become: yes
8+
become_user: root
9+
vars:
10+
nguser: netgrph
11+
option_install_java: false
12+
option_allow_remote_connections: true
13+
neo4j_edition: neo4j
14+
15+
neo4j_properties:
16+
- {regexp: "^allow_store_upgrade.*", line: "allow_store_upgrade=true"}
17+
18+
tasks:
19+
- name: Update Apt Packages
20+
include: tasks/apt-update.yml
21+
22+
- name: Apt Dependencies
23+
include: tasks/apt-packages.yml
24+
25+
- name: Install Java8
26+
include: tasks/java8.yml
27+
28+
- name: Install Neo4j
29+
include: tasks/neo4j.yml
30+
31+
- name: Add netgrph user
32+
include: tasks/netgrph-user.yml
33+
34+
- name: Clone NetGrph Repo
35+
include: tasks/clonerepo.yml
36+
37+
- name: Install PIP Requirements
38+
include: tasks/ngpip.yml
39+
40+
- name: NetGrph Setup
41+
include: tasks/setup.yml
42+

docs/playbooks/netgrph/netgrph.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Configure your nguser account under vars: below
2+
# Add your server to [netgrph] in Ansible Hosts
3+
# Add your sudo user to [netgrp:vars]
4+
# ansible_ssh_user = yantisj
5+
6+
- hosts: netgrph
7+
become: yes
8+
become_user: root
9+
vars:
10+
nguser: yantisj
11+
option_install_java: false
12+
option_allow_remote_connections: true
13+
neo4j_edition: neo4j
14+
15+
neo4j_properties:
16+
- {regexp: "^allow_store_upgrade.*", line: "allow_store_upgrade=true"}
17+
18+
tasks:
19+
- name: Update Apt Packages
20+
include: tasks/apt-update.yml
21+
22+
- name: Apt Dependencies
23+
include: tasks/apt-packages.yml
24+
25+
- name: Install Java8
26+
include: tasks/java8.yml
27+
28+
- name: Install Neo4j
29+
include: tasks/neo4j.yml
30+
31+
- name: Clone NetGrph Repo
32+
become: yes
33+
become_user: "{{nguser}}"
34+
include: tasks/clonerepo.yml
35+
36+
- name: Install PIP Requirements
37+
include: tasks/ngpip.yml
38+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# file: update.yml
2+
- name: Install Apt Packages
3+
apt: name={{item}} state=present
4+
with_items:
5+
- python3-pip
6+
- python3-pytest
7+
- python3-logilab-common
8+
- emacs24-nox

0 commit comments

Comments
 (0)