Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Dec 15, 2018 8:47 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: NTP stats - who can make something, with this info?
PostPosted: Fri Sep 10, 2004 2:49 am 
Offline
User avatar

Joined: Sun Sep 21, 2003 6:39 am
Posts: 27
Location: Sarpsborg, Norway
Hi everyone!

Any guru's here with spare time? 8)

Is it possible to plot NTP stats? I found a RRD example on http://fortytwo.ch/stats/time/zbasel.fortytwo.ch/ but I have no idea on how to implement it in Cacti...

_________________
Regards,
Evert Meulie


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 12:31 pm 
Offline

Joined: Sat Aug 09, 2003 3:02 pm
Posts: 30
this is a script I use for the same sort of thing

[[email protected] scripts]# cat ntp.pl
#!/usr/bin/perl

# ntpq -rv generates
#offset=-11.331, frequency=57.178, jitter=2.634, stability=0.351

$output = `ntpq -c rv | grep "^offset"` ;
$output =~ m/offset=(.*), frequency=(.*), jitter=(.*), stability=(.*)/;

print "offset:$1 frequency:$2 jitter:$3 stability:$4" ;

=========================================
It generates 4 values

offset time offset from "reality"
frequency my clock frequency
jitter the jitter of the clock
stability rtfm

In reality you may well just want to plot offset, so if this is the case, just change the print to

print "offset:$1 ;

then set up your data source to use a unix script.

One day Ill get my cacti working properly and export the config, but not today...

Phil

_________________
Phil


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 15, 2004 3:05 am 
Offline

Joined: Fri Aug 27, 2004 5:44 am
Posts: 17
Location: sweden
I'm getting some weird graphs from this script on a linux box running NTP 4.2.0, the graph is broken up as if the script failed to get the offset. has anyone else experienced this?


Attachments:
graph_5_1.jpg
graph_5_1.jpg [ 27.55 KiB | Viewed 25724 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 20, 2004 4:53 pm 
Offline

Joined: Sat Aug 09, 2003 3:02 pm
Posts: 30
Sadly yes I am getting that as well, it used to work with my last cacti install, I haven't got time right now, but if noone else fixes it, Ill investigate it and see if I can fix it in a few days.

Phil

_________________
Phil


Top
 Profile  
 
 Post subject: a better script
PostPosted: Thu Oct 21, 2004 4:51 pm 
Offline

Joined: Sat Aug 09, 2003 3:02 pm
Posts: 30
I have written a somewhat better script. So I suggest you try that one.

There is another post on the board in general help "returning -ve numbers from script command" about a fix for reading -ve numbers from scripts. Its just a couple of lines to edit in a file. If you are plotting offset, then you will need that fix as well, as the 0.8.6b by default does not do -ve numbers out of the box.

Let me know if that does not help. I will see what I can do

Phil


Attachments:
File comment: ntp perl script
ntp.pl.gz [468 Bytes]
Downloaded 3227 times

_________________
Phil
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group