how to install netdot on ubuntu 16
Netdot features include:
Device discovery via SNMP
Layer 2 topology discovery and graphing, using multiple sources of information: CDP+LLDP, Spanning Tree Protocol, switch forwarding tables, router point-to-point subnets.
IPv4 and IPv6 address space management (also referred to as IPAM), including hierarchical organization, address block visualization and IP and MAC address location and tracking.
Cable plant information including: sites, rooms, jacks, closets, inter and intra-building wiring, circuits, etc.
Contact information for related entities: departments, providers, vendors, etc.
Netdot can generate configuration files for various other tools, including:
Netdot implements role-based access control, allowing tasks such as IP address management, documentation of switch/router ports and updating of contact information to be delegated to specific groups with limited access to the web interface.
- Fresh installation of Ubuntu 16.04 server
- Pre-installed Apache and MySQL
- Internet connection
You can follow below instructions to begin the installation process
- Login as the ROOT into the system, we will work as the ROOT during the entire process.
- Install MySQL Server, and set the root password
- apt-get install mysql-server
- If it didn't ask for the password, then after the installation you have to change it by executing: mysql_secure_installation and follow the given instructions.
- Please remember this root password, as it will be used for the Netdot configuration.
- systemctl status mysql.service
- Install Apache
- apt-get install apache2 -y
- systemctl start apache2.service
- systemctl status apache2.service
- Now check the apache status by browsing the address http://your_host_ip_address/
- Netdot Installation. At any location/directory, execute the code below:
- git clone https://github.com/cvicente/Netdot.git
- cd Netdot
- apt-get install build-essential
- make apt-install
- This will take some time to finish it, please be patient
- Type 'mysql' when it asks for the below question
- Which RDBMS do you plan to use as backend: [mysql|Pg]? mysql
- Press Y for the following question
- We need to add a temporary repository of Netdot dependencies until all packages are in Debian/Ubuntu official repositories.
- Would you like to continue? [y/n] y
- Also input Y then ENTER for the following questions
- We will install the MIB files now. Continue? [y/n] y
- A new /etc/snmp/snmp.conf needs to be installed to point to the newly installed MIB files. The current file will be backed up. Continue? [y/n] y
- If you get MIBS downloading error, then follow the steps below:
- mkdir /tmp/netdisco-mibs
- cd /tmp/netdisco-mibs
- wget https://sourceforge.net/projects/netdisco/files/netdisco-mibs/1.0/netdisco-mibs-1.0.tar.gz
- cd back to your Netdot directory
- make apt-install
- The result of all modules should be ok, otherwise you have to install them manually
- To test for missing modules in your system, run: make testdeps
- In case you get any missing modules, you can install it by run the following command:
- make installdeps
- To install the missing modules manually, you can use CPAN to install by execute the following command:
- install Module::Blah (enter the missing module name here)
- Netdot configuration
- Still on the Netdot directory
- cp etc/Default.conf etc/Site.conf
- vi etc/Site.conf
- Please modify the configurations below according to your needs:
- NETDOTNAME => 'CAHANGE_ME',
- DB_DBA_PASSWORD => 'CAHANGE_ME', //(the password you used when installing mysql)
- DEFAULT_SNMPCOMMUNITIES => ['CAHANGE_ME'],
- NMS_DEVICE => 'localhost',
- DEFAULT_DNSDOMAIN => 'CAHANGE_ME',
- DEVICE_NAMING_METHOD_ORDER => [ 'snmp_target', 'sysname', 'highest_ip', 'lowest_loopback' ],
- We need to patch the files by the following tasks (please adjust your Netdot directory accordingly):
- cd /
- patch -p0 < ~/Netdot/patches/ubuntu-1604/DBI.pm.patch
- patch -p0 < ~/Netdot/patches/ubuntu-1604/apache2-init.patch
- Install the database application and the Netdot itself (note that some command below is a single line command)
- cd back to Netdot directory
- make installdb
- make install APACHEUSER=www-data APACHEGROUP=www-data
- ln -s /usr/local/netdot/etc/netdot_apache24_local.conf \ /etc/apache2/conf-available/netdot.conf
- a2enconf netdot
- systemctl restart apache2
- If you don't get any error, then you are good to go, otherwise, you'll have to fix the error shown on the screen.
- Copy the Netdot's cron to the system:
- cp netdot.cron /etc/cron.d/netdot
- Login to the Netdot on your browser by typing http://your_host_ip_address/netdot
- Username: admin
- Password: admin
Adding the devices:
- On the Management>Devices Click on the [new] option on the right side
- On the 'Discover Device' under 'Device Tasks' input your desired device IP or domain
- Leave the SNMP version as default
- Choose your SNMP Community according to what you have configured on the Site.conf file.
- Hit the 'Discover' button, it will take a while to search for the device
- After succeed adding the device, you need to change the 'Used by' option to your device type, such as Cisco and hit the 'Update' button
- Congratulations, you have your own Netdot on your system.
- If you run apt update and get the error below:
E: The repository 'http://netdot.apt.nsrc.org unstable/ Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
- Then do some tweak on the netdot repository
- sudo vi /etc/apt/sources.list.d/netdot.apt.nsrc.org.list
- Add "[trusted=yes]" after the "deb" and "deb-src" lines
- deb http://netdot.apt.nsrc.org/ unstable/
- deb-src http://netdot.apt.nsrc.org/ unstable/
- deb [trusted=yes] http://netdot.apt.nsrc.org/ unstable/
- deb-src [trusted=yes] http://netdot.apt.nsrc.org/ unstable/
Aapache2 service auto shutdown everyday
- mkdir /root/scripts
- cd /root/scripts
- vi apache_autostart.sh
- Then copy the content below into the files and save it. Please adjust the setting to your needs
- chmod +x apache_autostart.sh
- crontab -e
- Add the below line to your crontab, then save and exit:
sstat=$(pidof $serv | wc -l )
if [ $sstat -gt 0 ]
echo "$serv service is up!!!"
echo "$serv is down!!!"
systemctl start $serv
echo "$serv service is up now!!!" | mail -s "$serv service on the $(hostname) server is up again" email@example.com
- Now the script will check the apache2 service everyday at 7:00am to make sure that the service is active and up. You will also receive an confirmation email about the service as well.