Skip to main content

IP Fabric Offical Plugin for nornir

Project description

ipfabric_nornir

About

Founded in 2015, IP Fabric develops network infrastructure visibility and analytics solution to help enterprise network and security teams with network assurance and automation across multi-domain heterogeneous environments. From in-depth discovery, through graph visualization, to packet walks and complete network history, IP Fabric enables to confidently replace manual tasks necessary to handle growing network complexity driven by relentless digital transformation.

Special Thanks

This project is an IP Fabric officially supported fork of nornir_ipfabric by routetonull. Thank you for your work!

Install

The recommended way to install ipfabric_nornir is via pip

pip install ipfabric_nornir

Requirements

An instance of IP Fabric is required to collect information.

Example usage

Setup

Using environment variables

Set environment vars to provide url and credentials to connect to the IP Fabric server

export IPF_URL=https://ipfabric.local
export IPF_TOKEN=myToken

# Or Username and Password
export IPF_USER=admin
export IPF_PASSWORD=mySecretPassword

Using .env file

The easiest way to use this package is with a .env file. You can copy the sample and edit it with your environment variables.

cp sample.env .env

This contains the following variables which can also be set as environment variables instead of a .env file.

IPF_URL="https://demo3.ipfabric.io"
IPF_TOKEN=TOKEN
IPF_VERIFY=true

Or if using Username/Password:

IPF_URL="https://demo3.ipfabric.io"
IPF_USERNAME=USER
IPF_PASSWORD=PASS

Running

from nornir import InitNornir
nr = InitNornir(inventory={"plugin": "IPFabricInventory"})

Using the InitNornir function

Init

from nornir import InitNornir
nr = InitNornir(
    inventory={
        "plugin": "IPFabricInventory",
        "options": {
            "base_url": "https://ipfabric.local",
            "token": "Token",  # or "username":"admin", "password":"mySecretPassword",
            "verify": True,
            "platform_map": "netmiko",  # "netmiko" (Default), "napalm", or "genie",
            "default": {"username": "device_username", "password": "device_password"},
        },
    },
)

Using the Nornir configuration file

File config.yaml

---
inventory:
  plugin: IPFInventory
  options:
    base_url: "https://ipfabric.local"
    token: "TOKEN"
    # username: "admin"
    # password: "mySecretPassword"
    verify: true
    platform_map: netmiko  # "netmiko", "napalm", or "genie"
    default:
      username: 'device_username'
      password: 'device_password'

Usage:

from nornir import InitNornir
nr = InitNornir(config_file="config.yaml", inventory={"plugin": "IPFabricInventory"})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipfabric_nornir-1.0.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipfabric_nornir-1.0.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ipfabric_nornir-1.0.0.tar.gz.

File metadata

  • Download URL: ipfabric_nornir-1.0.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.9.9 Windows/10

File hashes

Hashes for ipfabric_nornir-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1655dc728816ce54b4cf62e5366a0a844c483fb95f630c8ee49762c9a8cacad7
MD5 b2ef8042042d5c0b120b2826e678fb7d
BLAKE2b-256 e95056b67e6193960b6f21bb79ef77068bd90e92e543635fea73dc1ccd2fb00d

See more details on using hashes here.

File details

Details for the file ipfabric_nornir-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ipfabric_nornir-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.9.9 Windows/10

File hashes

Hashes for ipfabric_nornir-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be4e5bd2541594e1b9ff9eaa2e8dc3ce9b12a57c747895e104d009bf86b40504
MD5 3be83bcd7082eb118d09c437b026fb93
BLAKE2b-256 ff9a8e9643ed11bccbb5c6c4b3e049866fafb1296f647a88fe2066fe6b95b4ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page