Jeremy Kister on 7 Jan 2014 03:52:29 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Quick & Dirty NTP monitoring

On 1/4/2014 3:51 PM, JP Vossen wrote:
So...  Anyone have a better quick & dirty method for this?  And if not,
steal this one...

If your ntp server can't sync time, your test is actually doing it's job by crying. You can add some retries in there if you can't get the core issue solved.

I can't say better, but i'd use some perl to actually query the ntp. You can jam it all on one line easily.

perl -MNet::NTP -e '
for($i; $i<3; $i++){
 if( $r{Stratum} <= 4 && $r{"Receive Timestamp"} >= time()-600 ){
 sleep 60;
print "error with ntp server\n" unless $s;'


Jeremy Kister
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --