Skip to main content

Netbox Negistry Importer

Tool to pull data from Negistry (ripe IP ranges) and synchronize it with a Netbox (SOT) as a prefixes.


Install

  1. Clone repository
    • git@gitlab.cesnet.cz:701/done/netbox_negistry_importer.git
  2. Go into the repository
    • cd netbox_network_importer
  3. Create virtualenv
    • python3 -m venv venv
  4. Activate it
    • source venv/bin/activate
  5. Install the tool
    • pip install .
  6. Setup configuration file
    • cp config/.secrets.yaml.sample config/.secrets.yaml
    • cp config/settings.yaml.sample config/settings.yaml

Alternatives

  1. pip install git+ssh://git@gitlab.cesnet.cz/701/done/netbox_negistry_importer.git
    • installs the package
  2. Setup configuration files! (see below)

Pre-requisite

To operate, the Netbox Negistry Importer is dependent on the following items:

  • Access to Netbox API
  • Access to Negistry API
  • Created Custom Field on Netbox
    "results": [
        {
            "display": "Client ID",
            "content_types": [
                "ipam.prefix",
            ],
            "type": {
                "value": "text",
                "label": "Text"
            },
            "object_type": null,
            "data_type": "string",
            "name": "client_id",
            "label": "Client ID",
            "description": "",
            "required": false,
            "filter_logic": {
                "value": "loose",
                "label": "Loose"
            },
            "default": null,
            "weight": 100,
            "validation_minimum": null,
            "validation_maximum": null,
            "validation_regex": "",
            "choices": [],
        },
        {
            "display": "Negistry primary key",
            "content_types": [
                "ipam.prefix"
            ],
            "type": {
                "value": "text",
                "label": "Text"
            },
            "object_type": null,
            "data_type": "string",
            "name": "negistry_primary_key",
            "label": "Negistry primary key",
            "description": "IP range from Negistry",
            "required": false,
            "filter_logic": {
                "value": "loose",
                "label": "Loose"
            },
            "default": null,
            "weight": 100,
            "validation_minimum": null,
            "validation_maximum": null,
            "validation_regex": "",
            "choices": [],
        },
        {
            "display": "Netname",
            "content_types": [
                "ipam.prefix",
            ],
            "type": {
                "value": "text",
                "label": "Text"
            },
            "object_type": null,
            "data_type": "string",
            "name": "netname",
            "label": "Netname",
            "description": "",
            "required": false,
            "filter_logic": {
                "value": "loose",
                "label": "Loose"
            },
            "default": null,
            "weight": 100,
            "validation_minimum": null,
            "validation_maximum": null,
            "validation_regex": "",
            "choices": [],
        }
    ]
  • Created "negistry" tag on Netbox
        {
            "display": "negistry",
            "name": "negistry",
            "slug": "negistry",
            "description": "Negistry Prefix",
        }

Configuration file

The configuration properties must be provided via the configuration files.

Netbox Negistry Importer try to find the configuration file in folders:

  • <PROJECT_ROOT>/config/
  • /etc/netbox_negistry_importer/
  • /home/<user>/.config/netbox_negistry_importer/
  • Or you can set path to configuratin files like:
    • SETTINGS_FILE_FOR_DYNACONF=/some/custom/path/settings.yaml SECRETS_FOR_DYNACONF=/some/another/path/.secrets.yaml import_negistry

# settings.yaml
---
LOGLEVEL: DEBUG
NEGISTRY_URL: <negistry_url>
NETBOX_INSTANCE_URL: <netbox_url>

# .secrets.yaml
---
NETBOX_API_TOKEN: <TOKEN>

Execute

The Netbox Negistry Importer runs only in apply mode.

Apply Mode

Execution:

  • import_negistry # runs the importer

Metadata

Release files for netbox-negistry-importer 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-negistry-importer 0.2.0
File Size Uploaded
netbox_negistry_importer-0.2.0.tar.gz 7.2 kB Details

Release files / netbox_negistry_importer-0.2.0.tar.gz

Download URL netbox_negistry_importer-0.2.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b0bc49c8438443d9e984a8b1bca4c4affb34e570e73b827323ef8cb9eda289e9
BLAKE2b-256 checksum
How to use checksums
3c941185007afdd685fb5dbdcc03c261ca9f79b60be7afc431bac94bf3295ce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page