Querying IP OSPF Neighbor Details

You need to make two DME requests to view the same information found in the show ip ospf neighbors output. One request for the neighbor-related statistics (ospfAdjStats) and the other for dynamically learned endpoints (ospfAdjEp).

Querying IP OSPF Neighbor Details (DME Request 1)

Querying IP OSPF Neighbor Details (DME Request 1)
GET http://<IP_Address>/api/mo/sys/ospf/inst-1/dom-default/if-[eth1/38]/adj-2.2.2.2.json
{
    "totalCount": "1",
    "imdata": [
        {
            "ospfAdjEp": {
                "attributes": {
                    "area": "0.0.0.0",
                    "bdr": "12.2.1.2",
                    "bfdSt": "down",
                    "dbdOptions": "66",
                    "dn": "sys/ospf/inst-1/dom-default/if-[eth1/38]/adj-2.2.2.2",
                    "dr": "12.2.1.1",
                    "flags": "all-dbds-acked,all-dbds-sent",
                    "helloOptions": "2",
                    "id": "2.2.2.2",
                    "ifId": "0",
                    "name": "",
                    "operSt": "full",
                    "peerIp": "12.2.1.2",
                    "peerName": "",
                    "prio": "1"
}}}]}
GET  http://<IP_Address>/restconf/data/Cisco-NX-OS-device:System/ospf-items/inst-items/Inst-list=1/dom-items/Dom-list=default/if-items/If-list=eth1%2F38/adj-items/AdjEp-list=2.2.2.2

<AdjEp-list>
    <id>2.2.2.2</id>
    <adjstats-items>
        <dbdSeqNum>598158479</dbdSeqNum>
        <deadTimerExpTs>2018-01-05T15:59:47.584+00:00</deadTimerExpTs>
        <lastNonHelloPktTs>2018-01-05T15:35:59.200+00:00</lastNonHelloPktTs>
        <lastStChgTs>2018-01-05T15:05:39.557+00:00</lastStChgTs>
        <lsaReqRexmitCnt>0</lsaReqRexmitCnt>
        <outstandingLsaCnt>0</outstandingLsaCnt>
        <reqLsaCnt>0</reqLsaCnt>
        <stChgCnt>5</stChgCnt>
    </adjstats-items>
    <area>0.0.0.0</area>
    <bdr>12.2.1.2</bdr>
    <bfdSt>down</bfdSt>
    <dbdOptions>66</dbdOptions>
    <dr>12.2.1.1</dr>
    <flags>all-dbds-acked,all-dbds-sent</flags>
    <gr-items>
        <helperAge>0</helperAge>
        <helperExitQual>none</helperExitQual>
        <helperSt>not-helping</helperSt>
    </gr-items>
    <helloOptions>2</helloOptions>
    <ifId>0</ifId>
    <name/>
    <operSt>full</operSt>
    <peerIp>12.2.1.2</peerIp>
    <peerName/>
    <prio>1</prio>
</AdjEp-list>

This DME request displays the dynamically learned endpoints for a neighbor.

Note: The property information for this example was added in Release 9.3(3).


ospfAdjEp Properties

The following table contains information about the ospfAdjEp properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
areaospf:AreaId
(address:IPv4)
OSPF adjacency operational area ID
RANGE: [0 , 4294967295]
DEFAULT: 1
bdrospf:DesigAddr
(address:Ip)
Backup designated router address(BDR)Value must match ipv4 or ipv6 known format
bfdStospf:BfdOperSt
(scalar:Enum8)
Operational Bidirectional Forwarding Detection(BFD) StateSELECTION:
0 - down
1 - up
dbdOptionsospf:Options
(scalar:Uint32)
Peer options from database descriptor(DBD) packetRANGE: [0, 4294967295]
dn
reference:BinRef
A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.
drospf:DesigAddr
(address:Ip)
Designated router address(DR)Value must match ipv4 or ipv6 known format
flagsospf:AdjFlags
(scalar:Bitmask16)
Adjacency flags can be master-self,all-dbds-sent,all-dbds-acked and peer-gr-helperSELECTION:
0 - unspecified
1 - master-self
2 - all-dbds-sent
4 - all-dbds-acked
8 - peer-gr-helper
DEFAULT: unspecified
helloOptionsospf:Options
(scalar:Uint32)
Peer options from hello packetRANGE: [0, 4294967295]
idospf:AdjId
(ip:RtrId)
OSPF adjacency neighbor's router id
ifIdospf:AdjIfId
(scalar:Uint32)
Neighbor's interface idRANGE: [0, 4294967295]
namenaming:Name256
(string:Basic)
The name of the object.
MAX SIZE: 63
operStospf:AdjOperSt
(scalar:Enum8)
Operational state of OSPF adjacencySELECTION:
0 - unknown
1 - down
2 - attempt
3 - initializing
4 - two-way
5 - exstart
6 - exchange
7 - loading
8 - full
9 - self
DEFAULT: down
peerIpaddress:Ip
Adjacency peer IP addressValue must match ipv4 or ipv6 known format
peerNamestring:Basic
OSPf adjacency Neighbor nameA sequence of characters
prioospf:DesigPrio
(scalar:UByte)
Operational neighbor priority
RANGE: [0 , 255]
DEFAULT: 1


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Querying IP OSPF Neighbor Details (DME Request 2)

Querying IP OSPF Neighbor Details (DME Request 2)
GET http://<IP_Address>/api/mo/sys/ospf/inst-1/dom-default/if-[eth1/38]/adj-2.2.2.2/adjstats.json
{
"totalCount": "1",
"imdata": [
    {
        "ospfAdjStats": {
            "attributes": {
                "dbdSeqNum": "598158479",
                "deadTimerExpTs": "2018-01-05T16:10:04.878+00:00",
                "dn": "sys/ospf/inst-1/dom-default/if-[eth1/38]/adj-2.2.2.2/adjstats",
                "lastNonHelloPktTs": "2018-01-05T16:06:20.123+00:00",
                "lastStChgTs": "2018-01-05T15:05:39.557+00:00",
                "lsaReqRexmitCnt": "0",
                "outstandingLsaCnt": "0",
                "reqLsaCnt": "0",
                "stChgCnt": "5"
}}}]}

This DME request displays the neighbor-related statistics (ospfAdjStats).

Note: This example was added in Cisco NX-OS Release 7.0(3)I7(3).

CLI Output
switch# show ip ospf neighbors   
OSPF Process ID 1 VRF default   
Total number of neighbors: 1   
Neighbor IDPri StateUp TimeAddressInterface
2.2.2.21 FULL/BDR00:00:16    12.2.1.2Eth1/38   

CLI Output
switch# show ip ospf neighbors 2.2.2.2 detail   
Neighbor 2.2.2.2, interface address 12.2.1.2   
Process ID 1 VRF default in area 0.0.0.0 via interface Ethernet1/38  
State is FULL, 5 state changes, last change 00:58:08   
Neighbor priority is 1   
DR is 12.2.1.1 BDR is 12.2.1.2   
Hello options 0x2,dbd options 0x42   
Last non-hello packet received 00:27:48  
Dead timer due in 00:00:40   

Note: The property information for this example was added in Release 9.3(3).


ospfAdjStats Properties

The following table contains information about the ospfAdjStats properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
dbdSeqNumospf:Counter32
(scalar:Uint32)
Database descriptor(DBD) sequence numberRANGE: [0, 4294967295]
deadTimerExpTsscalar:Date
Timestamp of the dead timer expiryDATE FORMAT: %Y-%m-%dT%H:%M:%S.%f%z
dn
reference:BinRef
A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module.
lastNonHelloPktTsscalar:Date
Timestamp of the last non hello packet receivedDATE FORMAT: %Y-%m-%dT%H:%M:%S.%f%z
lastStChgTsscalar:Date
Timestamp of the latest state changeDATE FORMAT: %Y-%m-%dT%H:%M:%S.%f%z
lsaReqRexmitCntospf:Counter32
(scalar:Uint32)
Number of retransmissions of LSA requestRANGE: [0, 4294967295]
outstandingLsaCntospf:Counter32
(scalar:Uint32)
Number of outstanding LSAs from last requestRANGE: [0, 4294967295]
reqLsaCntospf:Counter32
(scalar:Uint32)
Number of link-state advertisement(LSAs) on request listRANGE: [0, 4294967295]
stChgCntospf:Counter32
(scalar:Uint32)
Number of states changed during OSPF adjacencyRANGE: [0, 4294967295]


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html