Network Documentation Tool - a system for maintaining network documentation

Dear habrasociety, let me introduce you to my opinion a very useful tool - Netdot (Network Documentation Tool). Search in Habr did not give any mention of this interesting tool. Russian-language information resources also bypassed him. I hope that my short review will be useful to network administrators.


Why did we choose Netdot

I will briefly describe how I began to use this tool. Before me and my colleagues there was a rather simple task - to choose a tool for managing ip-addresses. We selected several tools from the table on Wikipedia and tried to compare them. The key parameters for the selection were: active development, openness, cross-platform, the availability of tools for managing DNS records, a graphical representation of the address space.
Each of the tested systems has its own advantages and disadvantages. Of all the tested, we settled on Netdot. It is actively developing, has rich functionality, the system is open, written in Perl (I program in Perl and it is easier for me to configure something to my needs), it has a pretty nice and non-overloaded interface.
Of course, there are some drawbacks, but for us they are not relevant: so far only the BIND DNS server is supported (we use it, besides, no one bothers to write our own synchronization script), the topology graphs are rather confusing (I'm sure that over time, this defect will be eliminated), it does not know how to build an L3-topology, an inflexible rights management system.
Thus, in the process of searching for one small tool, we discovered a larger and more functional tool. After all, it is very convenient to have all the information about the network infrastructure in one place, as well as the ability to manage it, create logical connections, manage rights.
We also tried using the NOC system ( Review articleon Habrahabr). Its functionality is much richer, but it seemed to us less convenient. Perhaps time will pass and we will reconsider our views.

Opportunities

So, Netdot - as the name implies ( Net work Do cumentation T ool), this software helps to maintain documentation, namely:
  • Locate and query devices using SNMP
  • build and display L2 topology using various sources: CDP, LLDP, STP, switching tables;
  • keep records of equipment (Asset Management);
  • keep track of address space (IPAM);
  • Manage DNS records
  • manage DHCP;
  • keep records of cable infrastructure: rooms, racks, sockets, connections inside and between buildings, etc.
  • contact accounting (administrators, operators, departments, sellers, suppliers, etc.)
  • export settings for external systems: Nagios, RANCID, Cacti, BIND, DHCPD and more.

Structure

I will describe a little the general structure. Netdot consists of the following components:
  1. Database - MySQL and PostgreSQL are currently supported. Ideally, you can use any database that is supported by Perl DBI.
  2. Libraries - The code is a hierarchical structure of object-oriented classes of Perl.
  3. User Interface - Based on the HTML :: Mason framework.
  4. Command line scripts - various scripts (import, export, configuration update, etc.). You can run them at some intervals using CRON.

The main elements in Netdot are “devices” (switches, routers, access points, servers). It should be noted that PCs, laptops, mobile phones, etc. are not considered as “devices”. They are entered into the database from ARP tables and device switching tables, and then they can be tracked by IP or MAC addresses, and also see which switch port they were connected to in the past.

Installation

I will briefly describe the installation process. As the operating system, I used CentOS 6.4.
• Download the latest version from the developers website:
~# wget netdot.uoregon.edu/pub/dists/netdot-1.0.4.tar.gz
• Or get the latest version from GitHub:
~# git clone git://github.com/cvicente/Netdot
• Unpack the archive:
~# tar -zxC /usr/local/src -f netdot-1.0.4.tar.gz
• Install the dependencies:
~# cd /usr/local/src/netdot-1.0.4/
~# make rpm-install
Note 1 . I have activated the RPMForge repository and during installation I got an error:
Transaction Check Error:
file /usr/share/man/man3/XML::SAX::Base.3pm.gz conflicts between attempted installs of perl-XML-SAX-0.96-7.el6.noarch and perl-XML-SAX-Base-1.04-1.el6.rf.noarch
file /usr/share/man/man3/XML::SAX::Exception.3pm.gz conflicts between attempted installs of perl-XML-SAX-0.96-7.el6.noarch and perl-XML-SAX-Base-1.04-1.el6.rf.noarch
To fix it, you need to add the line to the /etc/yum.repos.d/rpmforge.repo file :
exclude=perl-XML-SAX-Base

Note 2 . If you have a distribution based on Debian, then Netdisco MIBs should be installed automatically. In my case, they must be installed manually:
~# yum install net-snmp net-snmp-utils
~# wget kent.dl.sourceforge.net/project/netdisco/netdisco-mibs/latest-snapshot/netdisco-mibs-snapshot.tar.gz
~# tar -zxC /usr/local/src -f netdisco-mibs-snapshot.tar.gz
~# mkdir /usr/local/netdisco
~# mv /usr/local/src/netdisco-mibs /usr/local/netdisco/mibs
~# cp /usr/local/netdisco/mibs/snmp.conf /etc/snmp/

• Install the missing Perl modules:
~# make installdeps
• Copy the configuration file:
~# cp etc/Default.conf etc/Site.conf
• Edit the settings:
Database connection parameters
DB_TYPE => 'mysql'
DB_DBA => 'root',
DB_DBA_PASSWORD => 'rootpass',
DB_HOST => 'localhost',
DB_DATABASE => 'netdot',
DB_NETDOT_USER => 'netdot_user',
DB_NETDOT_PASS => 'netdot_pass',
, where DB_DBA is the user who has the right to create databases, DB_DATABASE is the name of the Netdot database to be created, DB_NETDOT_USER is the user of the Netdot database.
All other settings can be edited later. It should be noted that in the future, when changing the configuration, you must restart Apache for the changes to take effect.
• Initiate the database:
~# make installdb
• Install directly Netdot
~# make install
• Configure Apache:
~# cp /usr/local/netdot/etc/netdot_apache2_local.conf /etc/httpd/conf.d/
• After installation, restart Apache:
~# service httpd restart

Installation is complete. We launch the browser and go to the address http: //your_host_name.domain/netdot. The default username and password are “admin”.
You will find a more detailed description of the installation in the official documentation - https://osl.uoregon.edu/redmine/projects/netdot/files

Interface

The utility interface is quite simple:



Devices can be added in several ways:
• Interrogate devices using a script on the command line:
~# /usr/local/netdot.bin/updatedevices.pl -H <адрес или имя хоста> -I -c <комьюнити>- extract information from a single host
~# /usr/local/netdot.bin/updatedevices.pl -B 192.168.1.0/24 -I -c <комьюнити>- scan the subnet and extract information
~# /usr/local/netdot.bin/updatedevices.pl -E <мя файла>- scan devices described in the file
You can get a complete list of script parameters using the command:
~# /usr/local/netdot.bin/updatedevices.pl -h
• Interrogate or add a device via the web interface:



As a result, we get a list of devices:



For each device, quite detailed information is displayed:







Finally, I will give an example display information about available address space.
General list of subnets:



A subnet is what is visible on the router interface. A container can contain subnets and other containers. A subnet cannot contain other subnets and containers. A container is transformed into a subnet when it appears on one of the router interfaces.

Subnet Card: The


IP address can take one of the following states:
  • Free (available) - free address
  • Static - belongs to the device interface
  • Discovered - found in the ARP table
  • Dynamic (dynamic) - included in the range allocated by DHCP
  • Reserved - addresses that cannot be assigned to interfaces




Summary

Netdot is a fairly powerful and functional system. Of course, in one article it is impossible to describe all its possibilities. If the article interests you, I will be glad to continue.
Project website:
https://osl.uoregon.edu/redmine/projects/netdot

Also popular now: