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.

MODN
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 NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
Interface to trackMust match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
protocolTypetrack:IntfProtocolType
(scalar:Enum8)
Protocol type for interface objectSELECTION:
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.

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


Verifying 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 verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
trackEntity sys/track
trackObject sys/track/object-{id}
trackIpSla sys/track/object-{id}/ipsla


trackObject Properties

The following table contains information about the trackObject 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
idtrack:TrackId
(scalar:Uint16)
Track object ID
RANGE: [1 , 512]


trackIpSla Properties

The following table contains information about the trackIpSla 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
probeIdscalar:Uint32
SLA probe ID
RANGE: [1 , 2147483647]
probeStatetrack:ProbeState
(scalar:Enum8)
SLA reachability/state typeSELECTION:
0 - reachability
1 - state
DEFAULT: state


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

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.

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


Verifying 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 verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
trackEntity sys/track
trackObject sys/track/object-{id}
trackList sys/track/object-{id}/list


trackObject Properties

The following table contains information about the trackObject 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
idtrack:TrackId
(scalar:Uint16)
Track object ID
RANGE: [1 , 512]


trackList Properties

The following table contains information about the trackList 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
typetrack:ListObj
(scalar:Enum8)
Type of list objectSELECTION:
0 - none
1 - and
2 - or
3 - percentage
4 - weight
DEFAULT: none
percentageUpscalar:Uint16
Percentage Up
RANGE: [0 , 100]
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