Configuring Object Tracking
This section contains payload examples to demonstrate how to use the NX-API REST API to configure object tracking on the Cisco Nexus 3000 and 9000 Series switches.
Object tracking monitors the status of an object (such as an interface, an IP route, an IP SLA, or a list of multiple objects) and sends any changes to interested clients.
For information about VRRPv3 tracking, see Configuring VRRPv3
Configuring a Tracked Object to Track an Ethernet Interface
Configuring a Tracked Object to Track an Ethernet Interface
POST http://<IP_Address>/api/mo/sys/track/object-25.json
{
"trackIf": {
"attributes": {
"id": "eth1/1",
"protocolType": "line-protocol"
}
}
}
Creates and configures tracked object 25 to track Ethernet interface 1/1 with a line protocol.
Verifeth1/1ying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verifeth1/1y the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
trackIf | sys/track/object-5/ifeth1/1 |
trackIf Properties
The following table contains information about the trackIf 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 Name | Data Type | Description | Values |
---|---|---|---|
id | nw:IfId (base:IfIndex) | Interface to track | Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100 |
protocolType | track:IntfProtocolType (scalar:Enum8) | Protocol type for interface object | SELECTION: 0 - none 1 - ipv4-routing 2 - ipv6-routing 3 - line-protocol DEFAULT: none |
Related Documentation
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
Creating and Configuring a Tracked Object to for SLA Tracking
Creating and Configuring a Tracked Object to for SLA Tracking
POST http://<IP_Address>/api/mo/sys/track.json
{
"trackEntity": {
"children": [
{
"trackObject": {
"attributes": {
"id": "5"
},
"children": [
{
"trackIpSla": {
"attributes": {
"probeId": "3",
"probeState": "state"
}}}]}}]}}
Creates and configures tracked object 5 for SLA tracking.
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
Creating and Configuring a Tracked List
Creating and Configuring a Tracked List
POST http://<IP_Address>/api/mo/sys/track.json
{
"trackEntity": {
"children": [
{
"trackObject": {
"attributes": {
"id": "6"
},
"children": [
{
"trackList": {
"attributes": {
"type": "percentage"
"percentageUp": "30"
}}}]}}]}}
Creates and configures a tracked object with an ID of 6 list and a threshold up percentage of 30.
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