cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3902
Views
0
Helpful
6
Replies

snmp date/time value in cisco switches/routers?

acceleratebiz
Level 1
Level 1

Is there a snmp OID I can query for the date/time in cisco networking equipment? I'm writing a traffic accounting application and would like something better than sysUpTime to get the time difference between 2 counter polls. Something that doesn't reset every 500 days or, especially, reset every time the management system gets reset. Even better, hopefully the time value gets better than 1/100th second precision.

Am I dreaming? Is there a better way to do this?

6 Replies 6

pkhatri
Level 11
Level 11

So let me get this right - you want to get a timestamp at the exact moment that you do a poll on a MIB variable, right ? Now, even if there was such a counter, the time difference between you polling the two counters would render the timestamp inaccurate, wouldn't it ?

Paresh

hmmm, I responded to this yesterday. I guess cisco's forum software is not as good as their network equipment ;).

anyway, I had written asking why would the time difference between polling 2 counters render a timestamp inaccurate?

The idea is to simply get a time delta between 2 counter values. I could do this on the server storing this information. But then I have skew because of potential latency in retrieving the counter values. I could do this with sysUpTime, which I'm probably going to have to. But then I have to deal with other little issues like 100th/second resolution, resetting of the timestamp for many reasons, etc.

Hi,

If I am getting you correctly, what you are proposing to do is to poll for a counter value and at the same time poll for a timestamp value ? Is that correct ? If so, what I was saying was that between the time that you polled the counter and the time that you polled the timestamp, the counter would have moved on a bit... That's why I was saying that it would still be inaccurate...

Paresh

Ok I understand what you're saying now. What I want to do is send one request for both values (actually several values)... in one packet, I should receive the timestamp and the counter value. I can do this now with sysUpTime. I imagine I can do this with a clock value too.

Network management applications use sysUpTime

If you would like to use the time on the device, then you have to make sure that you have NTP configured. If you have that, then you may poll the MIB objects defined in CISCO-NTP-MIB.

This is exactly what I was looking for! Thanks nhabib! Why do network management apps use sysUpTime instead of cntpSysClock? I guess for compatibility?

hmm, looks like neither my cisco 3750 nor 3550s support this. But my 7206vxrs do. Am I understanding this definition correctly? Seems like quite a bit of precision!

NTP timestamps are represented as a 64-bit

unsigned fixed-point number, in seconds relative to

00:00 on 1 January 1900. The integer part is in the

first 32 bits and the fraction part is in the last

32 bits.

one of my 7206vxrs returns this: SNMPv2-SMI::enterprises.9.9.168.1.1.10.0 = Hex-STRING: C7 9D 3E 9D 44 ED 11 FC

an odd fractional part of a second. obviously this doesn't have 1/4billionth second precision. How much precision does this value have?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: