Query OSPF neighbor state from Spectrum api.
search cancel

Query OSPF neighbor state from Spectrum api.

book

Article ID: 373368

calendar_today

Updated On:

Products

DX NetOps

Issue/Introduction


Can you query or get  current OSPF neighbors' existing state, via API  or some other method, specifically for Cisco devices?

Resolution

Many vendors have an an OSPF mib with an object that can be polled to get the required data. Cisco does not, but OspfNbrState is available in MIB-2 and can be used instead.  This is unmapped out of the box in Spectrum so will need to be mapped from mib tools. 

ospfNbrState OBJECT-TYPE
SYNTAX INTEGER {
  down(1),
  attempt(2),
  init(3),
  twoWay(4),
  exchangeStart(5),
  exchange(6),
  loading(7),
  full(8)
}
 
ACCESS read-only
STATUS current
 
DESCRIPTION
"The state of the relationship with this neighbor."
::= { ospfNbrEntry 6 }
 
-- 1.3.6.1.2.1.14.10.1.6

Once it has been mapped it should be available on Cisco models in Spectrum, as a custom attribute from the attribute table or via CLI etc

e.g from REST use a simple get query 

https://<hostname><:portnumber>/spectrum/restful/model/0x#####?attr=0x<custom att>