Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request cable tag field for all connection types #923

Closed
flyingrhinonz opened this issue Feb 28, 2017 · 16 comments
Closed

Request cable tag field for all connection types #923

flyingrhinonz opened this issue Feb 28, 2017 · 16 comments
Labels
status: duplicate This issue has already been raised

Comments

@flyingrhinonz
Copy link

Firstly, thanks for a wonderful program that is so useful to all of us who work in data centers.
Secondly, thanks for making it open source for us to share and improve.

In our data center we tag each cable with a unique code (same code at both ends of the cable), so that any engineer can lookup the code and instantly knows where it connects.
It's worked great for us while our DC maps were in txt and xls files. Now we're moving to netbox and we really miss cable tag functionality that we'd like to associate with connections.

I've added a custom cable-tag field to "circuits" , but as far as I see, there's no way to add a custom field to any of the "connections" . At present we're inserting the cable tag into the connection name (interfaces, power, etc).

I request a feature where either the connections already have a "Cable Tag" text field (about 8+ alphanumeric is enough for us, but other might want longer).

Alternatively, can you add an option to "Custom fields" where this field may be added to Connections ?
Searchable field please.

If the above two are two hard, can you add an option to search the connections names ? Then we'll continue putting the cable tag into the name field.

Finally, is there a way for me to manually configure this ? Like edit some config file ?
I'm not a programmer, so editing the code is beyond my ability :(

Thanks

@quentindavid
Copy link

quentindavid commented Feb 28, 2017

+1, but this is a duplicate...

@flyingrhinonz
Copy link
Author

My apologies, I did look for this feature request before posting mine but didn't spot any. Must have missed it.

@quentindavid
Copy link

look at #20

@jeremystretch
Copy link
Member

This is indeed covered by the mega-feature request of #20, but I'll comment:

The reason we don't include a cable label field on a connection is that a connection will likely comprise more than one physical cable. For example, an interface might connect to a patch panel, which connects to another patch panel, and finally to the peer interface. We want to ensure that we can support this model in the future, so we omit the concept of labeling for now to avoid future confusion.

@jeremystretch jeremystretch added the status: duplicate This issue has already been raised label Feb 28, 2017
@quentindavid
Copy link

Hi @jeremystretch, I understand, but a first "simple" solution would be to allow the naming of connections, without consideration for "patch panels".
By the way, could we just imagine patch panels like any other device, with connections from and to it ?

@jeremystretch
Copy link
Member

but a first "simple" solution would be to allow the naming of connections, without consideration for "patch panels".

Unfortunately, today's "simple" solution inevitably becomes tomorrow's technical debt. If cable labeling is a must-have feature for you, NetBox simply isn't the right solution (yet).

could we just imagine patch panels like any other device, with connections from and to it?

There are two concepts in which we consider links: logically and physically. The logical concept entails the end-to-end connection as an atomic unit; e.g. eth0 on device A connected to ge-0/0/12 on device B. This is what NetBox models today.

The physical concept exists in parallel as a sort of underlay. In this model, we'd track individual cables, patch panels, etc. It would be extremely inefficient to have to parse the physical model only to determine the two logical endpoints of a connection, so we want to model it separately. Additionally, we need a model capable of expressing the many nuances of a cabling plant. For example, we should be able to define a patch panel which has LC fiber connections on the front, and MPO trunks on the back, and still be able to trace a single pair through it.

@quentindavid
Copy link

I understand, then would it be possible to give an ID to each connection, in a logical point of view ?
Because as I understand, another model to create and to implement is not really easy and quickly possible ^^

Thanks a lot for your work ;)

@flyingrhinonz
Copy link
Author

Thanks for the responses.

How about the option of adding a custom field to the connection? In this way it is not directly tied to netbox development, yet allows us to manage cable tags.
It's possible to add a custom field to many other tables in netbox, and I assume that every custom field is treated as external data. Therefore, if you allowed us to add a text field to connections (searchable please), then it would serve our purpose, and at the same time not impede any future netbox roadmap.

BTW, in our company, if a cable connects from a server to a switch to another switch to a server, these are counted as 3 separate cables , each cable with a unique tag (identical at it's own two ends).

In any case, netbox is awesome, and without it - we'd be using xls and txt files. Great work !

@quentindavid
Copy link

indeed, a custom field would be enough :)

@flyingrhinonz
Copy link
Author

I'm liking the idea of a custom field.
This should not in any way interfere with netbox roadmap.

What's better - Should I open a new issue for this request, or should this thread be reopened ?

Thanks.

Together we'll make a good thing even better !

@jeremystretch
Copy link
Member

We will not be adding custom fields to interface connections. As discussed, support for labels will be added as part of #20.

@MeisiCB
Copy link

MeisiCB commented Mar 4, 2018

@quentindavid If your really want the Cable ID (now), just fork this project and change this files:

Made with Version 2.3.1

  1. Change the Database:
    ALTER TABLE public.dcim_interfaceconnection ADD COLUMN connection_comments text;

  2. Change File netbox/netbox/dcim/forms.py
    Before Line 2052 (class Meta: model = InterfaceConnection ) insert
    connection_comments = forms.CharField(max_length=100, required=False, label='Cable ID')

some lines below change
fields = ['interface_a', 'site_b', 'rack_b', 'device_b', 'interface_b', 'livesearch', 'connection_status']
to
fields = ['interface_a', 'site_b', 'rack_b', 'device_b', 'interface_b', 'livesearch', 'connection_status','connection_comments']

  1. Change File netbox/netbox/dcim/models.py
    After Line 1518 (connection_status = models.Boolean ...) insert

connection_comments = models.TextField(blank=True)

  1. Change File netbox/netbox/templates/dcim/inc/interface.html
    On Line 50 change
    <span title="{{ connected_iface.get_form_factor_display }}">{{ connected_iface }}</span>
    to
                 <span title="{{ connected_iface.get_form_factor_display }}">{{ connected_iface }}
               {% if iface.connection.connection_comments %}
                   Cable ID: {{ iface.connection.connection_comments }}
               {% endif %}
               </span>

  1. Change File netbox/netbox/templates/dcim/interfaceconnection_edit.html
    After Line 82 ( {% render_field form.connection_status ...) insert

{% render_field form.connection_comments %}

  1. Restart Python:
    service supervisor restart

You will get this:

netbox-1
netbox-2

@flyingrhinonz
Copy link
Author

Thanks for the tip. I'll try that out.
Meanwhile I already did my own workaround last year by putting the cable IDs into the interface name. It doesn't search, but it does give visibility. At present I have many machines in netbox commented this way.

@martin8883
Copy link

martin8883 commented Apr 18, 2018

Thank you for the workaround, works great.
Until #20 is done here an addition to show the Cable ID in the interface connection table:
In file netbox/netbox/dcim/tables.py add after line 594 (in v2.3.2) (interface_b = tables.Column(verbose_name='Interface B'))
connection_comments = tables.Column(verbose_name='Cable ID')
and change following
fields = ('device_a', 'interface_a', 'device_b', 'interface_b')
to
fields = ('device_a', 'interface_a', 'device_b', 'interface_b', 'connection_comments')

@Atoms
Copy link

Atoms commented Jul 4, 2018

our use case would be mark connections created by script so script does not delete manually created connections, manually created connections in our case is cause not all our devices provide LLDP

@robbagithub
Copy link

Propper adoption of the Cable ID is the only thing stopping us rolling this out for all data centres.

It really is becoming an important component of DC management.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate This issue has already been raised
Projects
None yet
Development

No branches or pull requests

7 participants