Loading scripts/inventory/INV_NET_01/INV_NET_01_script.txt 0 → 100644 +13 −0 Original line number Diff line number Diff line set feedback_to_output true ne load ne.yaml # set logging_config logging_config.yaml # Retreive data from NEs connect netconf --filter-file lldp_filter.xml netconf close-session # Formating data table from_xml --xsl-transform lldp_transform.xsl table concat table to_excel lldp.xlsx scripts/inventory/INV_NET_01/README.md 0 → 100644 +7 −0 Original line number Diff line number Diff line # INV_NET_01 The _INV_NET_01_script.txt_ script should product the adjacencies inventory using ieee802-dot1ab-lldp module ([see on YANG Catalog](https://yangcatalog.org/yang-search/module_details/ieee802-dot1ab-lldp@2021-09-14)). ```console $ python3 lncc.py "run_script INV_NET_01_script.txt" ``` scripts/inventory/INV_NET_01/lldp_filter.xml 0 → 100644 +2 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <lldp xmlns="urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp" /> scripts/inventory/INV_NET_01/lldp_transform.xsl 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <lldp> <xsl:for-each select="nc:data/lldp:lldp/lldp:port/lldp:remote-systems-data" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:lldp="urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"> <adjacency> <remote-chassis-id-subtype><xsl:value-of select="lldp:chassis-id-subtype" /></remote-chassis-id-subtype> <remote-chassis-id><xsl:value-of select="lldp:chassis-id" /></remote-chassis-id> <remote-system-name><xsl:value-of select="lldp:system-name" /></remote-system-name> <remote-system-description><xsl:value-of select="lldp:system-description" /></remote-system-description> <remote-port-id-subtype><xsl:value-of select="lldp:port-id-subtype" /></remote-port-id-subtype> <remote-port-id><xsl:value-of select="lldp:port-id" /><remote-port-id> <remote-port-desc><xsl:value-of select="lldp:port-desc" /><remote-port-desc> <local-chassis-id-subtype><xsl:value-of select="../lldp:port-id-subtype" /></local-chassis-id-subtype> <local-chassis-id><xsl:value-of select="../lldp:port-id" /></local-chassis-id> <local-port-desc><xsl:value-of select="../lldp:port-desc" /></local-port-desc> <local-port-name><xsl:value-of select="../lldp:name" /></local-port-name> <local-mac-address><xsl:value-of select="../lldp:dest-mac-address" /></local-mac-address> <local-chassis-id-subtype><xsl:value-of select="../../lldp:local-system-data/lldp:chassis-id-subtype" /></local-chassis-id-subtype> <local-chassis-id><xsl:value-of select="../../lldp:local-system-data/lldp:chassis-id" /></local-chassis-id> <local-system-name><xsl:value-of select="../../lldp:local-system-data/lldp:system-name" /></local-system-name> <local-system-description><xsl:value-of select="../../lldp:local-system-data/lldp:system-description" /></local-system-description> </adjacency> </xsl:for-each> </lldp> </xsl:template> </xsl:stylesheet> Loading
scripts/inventory/INV_NET_01/INV_NET_01_script.txt 0 → 100644 +13 −0 Original line number Diff line number Diff line set feedback_to_output true ne load ne.yaml # set logging_config logging_config.yaml # Retreive data from NEs connect netconf --filter-file lldp_filter.xml netconf close-session # Formating data table from_xml --xsl-transform lldp_transform.xsl table concat table to_excel lldp.xlsx
scripts/inventory/INV_NET_01/README.md 0 → 100644 +7 −0 Original line number Diff line number Diff line # INV_NET_01 The _INV_NET_01_script.txt_ script should product the adjacencies inventory using ieee802-dot1ab-lldp module ([see on YANG Catalog](https://yangcatalog.org/yang-search/module_details/ieee802-dot1ab-lldp@2021-09-14)). ```console $ python3 lncc.py "run_script INV_NET_01_script.txt" ```
scripts/inventory/INV_NET_01/lldp_filter.xml 0 → 100644 +2 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <lldp xmlns="urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp" />
scripts/inventory/INV_NET_01/lldp_transform.xsl 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <lldp> <xsl:for-each select="nc:data/lldp:lldp/lldp:port/lldp:remote-systems-data" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:lldp="urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"> <adjacency> <remote-chassis-id-subtype><xsl:value-of select="lldp:chassis-id-subtype" /></remote-chassis-id-subtype> <remote-chassis-id><xsl:value-of select="lldp:chassis-id" /></remote-chassis-id> <remote-system-name><xsl:value-of select="lldp:system-name" /></remote-system-name> <remote-system-description><xsl:value-of select="lldp:system-description" /></remote-system-description> <remote-port-id-subtype><xsl:value-of select="lldp:port-id-subtype" /></remote-port-id-subtype> <remote-port-id><xsl:value-of select="lldp:port-id" /><remote-port-id> <remote-port-desc><xsl:value-of select="lldp:port-desc" /><remote-port-desc> <local-chassis-id-subtype><xsl:value-of select="../lldp:port-id-subtype" /></local-chassis-id-subtype> <local-chassis-id><xsl:value-of select="../lldp:port-id" /></local-chassis-id> <local-port-desc><xsl:value-of select="../lldp:port-desc" /></local-port-desc> <local-port-name><xsl:value-of select="../lldp:name" /></local-port-name> <local-mac-address><xsl:value-of select="../lldp:dest-mac-address" /></local-mac-address> <local-chassis-id-subtype><xsl:value-of select="../../lldp:local-system-data/lldp:chassis-id-subtype" /></local-chassis-id-subtype> <local-chassis-id><xsl:value-of select="../../lldp:local-system-data/lldp:chassis-id" /></local-chassis-id> <local-system-name><xsl:value-of select="../../lldp:local-system-data/lldp:system-name" /></local-system-name> <local-system-description><xsl:value-of select="../../lldp:local-system-data/lldp:system-description" /></local-system-description> </adjacency> </xsl:for-each> </lldp> </xsl:template> </xsl:stylesheet>