Querying NTP Peer Status
Querying NTP Peer Status
GET http://<IP_Address>/api/mo/sys/time.json?rsp-subtree=full&rsp-prop-include=config-only
{
"totalCount": "1",
"imdata": [
{
"datetimeClkPol": {
"attributes": {
"adminSt": "enabled",
"authSt": "disabled",
"descr": "",
"dn": "sys/time",
"logging": "disabled",
"loggingLevel": "critical",
"master": "disabled",
"masterStratum": "8",
"ownerKey": "",
"ownerTag": "",
"persistentOnReload": "true"
},
"children": [
{
"datetimeNtpProvider": {
"attributes": {
"descr": "",
"keyId": "0",
"maxPoll": "6",
"minPoll": "4",
"name": "4.3.2.1",
"persistentOnReload": "true",
"preferred": "no",
"provT": "peer",
"rn": "prov-4.3.2.1",
"vrf": ""
}
}
},
{
"datetimeNtpProvider": {
"attributes": {
"descr": "",
"keyId": "0",
"maxPoll": "6",
"minPoll": "4",
"name": "1.2.3.4",
"persistentOnReload": "true",
"preferred": "no",
"provT": "server",
"rn": "prov-1.2.3.4",
"vrf": ""
}
}
}
]
}
}
]
}
GET http://<IP_Address>/restconf/data/Cisco-NX-OS-device:System/time-items/
<time-items>
<adminSt>enabled</adminSt>
<authSt>disabled</authSt>
<clock>2018-06-20T09:48:03.764+00:00</clock>
<clockRaw>1529488083764</clockRaw>
<descr/>
<flags/>
<leap>0</leap>
<logging>disabled</logging>
<loggingLevel>critical</loggingLevel>
<master>disabled</master>
<masterStratum>8</masterStratum>
<name>default</name>
<ownerKey/>
<ownerTag/>
<peer>0</peer>
<poll>0</poll>
<precision>0</precision>
<prov-items>
<NtpProvider-list>
<name>4.3.2.1</name>
<maxPoll>6</maxPoll>
<minPoll>4</minPoll>
<preferred>false</preferred>
<provT>peer</provT>
<status-items>
<delay>0.00000</delay>
<delayRaw>0</delayRaw>
<dispersion>261631</dispersion>
<flags>configured</flags>
<hostPoll>6</hostPoll>
<mode>symmetricActive</mode>
<peerPoll>6</peerPoll>
<reach>0</reach>
<stratum>16</stratum>
</status-items>
</NtpProvider-list>
<NtpProvider-list>
<name>1.2.3.4</name>
<maxPoll>6</maxPoll>
<minPoll>4</minPoll>
<preferred>false</preferred>
<provT>server</provT>
<status-items>
<delay>0.00000</delay>
<delayRaw>0</delayRaw>
<dispersion>261631</dispersion>
<flags>configured</flags>
<hostPoll>6</hostPoll>
<mode>client</mode>
<peerPoll>6</peerPoll>
<reach>0</reach>
<stratum>16</stratum>
</status-items>
</NtpProvider-list>
</prov-items>
<refId>0.0.0.0</refId>
<refTime>1970-01-01T00:00:00.000+00:00</refTime>
<refTimeRaw>0</refTimeRaw>
<rootDelay>0</rootDelay>
<rootDispersion>0</rootDispersion>
<srvStatus>0</srvStatus>
<stratum>0</stratum>
</time-items>
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output Switch# show ntp peer-status
Total peers : 2
* - selected for sync, + - peer mode(active),
- - peer mode(passive), = - polled in client mode
remote local
st poll reach delay vrf
--------------------------------------------------------------------------------
---------------------------------------
=1.2.3.4 0.0.0.0
16 16 0 0.00000default
+4.3.2.1 0.0.0.0
16 16 0 0.00000default
Note: The property information for this example was added in Release 9.3(3).
datetimeClkPol Properties
The following table contains information about the datetimeClkPol 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 adminSt datetime:AdminState
(scalar:Enum8)A property that indicates if the NTP protocol is enabled or disabled. SELECTION: authSt datetime:AdminState
(scalar:Enum8)A property that indicates if the Datetime policy authentication is enabled or disabled. SELECTION: descr pol:Descr Description of the specified attribute dn
reference:BinRefA tag or metadata is a non-hierarchical keyword or term assigned to the fabric module. logging datetime:AdminState
(scalar:Enum8)NTP Logging Status SELECTION: loggingLevel datetime:LoggingLevel
(scalar:Enum8)NTP Logging Level SELECTION: master datetime:AdminState
(scalar:Enum8)NTP Master Configuration SELECTION: masterStratum datetime:Stratum
(scalar:UByte)NTP Master Stratum Level ownerKey naming:Descr
(string:Basic)The key for enabling clients to own their data for entity correlation. ownerTag naming:Descr1024
(string:Basic)A tag for enabling clients to add their own data. For example, to indicate who created this object. persistentOnReload
mo:Persistent
scalar:Enum8NO COMMENTS SELECTION:
datetimeNtpProvider Properties
The following table contains information about the datetimeNtpProvider 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 descr pol:Descr Description of the specified attribute keyId datetime:KeyId
(scalar:Uint16)The NTP provider key ID. The range is from 1 to 65535. RANGE: [1, 65535] maxPoll datetime:Poll
(scalar:UByte)The NTP maximum interval default in seconds. minPoll datetime:Poll
(scalar:UByte)The NTP minimum interval default in seconds. name pol:ObjName
(naming:Name256)Object name persistentOnReload
mo:Persistent
scalar:Enum8NO COMMENTS SELECTION:
preferred scalar:Bool A property that indicates if the NTP server is preferred. Only one preferred server is allowed. SELECTION: true or false provT datetime:ProvT
(scalar:Enum8)NTP Server Or Peer SELECTION: rn
reference:BinRNIdentifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names. vrf l3:VrfName
(string:Basic)Identifies the VRF for the NTP providers A sequence of characters
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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: