Page MenuHomePhabricator

Netbox: cable termination names report
Closed, ResolvedPublic

Description

From https://phabricator.wikimedia.org/T205897#4950310

In order to avoid typos and incoherence in devices' component naming, it would be useful to have a report if they don't match a specific pattern per types.

Cables termination types are listed in https://github.com/digitalocean/netbox/blob/master/netbox/dcim/constants.py#L391

We should have a list of regex allowed per types.
Eg. from the currently used ports:

TypeAllowed names
consoleportconsole\d,console-re\d
consoleserverportport\d+
powerportPSU\d, PEM \d, Power Supply \d
poweroutlet\d+
interface[a-z]+-\d+/\d+/\d+(\.\d+){0,1}, [a-z]\d+(\.\d+){0,1}
frontport\d+
rearport\d+

Details

Related Gerrit Patches:
operations/software/netbox-reports : masterAdd cable names report

Event Timeline

ayounsi triaged this task as Lowest priority.Feb 19 2019, 3:25 AM
ayounsi created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 19 2019, 3:26 AM
Volans moved this task from Backlog to Up next on the SRE-tools board.

Presumably you'd like to surface the particular parent device on that termination point ?

No strong preferences, but indeed "Device X has Y miss-labelled" is an option.

Just a note the models are a bit confused here. The termination is identified in the cable, i'm not sure that there are ports without cables or if that is important, but it's far easier to identify ports via the cables instead of independently - though not impossible, it'd just require going through each port model separately which I guess is no big deal but just whatever the preference is.

Change 513003 had a related patch set uploaded (by CRusnov; owner: CRusnov):
[operations/software/netbox-reports@master] Add cable names report

https://gerrit.wikimedia.org/r/513003

Sample output:

test_console_port_termination_names
2019-05-28T22:36:24.654134+00:00	Success		211 correctly named console port cable terminations
test_power_outlet_termination_names
2019-05-28T22:36:24.755409+00:00	Success		248 correctly named power outlet cable terminations
test_power_port_termination_names
2019-05-28T22:36:24.763114+00:00	Success		105 correctly named power port cable terminations
test_interface_termination_names
2019-05-28T22:36:24.701783+00:00	Failure	bast5001	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.704047+00:00	Failure	cp5001	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.706287+00:00	Failure	cp5002	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.708430+00:00	Failure	cp5003	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.710663+00:00	Failure	cp5004	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.712868+00:00	Failure	cp5005	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.715046+00:00	Failure	cp5006	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.717207+00:00	Failure	cp5007	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.719267+00:00	Failure	cp5008	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.721360+00:00	Failure	cp5009	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.723472+00:00	Failure	cp5010	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.725563+00:00	Failure	cp5011	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.727520+00:00	Failure	cp5012	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.729598+00:00	Failure	dns5001	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.731574+00:00	Failure	dns5002	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.733542+00:00	Failure	lvs5001	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.735427+00:00	Failure	lvs5002	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.737306+00:00	Failure	lvs5003	incorrectly named interface cable termination: DRAC
2019-05-28T22:36:24.739397+00:00	Failure	cr1-eqsin	incorrectly named interface cable termination: fxp0-re0
2019-05-28T22:36:24.741397+00:00	Failure	cr1-eqsin	incorrectly named interface cable termination: fxp0-re1
2019-05-28T22:36:24.741590+00:00	Success		252 correctly named interface cable terminations
test_console_server_port_termination_names
2019-05-28T22:36:24.667620+00:00	Success		240 correctly named console server port cable terminations

Note I've discussed with @ayounsi these failure conditions. I believe as part of the DNS automation proposal we've concurred on the name of the management interfaces to be mgmt, so the DRAC interfaces are legitimately things that need to be fixed. fixp0-? are I think a compromise with having two devices that from software are separate (because in Netbox they are one machine, but from software they are two separate machines (routing engines)), so the device name is the first part and a label for the routing engine in the second part.

After a discussion with Faidon, I think the general consensus is that DRAC (and ILO) should be an acceptable termination name for managament interfaces, in addition to, going forward, the normal default being mgmt\d? (enumerated in the case of tehre being multiple interfaces).

crusnov moved this task from Up next to In Code Review on the SRE-tools board.May 29 2019, 5:57 PM

Change 513003 merged by CRusnov:
[operations/software/netbox-reports@master] Add cable names report

https://gerrit.wikimedia.org/r/513003

crusnov closed this task as Resolved.Jun 25 2019, 4:04 PM