cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
939
Views
0
Helpful
4
Replies

Getting VPC information from NX-OS API

bruno.dias
Level 1
Level 1

Hi,

I have a question while trying to build an app that's monitoring vPC status.

I'm using 'show vpc role' command to get the data as XML and parse in my app.

However, I'm getting different results from CLI and from the API, which is causing some confusion to me.

 

When I execute the command 'show vpc role' on CLI, I get this response where 'dual active detection status' is 0:

MicrosoftTeams-image (32).png 

When I execute this command via API, I get this property with value 1024:

<?xml version="1.0"?>
<ins_api>
<type>cli_show</type>
<version>1.0</version>
<sid>eoc</sid>
<outputs>
<output>
<body>
<vpc-peer-status>peer-ok</vpc-peer-status>
<vpc-peer-status-reason>SUCCESS</vpc-peer-status-reason>
<vpc-current-role>secondary</vpc-current-role>
<dual-active-detected>1024</dual-active-detected>
<vpc-system-mac>00:23:04:ee:be:14</vpc-system-mac>
<vpc-system-prio>32667</vpc-system-prio>
<vpc-local-system-mac>c4:b2:39:92:b9:87</vpc-local-system-mac>
<vpc-local-system-prio>32667</vpc-local-system-prio>
</body>
<input>show vpc role</input>
<msg>Success</msg>
<code>200</code>
</output>
</outputs>
</ins_api>

 How should I interpret the 1024 value?

4 Replies 4

Hello,

 

what if you add the line marked in bold ?

 

<?xml version="1.0"?>
<ins_api>
<type>cli_show</type>
<version>1.0</version>
<sid>eoc</sid>
<outputs>
<output>
<body>
<vpc-peer-status>peer-ok</vpc-peer-status>
<vpc-peer-status-reason>SUCCESS</vpc-peer-status-reason>
<vpc-current-role>secondary</vpc-current-role>
<dual-active-detected>1024</dual-active-detected>
<vpc-system-mac>00:23:04:ee:be:14</vpc-system-mac>
<vpc-system-prio>32667</vpc-system-prio>
<vpc-local-system-mac>c4:b2:39:92:b9:87</vpc-local-system-mac>
<vpc-local-system-prio>32667</vpc-local-system-prio>
</body>
<input>show vpc role</input>
<msg>Success</msg>
<code>200</code>
<output_format>xml</output_format>
</output>
</outputs>
</ins_api>

Hey Georg,

 

I'm not understanding your reply, as the XML that I posted in the question is the NX-OS response from the Nexus switch.

The request that we are sending to the switch indeed contains the ouput_format field set to XML.

Hello,

 

sorry for the misunderstanding, the output_format is supposed to be in the request. You say it is already in there, so that cannot be the issue. Can you post the entire app code you are using ?

 

I have tried to find a relation between the number 1024 and the actual output '0' ( which apparently means that DAD has been detected). Can you try and find out what value is returned when DAD is not active ?

Hi,

Unfortunately we can't change this value on this setup - honestly, I don't know much about Cisco Nexus to trigger that change.

 

Review Cisco Networking for a $25 gift card