diff --git a/docs/extras.md b/docs/extras.md index 7144804db..bd47d35d9 100644 --- a/docs/extras.md +++ b/docs/extras.md @@ -56,3 +56,21 @@ NetBox does not generate graphs itself. This feature allows you to embed context * **Name:** The title to display above the graph. * **Source URL:** The source of the image to be embedded. The associated object will be available as a template variable named `obj`. * **Link URL (optional):** A URL to which the graph will be linked. The associated object will be available as a template variable named `obj`. + +# Topology Maps + +NetBox can generate simple topology maps from the physical network connections recorded in its database. First, you'll need to create a topology map definition under the admin UI at Extras > Topology Maps. + +Each topology map is associated with a site. A site can have multiple topology maps, which might each illustrate a different aspect of its infrastructure (for example, production versus backend connectivity). + +To define the scope of a topology map, decide which devices you want to include. The map will only include interface connections with both points terminated on an included device. Specify the devices to include in the **device patterns** field by entering a list of [regular expressions](https://en.wikipedia.org/wiki/Regular_expression) matching device names. For example, if you wanted to include "mgmt-switch1" through "mgmt-switch99", you might use the regex `mgmt-switch\d+`. + +Each line of the **device patterns** field represents a hierarchical layer within the topology map. For example, you might map a traditional network with core, distribution, and access tiers like this: + +``` +core-switch-[abcd] +dist-switch\d +access-switch\d+,oob-switch\d+ +``` + +Note that you can combine multiple regexes onto one line using commas. (Commas can only be used for separating regexes; they will not be processed as part of a regex.) The order in which regexes are listed on a line is significant: devices matching the first regex will be rendered first, and subsequent groups will be rendered to the right of those. diff --git a/docs/getting-started.md b/docs/getting-started.md index 76065c57a..1d657fbf3 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -57,11 +57,14 @@ You can verify that authentication works using the following command: * libxml2-dev * libxslt1-dev * libffi-dev +* graphviz* ``` -# apt-get install python2.7 python-dev git python-pip libxml2-dev libxslt1-dev libffi-dev +# apt-get install python2.7 python-dev git python-pip libxml2-dev libxslt1-dev libffi-dev graphviz ``` +*graphviz is needed to render topology maps. If you have no need for this feature, graphviz is not required. + ## Clone the Git Repository Create the base directory for the NetBox installation. For this guide, we'll use `/opt/netbox`. diff --git a/netbox/templates/_base.html b/netbox/templates/_base.html index 252b88948..1513b302b 100644 --- a/netbox/templates/_base.html +++ b/netbox/templates/_base.html @@ -244,9 +244,9 @@

- Docs · - API · - Code + Docs · + API · + Code

diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 8c5e8130d..e6425ecb9 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -132,7 +132,7 @@ {% for tm in topology_maps %} - + {% endfor %} diff --git a/netbox/templates/docs.html b/netbox/templates/docs.html index 6360ee482..9875232d4 100644 --- a/netbox/templates/docs.html +++ b/netbox/templates/docs.html @@ -18,6 +18,7 @@ IPAMCircuitsSecrets + Extras diff --git a/netbox/utilities/tables.py b/netbox/utilities/tables.py index 8f494d609..724e96056 100644 --- a/netbox/utilities/tables.py +++ b/netbox/utilities/tables.py @@ -19,8 +19,11 @@ class BaseTable(tables.Table): class ToggleColumn(tables.CheckBoxColumn): - default = '' - visible = False + + def __init__(self, *args, **kwargs): + default = kwargs.pop('default', '') + visible = kwargs.pop('visible', False) + super(ToggleColumn, self).__init__(*args, default=default, visible=visible, **kwargs) @property def header(self):
{{ tm }} {{ tm }} {{ tm.description }}