Plotting Time Drift?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
valec
Posts: 5
Joined: Wed Aug 23, 2006 10:25 pm
Location: New Zealand

Plotting Time Drift?

Post by valec »

I was wondering if anyone has any ideas on plotting a remote systems time drift.

By 'time drift ', what I mean is that we have an ntp server, and our servers all get their time from this server. Now what I want is a graph that polts the difference between the time on each host and the time on a control system (I was thinking I'd just cron an ntpupdate on the cacti box every 5 minutes).

So I guess, what I'd be wanting is basically just the best way to grab the time from a remote box, and then I could just do a simple subtraction.

I was hoping there was an option for ntpq to do this, but there doesn't appear to.

Obviously, I'm quite the SNMP n00b, so any help is appreciated.
User avatar
N3NCY
Cacti User
Posts: 260
Joined: Thu Sep 22, 2005 7:50 pm
Location: Landenberg, PA
Contact:

Post by N3NCY »

Perhaps if I knew why you want to do this measurement / graph I would understand your question better.
What exactly would this acomplish?
I am a graphing freak, so I am not opposed to graphing things like this!
I can't figure out what purpose this would serve.
With NTP functioning correctly, I wouldn't image the deviation measurements would be very meaningful graphed out.
Were you thinking of using this to determine if NTP was working ok?
Or more of detecting Real Time Clock / CMOS battery issues on hosts?
Be specific and I may be able to whip up a quick perl script for what you need.
Thank you,

Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
valec
Posts: 5
Joined: Wed Aug 23, 2006 10:25 pm
Location: New Zealand

Post by valec »

Well on a basic level I was wanting to graph the differance between one system and the next I guess. I was thinking it'd be nice to see a graph which plotted on the vertical axis, the difference in milliseconds between the two.

Basically yes, as a graph to see wheher ntp is running as it should on each host I guess. Ideally the graph would be at zero and if something starts to show up, you'd know to investigate.
However thinking about it more, I could also add it to Nagios instead, just have a warning and critical level by which to alarm. Also, you may be quite right in it not being very useful, and having useless graphs does just become a clutter. I think I'll aim to get something like this going and then assess whether it is necessary to keep it.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Sounds like an rsh/ssh Data Input Method. It should be a no brainer.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
noflies
Cacti User
Posts: 83
Joined: Sun Dec 18, 2005 9:30 am

Plotting Time Drift

Post by noflies »

You should be able to use a command like;

[quote]
ntpdate -q NTPSERVERNAME | grep -E "^server" | cut d, -f3 | cut -d" " -f3
[/quote]

...to obtain the current offset.

Note this runs ntpdate in query mode only, it will not modify the current system clock. Of course as TheWitness points out this command would be run on the remote host via RSH/SSH.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests