Loading scripts/inventory/INV_PORT_01/INV_PORT_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 ethernet_filter.xml netconf close-session # Formating data table from_xml --xsl-transform ethernet_transform.xsl table concat table to_excel ethernet.xlsx scripts/inventory/INV_PORT_01/README.md 0 → 100644 +7 −0 Original line number Diff line number Diff line # INV_PORT_01 The _INV_PORT_01_script.txt_ script should product the adjacencies inventory using ieee802-ethernet-interface module ([see on YANG Catalog](https://yangcatalog.org/yang-search/module_details/ieee802-ethernet-interface@2019-06-21)). ```console $ python3 lncc.py "run_script INV_PORT_01_script.txt" ``` scripts/inventory/INV_PORT_01/ethernet_filter.xml 0 → 100644 +6 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface> <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type> </interface> </interfaces> scripts/inventory/INV_PORT_01/ethernet_transform.xsl 0 → 100644 +24 −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="/"> <interfaces> <xsl:for-each select="nc:data/if:interfaces/if:interface" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:ieee802-eth-if=" urn:ieee:std:802.3:yang:ieee802-ethernet-interface"> <interface> <xsl:copy-of select="if:name" /> <xsl:copy-of select="if:type" /> <xsl:copy-of select="if:description" /> <xsl:copy-of select="if:admin-status" /> <xsl:copy-of select="if:oper-status" /> <xsl:copy-of select="if:phys-address" /> <xsl:copy-of select="ieee802-eth-if:ethernet/ieee802-eth-if:duplex" /> <xsl:copy-of select="ieee802-eth-if:ethernet/ieee802-eth-if:speed" /> <auto-negotiation><xsl:value-of select="ieee802-eth-if:ethernet/ieee802-eth-if:auto-negotiation/ieee802-eth-if:enable" /></auto-negotiation> <xsl:copy-of select="ieee802-eth-if:ethernet/ieee802-eth-if:auto-negotiation/ieee802-eth-if:negotiation-status" /> </interface> </xsl:for-each> </interfaces> </xsl:template> </xsl:stylesheet> Loading
scripts/inventory/INV_PORT_01/INV_PORT_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 ethernet_filter.xml netconf close-session # Formating data table from_xml --xsl-transform ethernet_transform.xsl table concat table to_excel ethernet.xlsx
scripts/inventory/INV_PORT_01/README.md 0 → 100644 +7 −0 Original line number Diff line number Diff line # INV_PORT_01 The _INV_PORT_01_script.txt_ script should product the adjacencies inventory using ieee802-ethernet-interface module ([see on YANG Catalog](https://yangcatalog.org/yang-search/module_details/ieee802-ethernet-interface@2019-06-21)). ```console $ python3 lncc.py "run_script INV_PORT_01_script.txt" ```
scripts/inventory/INV_PORT_01/ethernet_filter.xml 0 → 100644 +6 −0 Original line number Diff line number Diff line <?xml version="1.0"?> <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface> <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type> </interface> </interfaces>
scripts/inventory/INV_PORT_01/ethernet_transform.xsl 0 → 100644 +24 −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="/"> <interfaces> <xsl:for-each select="nc:data/if:interfaces/if:interface" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:ieee802-eth-if=" urn:ieee:std:802.3:yang:ieee802-ethernet-interface"> <interface> <xsl:copy-of select="if:name" /> <xsl:copy-of select="if:type" /> <xsl:copy-of select="if:description" /> <xsl:copy-of select="if:admin-status" /> <xsl:copy-of select="if:oper-status" /> <xsl:copy-of select="if:phys-address" /> <xsl:copy-of select="ieee802-eth-if:ethernet/ieee802-eth-if:duplex" /> <xsl:copy-of select="ieee802-eth-if:ethernet/ieee802-eth-if:speed" /> <auto-negotiation><xsl:value-of select="ieee802-eth-if:ethernet/ieee802-eth-if:auto-negotiation/ieee802-eth-if:enable" /></auto-negotiation> <xsl:copy-of select="ieee802-eth-if:ethernet/ieee802-eth-if:auto-negotiation/ieee802-eth-if:negotiation-status" /> </interface> </xsl:for-each> </interfaces> </xsl:template> </xsl:stylesheet>