vkhitrin.com

Technology And Ramblings

Visualizing Network Topology Using Netdisco



Tags: #networking #Netdisco

Warning: This blog post describes a deployment that is not optimal for production. Use it only as part of development. The deployment will be based on containers. It is possible to install binaries on an operating system.

Warning: Not all vendors are supported by Netdisco.

Introduction To Netdisco

Netdisco is a web-based management network tool. It allows users to view and manage their network equipment.

Gathering Information

Netdisco uses SNMP, CLI or device-specific APIs to authenticate with equipment and collect information

Some of the gathered information includes:

If allowed, Netdisco can modify the discovered configuration.

Visualizing Neighbors

One of the main benefits of Netdisco is the ability to visualize neighbors. nd2-shot-2-1 This greatly helps to understand the networking stack and assists with debugging connectivity issues.

Reports

Netdisco can generate reports based on gathered information.
Some of the built-in reports include:

Users can create custom reports using SQL queries from gathered information stored in the database.

How Netdisco Works

Netdisco is an application written in Perl.

Application Components

Netdisco is built from several components:

Information gathered is stored in a PostgreSQL database.

Application Jobs

The backend agent has four principal jobs it can do:

Configuration

Netdisco uses environment variables for configuring and debugging the application itself (file paths, DB information, tracing, and more).

YAML config is used to configure the application behavior and functionality.

Default configuration shipped with the application config.yml.

Getting Started

Installation

There are several ways to install Netdisco.

Installing Binaries

This method will not be covered in this blog post. Please refer to the documentation hosted on CPAN.

Using Official Docker Images

Netdisco community provides official docker images.

Using All-In-One Container For Development Purposes

I have created an all-in-one container that can be used for development purposes.

Discovering Devices

After installing and configuring an instance of Netdisco, we can start discovering our devices.

Via Web Interface

Logging into the web interface, we are greeted with a simple interface: Screenshot-2022-11-28-at-9.58.31

To initiate discovery, fill in Device hostname or IP with the DNS/IP of the device and press search. After pressing search you will be redirected to the Job Queue page. (Job queue page is accessible manually Admin -> Job Queue) Screenshot-2022-11-28-at-9.59.40-1

A discovery job will start on the provided node. Screenshot-2022-11-28-at-19.33.11

If the node is connected to neighbors and is discoverable using LLDP/CDP, Netdisco will automatically attempt to discover them. Screenshot-2022-11-28-at-19.34.35

Discovered nodes are now accessible using the search bar at the top of the page.Screenshot-2022-11-28-at-19.34.49

Clicking on a node redirects to a page containing gathered information of the node.Screenshot-2022-11-28-at-19.35.03

Via CLI

To initiate device discovery:

netdisco-do discover -d <DNS_OR_IP>

The command will wait until timeout or completion:

[22229] 2022-11-28 17:59:08  info App::Netdisco version 2.058003 loaded.
[22229] 2022-11-28 17:59:08  info discover: [<DNS_OR_IP>] started at Mon Nov 28 17:59:08 2022
[22229] 2022-11-28 17:59:41  info discover: finished at Mon Nov 28 17:59:41 2022
[22229] 2022-11-28 17:59:41  info discover: status done: Ended discover for <DNS_OR_IP>

Collected data can be viewed (available fields):

netdisco-do show -d <DNS_OR_IP> -e c_platform
# Output
[22427] 2022-11-28 18:55:02  info App::Netdisco version 2.058003 loaded.
[22427] 2022-11-28 18:55:03  info show: [10.46.93.1]/c_platform started at Mon Nov 28 18:55:03 2022
{
    11623.5   "cisco WS-C3750G-24T",
    11624.1   "DS-C9148-32P-K9",
    11624.6   "cisco WS-C3750G-24T"
}
[22427] 2022-11-28 18:55:04  info show: finished at Mon Nov 28 18:55:04 2022
[22427] 2022-11-28 18:55:04  info show: status done: Showed c_platform response from <DNS_OR_IP>

Viewing Reports

Based on the gathered information, Netdisco offers built-in reports.

One of the basic reports is the Port utilization (Reports -> Port Utilization): Screenshot-2022-11-28-at-21.13.54

Drawing Network Topology

After discovering devices, we can draw the network topology. Search for the required node, click on Neighbors, and filter accordingly. Screenshot-2022-11-28-at-22.08.41-1

Summary

This blog post covered a small part of Netdisco’s reporting and capabilities.
For more information, please visit Netdisco’s homepage or git repository.

Back To Top