Hi everyone!
Any guru's here with spare time?
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...
NTP stats - who can make something, with this info?
Moderators: Developers, Moderators
NTP stats - who can make something, with this info?
Regards,
Evert Meulie
Evert Meulie
this is a script I use for the same sort of thing
[root@perch 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
[root@perch 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
a better script
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
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
-
- ntp.pl.gz
- ntp perl script
- (468 Bytes) Downloaded 3484 times
Phil
Who is online
Users browsing this forum: No registered users and 2 guests