Page index
- Overview
- Producer
- Consumer
- Repository
- Data Model
- Searching in NOCLook
- Indexed properties
- Backup and Restore
- Links
- 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 REST interface using norduni_client.py which builds on neo4j-rest-client.
Neo Tech has release official python bindings and they are used in the master branch of NOCLook. The speed improvement is great so they will be used in the operational NOCLook in a near future.
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/
- 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 postgresTo restore the data from a backup use psql and noclook_consumer.py.
noclook_consumer.py -C restore.conf -Ipython manage.py sqlsequencereset noclookWhen using postgres you have to reset the autoincrementing handle_id property.
python manage.py dbshellCopy output from the previous command and paste it in the dbshell.
Now everything should be restored and ready to be updated as usual with noclook_consumer.py.
Links
http://nidev-consumer.nordu.net (bleeding edge)
Issue tracker: https://project.nordu.net/browse/NORDUNIDEV