Giter VIP home page Giter VIP logo

customizations's People

Contributors

1993zig avatar adriankus avatar brehtyn avatar candlerb avatar dansheps avatar ffly90 avatar flashbyte avatar jeremystretch avatar kkthxbye-code avatar lampwins avatar marchagen avatar markkuleinio avatar martinum4 avatar ollytom avatar renatoalmeidaoliveira avatar ryanmerolle avatar shatt79 avatar slrz avatar tyler-8 avatar zombah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

customizations's Issues

Add Device Type Components - Module Bays and Console Ports

Hi

When updating a device with the script add_device_type_components.py, both interfaces, module bays and console ports are populated. However, the tab menues for module bays and console ports does not get updated with the new data. In this screenshot, you may see how the device has got 17 module bays, but only showing 1 (which was there from before) in the menu:
image

If there are no module bays or console ports, the tab menu item is not displayed. Hence you will not have the oportunity to use them. As shown here:
image

Interfaces works as expected.
Any idea what could cause this?

Netbox v3.6.6

ImportError in multi_connect.py

put the script in ./scripts of netbox-docker.

When accesing the "scripts" main menu item, netbox throws a server error (below).
I've seen that generally people use 'LinkStatusChoices', maybe it is deprecated, but i'm not really sure what's happening.

<class 'ImportError'>

cannot import name 'LinkStatusChoices' from 'dcim.choices' (/opt/netbox/netbox/dcim/choices.py)

Python version: 3.9.5
NetBox version: 3.0.6

Filtering 'InterfaceTemplate' by 'device_type_id' in the script.

Hello. I have code:

    manufacturer = ObjectVar(
        label='Manufacturer',
        description="Manufacturer of the device",
        model=Manufacturer,
        required=False
    )
    device_type = ObjectVar(
        label='Device model',
        description="Model of the device",
        model=DeviceType,
        query_params={
            'manufacturer_id': '$manufacturer'
        }
    )
    up_link_interface = ObjectVar(
        label='Up-Link interface',
        model=InterfaceTemplate,
        description="Up-Link interface",
        query_params={
            'device_type_id': '$device_type',
        }

The problem is that this code does not filter interfaces in "up_link_interface" (gives a complete list of all interfaces from all templates). Please explain what the error is. Thanks.

dns-reports is reporting on devices with no interfaces

dns-reports checks for dns entries for devices with IPs assigned to an interface. This line filters out devices with no interfaces, but in my case, it still returns devices with no interfaces, because it returns an empty QuerySet
https://github.com/netbox-community/reports/blob/9b4a4fab71c5a10469988f362f410b295b9f317e/reports/ipam-reports/dns-reports.py#L13

I've fixed the issue locally by replacing it with this line.
if not device.interfaces.exists():

http://docs.djangoproject.com/en/dev/ref/models/querysets/#exists

FR: Add export templates and change name

Hello,

so far this repository collects reports and scripts, thus the name seems already a bit misleading.
I propose that this repository should be renamed (maybe something like "user_generated_content") and the ability to add export templates is added.
Benefit: Users are encouraged to submit their templates, we all can learn a bit from it or get new ideas.

Update Reports to work with v2.7.*

Several of the reports seem to be broken on v2.7.* as a result of the change to some of the constants in python.

Here is an example Server Error

The complete exception is provided below:
<class 'NameError'>
name 'IPADDRESS_ROLE_LOOPBACK' is not defined

A script like add_device_type_components.py but for module types?

I'm not a coder, so I'm asking for help. Is anyone up to the task of creating a script very much like the "add_device_type_components.py" script, but for module types? I have 400+ modules that I need to add an interface to. I'd like to do this in bulk without going to every single one of those 400+ modules.

Thanks!

add_device_type_components not working

An exception occurred: TypeError: RearPortTemplate.instantiate() takes 1 positional argument but 2 were given

Traceback (most recent call last):
  File "/opt/netbox/netbox/extras/scripts.py", line 461, in _run_script
    script.output = script.run(data=data, commit=commit)
  File "/etc/netbox/scripts/add_device_type_components.py", line 44, in run
    items = [
  File "/etc/netbox/scripts/add_device_type_components.py", line 45, in <listcomp>
    x.instantiate(device)
TypeError: RearPortTemplate.instantiate() takes 1 positional argument but 2 were given

Getting this error on v3.2.7

Help with report

Hi.

I would like to have a report that shows me the amount of IP that a prefix has.

If the prefix has no registered ip, it will be a log_failure and in case have at least one ip is log_info.

I don't know how to relate IPs to prefixes using ipaddress and prefix objects.

Can you help me?

Thank you

Wikimedia Netbox reports

The reports we (at Wikimedia) made to keep our data consistent are available on https://gerrit.wikimedia.org/g/operations/software/netbox-reports, with a mirror on https://github.com/wikimedia/operations-software-netbox-reports
I don't think they would be of any value as-it, as they are tailored for our needs, but might be worth a link from your repo to ours. At least to get ideas and inspiration.
See our README for a quick description.
Fyi, all our Netbox related work is tracked on https://phabricator.wikimedia.org/tag/netbox/

Create_VM Script errors on Netbox 2.8.3

As per the title, I am running Netbox v2.8.3 and tried to run the create_vm.py script but it failed with the error below:

An exception occurred: FieldError: Cannot resolve keyword 'family' into field. Choices are: address, created, custom_field_values, description, dns_name, id, interface, interface_id, last_updated, nat_inside, nat_inside_id, nat_outside, primary_ip4_for, primary_ip6_for, role, services, status, tagged_items, tags, tenant, tenant_id, vrf, vrf_id

Traceback (most recent call last):
  File "/opt/netbox/netbox/extras/scripts.py", line 408, in run_script
    output = script.run(**kwargs)
  File "/opt/netbox/netbox/scripts/create_vm.py", line 98, in run
    add_addr(data["primary_ip4"], 4)
  File "/opt/netbox/netbox/scripts/create_vm.py", line 78, in add_addr
    vrf=data.get("vrf"),
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/opt/netbox/venv/lib/python3.6/site-packages/cacheops/query.py", line 390, in get
    return qs._no_monkey.get(qs, *args, **kwargs)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/query.py", line 404, in get
    clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/query.py", line 904, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/query.py", line 923, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1351, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1382, in _add_q
    check_filterable=check_filterable,
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1251, in build_filter
    lookups, parts, reffed_expression = self.solve_lookup_type(arg)
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1088, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "/opt/netbox/venv/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1484, in names_to_path
    "Choices are: %s" % (name, ", ".join(available)))
django.core.exceptions.FieldError: Cannot resolve keyword 'family' into field. Choices are: address, created, custom_field_values, description, dns_name, id, interface, interface_id, last_updated, nat_inside, nat_inside_id, nat_outside, primary_ip4_for, primary_ip6_for, role, services, status, tagged_items, tags, tenant, tenant_id, vrf, vrf_id

I am not a python dev, so I just worked around this issue by commenting out lines 77 and 84 which removes this text:

family=addr.version,

I assume this might not be a backward compatible change, but someone who knows better will have to decide. I just wanted to highlight it.

requirement missing

Thanks for the fine work.

I had to do a "pip install dnspython" though, to get it going.

broken with netbox 3.3.4

Server Error
There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'TypeError'>

__init__() got an unexpected keyword argument 'display_field'

Python version: 3.9.2
NetBox version: 3.3.4

[Housekeeping] Update Repo

This includes multiple tasks:

  • Correct doc links
  • Add linting & general CI
  • Add Issue templates
  • Add PR template
  • Update README.md
  • Add CONTRIBUTING.md

multi_connect.py ValueError

Throws this error when accessing the script.

<class 'ValueError'>

too many values to unpack (expected 2)

Python version: 3.8.10
NetBox version: 3.2.1

Unbundling of reports

In this repository, various reports from different people have been merged into the same source file - e.g. the single file reports/ipam-reports/ip-reports.py contains various IPAddress-related reports from different people.

I don't think this is a good idea. Reasons:

  1. As an end user: if I want to install report A without report B (because report B isn't useful in my environment), I don't want to have to extract report A from the source code.
  2. There are reports with overlapping functionality: e.g. in ip-reports, "test_primary_ip4" and "test_device_primary_ips". Again, as an end-user, I'm only going to want to install one or the other.
  3. The top of the source file imports all the dependencies for all the reports, and once these are merged, it becomes unclear which reports have which dependencies.
  4. It is difficult to track the author/contributor history of a particular report.

What I propose is that if an author submits a file, or a gist is copied in, then it should remain as-is - complete with its header of imports (and copyright/licence if present). It should only be necessary to rename the file or classes if they clash with an existing report.

I don't mind if the top-level folders ("ipam-reports" and "dcim-reports") are kept. It's not always going to be clear which category a particular report ends up in, but it doesn't really matter if it's miscategorised.

report to track deleted items

Hi
do we have a report that we can run to give us a list of all change log deleted items in the last hour/day/week?

can we have a script or report to notify the admins if tehre was a bulk of deleted objects in the last hour? (someone deleted >10 devices for example)

also, can we schedule jobs to send email results?

please advice
thanks

Add netbox script to automatically build device type

The relevant PR is located at

device-type-auto-generate

How to use scripts to automatically create device types

1. Put script and device-types/ in the directory specified by netbox

# cp scripts/device_type_init.py /opt/netbox/netbox/scripts
# cp -r device-types /opt/netbox/netbox/scripts

2. Log in to the netbox interface, Enter Other->Scripts interface

3. Choose the way you need to create Device-Type

You can create all, or specify the Manufacturer to create. There are the following options, generated from the catalog

  • ALL
  • APC
  • Alcatel-Lucent
  • Arista
  • Avocent
  • Cisco
  • Citrix
  • CyberPower
  • Dell
  • Eaton
  • Extreme
  • FS
  • Factor-TS
  • Fortinet
  • Generic
  • HPE
  • Infoblox
  • Infotecs
  • Juniper
  • Lenovo
  • MikroTik
  • Netonix
  • Opengear
  • Palo Alto
  • Testing
  • TrendNet
  • TrippLite
  • Ubiquiti
  • WTI

Preview

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.