This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This configuration for nProbe exposes many more options than is available in the file provided | |
# when downloading nProbe. | |
# | |
# Most likely you will only need to change the -n and -i options for your environment. However, a | |
# number of other options are documented in case you need them. | |
# | |
# The provided template works very well with ElastiFlow - A solution to collect and analyze network | |
# flow data using the Elastic Stack. ElastiFlow is available from: | |
# https://github.com/robcowart/elastiflow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install as reports/missing-device-ports.py | |
# Run as: python3 manage.py runreport missing-device-ports | |
from extras.reports import Report | |
from dcim.models import Device | |
class MissingDevicePorts(Report): | |
description = "Find devices which are missing ports that are in the device type template" | |
def test_add_ports(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import django | |
import os | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'netbox.settings') | |
django.setup() | |
from dcim.models import Device, ConsolePort, ConsoleServerPort, PowerPort, PowerOutlet, Interface, RearPort, FrontPort, DeviceBay | |
for device in Device.objects.all(): | |
# Based on Device.save() | |
ConsolePort.objects.bulk_create( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import queue | |
import threading | |
import time | |
import random | |
NUM_WORKERS = 20 | |
class Worker(threading.Thread): | |
"""A worker thread.""" | |
def __init__(self, input, output=None): |
OlderNewer