You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 32 Next »

Page index
  1. Overview
  2. Producer
  3. Consumer
  4. Repository
  5. Data Model
  6. Searching in NOCLook
  7. Indexed properties
  8. Backup and Restore
  9. Links
  10. How to set up a NI suite

Overview

NORDUnet Network inventory project is divided in to three parts. One part that gathers the data (producer), another part that uses the data (consumer) and a repository for the raw data.

Producer

For the producer we use the NERDS projects JSON format to save the data. How to actually collect data depends on what you want to collect data from.

Consumer

The only NORDUnet consumer today is NOCLook which is a web gui made with the Django web framework and Neo4j graph database as back end for the inventory data model. The data is added to the Neo4j database via the neo4j-embedded using norduni_client.py which builds on neo4j-rest-client.

Repository

Git is used to handle the revisions of the collected data.

Data model


Hopefully these entities and relationships are enough.


The data that was inserted manually in the prototype.

Searching in NOCLook

In addition to the search box at the top of the page you can also use the URL field for searching.

/findall/[value]/
ex. /findall/10/
/findall/[key]/[value]/
ex. /findall/link/10/
/findin/[node type]/[value]/
ex. /findin/optical-node/10/
/findin/[node type]/[key]/[value]/
ex. /findin/optical-node/link/10/
/getall/[node type]/
ex. /getall/optical-node/

The URL field version of the search only finds complete strings so you can't use wild cards but it is at lease case insensitive.

Indexed properties

Neo4j provides Lucene indexes for nodes and relationships. A "search" index is created with the properties that will be searched when a user uses the search bar. Some optimization indexes was also created to speed up the consuming or presentation.

Node search index:
name (all nodes)
description (interface and unit nodes)
ip_addresses (unit and host nodes)
as_number (peering partner nodes)
hostname (host nodes)

Relationship search index:
ip_address (Uses and Depends_on relationships)

Node node_types index
node_type (all nodes)

All property values above is also indexed under the index key all in all indexes. For example in the search index you can query the all-key for both name, description, ip_addresses, as_number and hostname.

Backup and Restore

You can backup the Postgresql and Neo4j databases using these scripts:

# Backup the SQL database
su - postgres -c "pg_dumpall > /opt/nistore/producers/noclook/sql/postgres.sql"
# Run NOCLook producer for backup purpose
cd /opt/norduni/src/scripts/
rm /opt/nistore/producers/noclook/json/*
./noclook_producer.py -O /opt/nistore/producers/noclook/json/
# Push the changes to nistore master
/usr/local/sbin/ni-push.sh -r /opt/nistore/

To restore the data from a backup use psql and noclook_consumer.py.

restore.conf
# All producers need to be listed here with a path data or empty
[data]
juniper_conf = 
nmap_services = 
alcatel_isis = 
noclook = /opt/nistore/producers/noclook/json/
sudo -u postgres psql -f /opt/nistore/producers/noclook/sql/postgres.sql postgres
noclook_consumer.py -C restore.conf -I

When using postgres you have to reset the autoincrementing handle_id property.

python manage.py sqlsequencereset noclook

Copy output from the previous command and paste it in the dbshell.

python manage.py dbshell

Now everything should be restored and ready to be updated as usual with noclook_consumer.py.

https://ni.nordu.net

http://nidev-consumer.nordu.net (bleeding edge)

Issue tracker: https://project.nordu.net/browse/NORDUNIDEV

How to set up a NI suite

Setting up a NORDUni instance

  • No labels