<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Netconf - How to get Interface Statistics? in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/netconf-how-to-get-interface-statistics/m-p/4489263#M2331</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/143001"&gt;@NetDevOp&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to make sure you're aware of the following free resource on DevNet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://devnetsandbox.cisco.com/RM/Diagram/Index/883f8ea6-54a1-453e-98f5-fc175a2a90de?diagramType=Topology" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;IOS XR Programmability Sandbox&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://devnetsandbox.cisco.com/RM/Diagram/Index/e83cfd31-ade3-4e15-91d6-3118b867a0dd?diagramType=Topology" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;IOS XR Always-On Sandbox&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With these IOS XR Sandboxes, you can 't&lt;/SPAN&gt;est drive APIs at every layer of the IOS XR network stack from model-driven YANG manageability APIs and ZTP hooks for CLI automation to highly performant Service-Layer APIs at the infrastructure layer – all just a click away. This sandbox provides access to two IOS XRv9000 instances along with a development environment (devbox) to install and utilize tools of your choice to interact with IOS XR.'&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 14:37:54 GMT</pubDate>
    <dc:creator>Alexander Stevenson</dc:creator>
    <dc:date>2021-10-20T14:37:54Z</dc:date>
    <item>
      <title>Netconf - How to get Interface Statistics?</title>
      <link>https://community.cisco.com/t5/controllers/netconf-how-to-get-interface-statistics/m-p/4479597#M2330</link>
      <description>&lt;P&gt;I can't seem to get interface statistics from IOS XR devices... I've tried a few different filters but the only result is null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A similar method to get NTP status works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the python code:&lt;/P&gt;&lt;PRE&gt;from ncclient import manager
import xmltodict
import json

ncm = manager.connect(host='10.10.10.1', port=830, username='cisco',
password='cisco123', device_params={'name': 'iosxr'}, timeout=100)



print(ncm.connected)



vf = """

&amp;lt;filter type="subtree"&amp;gt;
&amp;lt;interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"&amp;gt;
&amp;lt;interfaces-state&amp;gt;
&amp;lt;/interfaces-state&amp;gt;
&amp;lt;/interfaces&amp;gt;
&amp;lt;/filter&amp;gt;"""


software_data = ncm.get(vf)

software_json = xmltodict.parse(str(software_data))

print(json.dumps(software_json['rpc-reply'], indent=2))&lt;/PRE&gt;&lt;P&gt;I've also tried filters using ifoper-mgr, like this:&lt;/P&gt;&lt;PRE&gt;vf = """
&amp;lt;filter type="subtree"&amp;gt;
 &amp;lt;ifmgr-oper xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-oper"&amp;gt;
  &amp;lt;interface-properties&amp;gt; 
   &amp;lt;data-nodes/&amp;gt;
  &amp;lt;/interface-properties&amp;gt;
 &amp;lt;/ifmgr-oper&amp;gt;
&amp;lt;/filter&amp;gt;
"""&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 15:09:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/netconf-how-to-get-interface-statistics/m-p/4479597#M2330</guid>
      <dc:creator>NetDevOp</dc:creator>
      <dc:date>2021-10-05T15:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Netconf - How to get Interface Statistics?</title>
      <link>https://community.cisco.com/t5/controllers/netconf-how-to-get-interface-statistics/m-p/4489263#M2331</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/143001"&gt;@NetDevOp&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to make sure you're aware of the following free resource on DevNet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://devnetsandbox.cisco.com/RM/Diagram/Index/883f8ea6-54a1-453e-98f5-fc175a2a90de?diagramType=Topology" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;IOS XR Programmability Sandbox&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://devnetsandbox.cisco.com/RM/Diagram/Index/e83cfd31-ade3-4e15-91d6-3118b867a0dd?diagramType=Topology" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;IOS XR Always-On Sandbox&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With these IOS XR Sandboxes, you can 't&lt;/SPAN&gt;est drive APIs at every layer of the IOS XR network stack from model-driven YANG manageability APIs and ZTP hooks for CLI automation to highly performant Service-Layer APIs at the infrastructure layer – all just a click away. This sandbox provides access to two IOS XRv9000 instances along with a development environment (devbox) to install and utilize tools of your choice to interact with IOS XR.'&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 14:37:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/netconf-how-to-get-interface-statistics/m-p/4489263#M2331</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2021-10-20T14:37:54Z</dc:date>
    </item>
  </channel>
</rss>

