
If you’ve spent any time in a data center, you know how crucial a good cable cut sheet can be. Whether it’s a new rack deployment or a mass re-cabling project, having a clear list of which cable goes where is a lifesaver.
NetBox has become the go-to source-of-truth for network infrastructure for a huge number of engineers and naturally, one thing that comes up often is the ability to generate cut sheets, a need which is only accelerating now that AI datacenters are using NetBox to deploy hardware at unprecedented volumes.
One powerful way to approach this is to use the Export Templates feature of NetBox. Export Templates let you define custom output formats for any object type – including cables. Under the hood, it’s all done with Jinja templates.
You write a little script in Jinja that loops over a set of objects (in this case, the cables you’ve selected or filtered in NetBox) and formats the data however you want. The beauty here is flexibility: instead of the default CSV or table, you can tailor the cut sheet to include exactly the info you need, in the order and format you need it. NetBox will then make this template available under the Export button on the cables list view, so you can generate your custom cut sheet on demand. Let’s work through some examples so you can get the hang of it.
Tip: To follow along, sign-up for a NetBox cloud free plan instance and when asked “Do you want demo data included in your instance?” select “Yes”
At a minimum DC engineers need to know which interface on which device each end of each cable needs to connect to. To achieve this we can use a simple export template like this one which loops through all our cables and outputs the Cable ID, A-side Device, A-side Port, B-side Device, and B-side Port.
In NetBox:
Now to access your cut sheet:
In there you will see the cut sheet information, in CSV format which can now be loaded into a spreadsheet, or some other tool, for a DC engineer to use.
While our simple cut sheet is a good start, datacenters can be noisy and disorienting places so it would be useful if we could add more information to our cut sheet to help our DC engineers get their jobs done. Let’s start by adding the cable type and length.
Add a new export template for cables with this template code:
Which yields the following output:
Of course we can go further by telling our DC engineers more about the physical port each end of the cable lands on; whether it’s an interface, a front port, a rear port, or something else.
Tip: You aren’t limited to CSV; try adapting the export template to output JSON instead.
Add a new export template for cables with this template code:
Which yields the following output:
Summary
In this brief how-to guide we’ve seen how the NetBox Export Templates feature provides a powerful mechanism to generate cabling cut sheets to fit your organizations needs. I encourage you to try creating your own, and if you need or want to share your creations, I encourage you to join thousands of other NetBox users in the NetDev Slack.