05-16-2016 05:08 PM - edited 03-01-2019 04:28 AM
Hi All,
All the API of interface are providing only some static information like IP address configured and device ID. Is there anyway we can get complete port traffic statistics (other than flow-analysis).
Thanks
KAUSHIK K
05-20-2016 08:29 AM
There isn't a general stats model yet. What I've been doing is using the APIC-EM inventory to get CLI/SNMP credentials and using direct device access to grab additional information. As we see RESTCONF/NETCONF take shape, that will be an alternative to gather operational data until models are added to APIC-EM itself.
05-20-2016 04:13 PM
Thank you Clarke,
Can you give me an example if you have. I want to know how you used REST API to pass CLI commands and how you retrieved output.
05-24-2016 07:13 AM
Sorry I wasn't clear. I did not use APIC-EM to send CLI commands directly. I used APIC-EM to provide my script credentials, and then I was able to login (using the Python paramiko module) to get the additional data. If you need to use an API, and you have Prime Infrastructure, then Adam's suggestion is a good one.
If you want an example of what I did, check out https://communities.cisco.com/docs/DOC-63760 .
05-22-2016 09:10 PM
The other way you could do this today, is to use the Prime Infrastructure API. For example to get tx statistics, you could use the following request. By default it returns the samples for the past hour, but you can get historical as well.
curl -k 'https://user:password@adam-pi/webacs/api/vService/interfaces/metrics/tx?device=10.10.14.2&ifName=GigabitEthernet1/0/1'
<?xml version="1.0" ?>
<mgmtResponse responseType="operation" requestUrl="https://adam-pi/webacs/api/v2/op/statisticsService/interfaces/metrics/tx?device=10.10.14.2&amp;ifName=GigabitEthernet1/0/1" rootUrl="https://adam-pi/webacs/api/v2/op">
<metricData>
<currentDateTime>1463959584671</currentDateTime>
<description>Interface performance metric for tx</description>
<metricName>tx</metricName>
<metricRows>
<metricRows>
<XValue>1463956480</XValue>
<YValues>
<YValues>756.0</YValues>
</YValues>
</metricRows>
<metricRows>
<XValue>1463957382</XValue>
<YValues>
<YValues>2021.0</YValues>
</YValues>
</metricRows>
<metricRows>
<XValue>1463958285</XValue>
<YValues>
<YValues>756.0</YValues>
</YValues>
</metricRows>
<metricRows>
<XValue>1463959187</XValue>
<YValues>
<YValues>2036.0</YValues>
</YValues>
</metricRows>
</metricRows>
<resourceName>
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide