Skip to content

Commit f62ca9f

Browse files
authored
New report: IS-IS nodes, areas, system IDs and IS-types (ipspace#2601)
1 parent d136d3b commit f62ca9f

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

netsim/reports/isis-nodes.html.j2

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{# description: IS-IS nodes and areas #}
2+
{% set node_list = nodes.values()|selectattr('isis','defined')|sort(attribute='isis.net') %}
3+
{% set rid_list = node_list|map(attribute='isis.router_id',default=False)|select|list %}
4+
{% for n in node_list if 'isis' in n %}
5+
{% if loop.first %}
6+
<table>
7+
<thead>
8+
<tr>
9+
<th>Node</th>
10+
{% if rid_list %}
11+
<th>Router ID</th>
12+
{% endif %}
13+
<th>IS-IS Area</th>
14+
<th>System ID</th>
15+
<th>IS Type</th>
16+
</tr>
17+
</thead>
18+
<tbody>
19+
{% endif %}
20+
<tr>
21+
<td>{{ n.name }}</td>
22+
{% if rid_list %}
23+
<td class="right">{{ n.isis.router_id|default('') }}</td>
24+
{% endif %}
25+
<td class="right">{{ n.isis.area }}</td>
26+
<td class="right">{{ n.isis.system_id }}</td>
27+
<td>{{ n.isis.type|default('') }}</td>
28+
</tr>
29+
{% if loop.last %}
30+
</tbody>
31+
</table>
32+
{% endif %}
33+
{% else %}
34+
Your network is not running IS-IS.
35+
{% endfor %}

netsim/reports/isis-nodes.j2

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{# description: IS-IS nodes and areas #}
2+
{% set node_list = nodes.values()|selectattr('isis','defined')|sort(attribute='isis.net') %}
3+
{% set rid_list = node_list|map(attribute='isis.router_id',default=False)|select|list %}
4+
{% set row_fmt = "| {0:15} | {2:>12} | {3:>14} | {4:9} |" %}
5+
{% set hdr_divider = "+-----------------+--------------+----------------+-----------+" %}
6+
{% set hdr_legend = "| Node | IS-IS area | System ID | IS Type |" %}
7+
{% if rid_list %}
8+
{% set row_fmt = "| {0:15} | {1:>15} | {2:>12} | {3:>14} | {4:9} |" %}
9+
{% set hdr_divider = "+-----------------+-----------------+--------------+----------------+-----------+" %}
10+
{% set hdr_legend = "| Node | Router ID | IS-IS area | System ID | IS Type |" %}
11+
{% endif %}
12+
{% for n in node_list if 'isis' in n %}
13+
{% if loop.first %}
14+
{{ hdr_divider }}
15+
{{ hdr_legend }}
16+
{{ hdr_divider }}
17+
{% endif %}
18+
{{ row_fmt.format(n.name,n.isis.router_id|default(''),n.isis.area,n.isis.system_id,n.isis.type|default('')) }}
19+
{% if loop.last %}
20+
{{ hdr_divider }}
21+
{% endif %}
22+
{% else %}
23+
Your network is not running IS-IS.
24+
{% endfor %}

netsim/reports/isis-nodes.md.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{# description: IS-IS nodes and areas #}
2+
{% set node_list = nodes.values()|selectattr('isis','defined')|sort(attribute='isis.net') %}
3+
{% set rid_list = node_list|map(attribute='isis.router_id',default=False)|select|list %}
4+
{% for n in node_list if 'isis' in n %}
5+
{% if loop.first %}
6+
| Node |{% if rid_list %} Router ID |{% endif %} IS-IS Area | System ID | IS type |
7+
|------|{% if rid_list %}----------:|{% endif %}-----------:|----------:|---------|
8+
{% endif %}
9+
| {{ n.name }} |{% if rid_list
10+
%} {{ n.isis.router_id|default('') }} |{% endif
11+
%} {{ n.isis.area }} | {{ n.isis.system_id }} | {{ n.isis.type|default('') }} |
12+
{% else %}
13+
Your network is not running IS-IS.
14+
{% endfor %}

0 commit comments

Comments
 (0)