|P is for Practical|
RRD-Ping getting values on right intervalby hello_world (Acolyte)
|on Nov 30, 2011 at 07:05 UTC||Need Help??|
hello_world has asked for the
wisdom of the Perl Monks concerning the following question:
Hi Folks, I have a script to update the RRD databases with latency values to 5 different locations.The script forks 5 different process where each process will run the ping command to their respective location for 15 seconds and sleep for remaining 45 seconds & update the rrd databases after that with the values.
What i intend to by this is to update the RRD databases exactly at every 1 minute interval (i.ee 12:40:00 ,12:41:00,12:42:00 and so on...) The breakup is as follows:
12:40:00 - 12:40:15 (ping for 15 seconds) 12:40:15 - 12:40:59 (sleep for 45 seconds) 12:41:00 - update the rrd db
The problem i am facing is that the values dont arrive exactly at the right interval after some time..i.ee the values start to drift.
Instead of getting the value at 16:50:00 or 16:51:00 ..16:52:00 i am getting the values 3-4 seconds late i.ee 16:50:04 ..16:51:04..16:52:04
So,how do i make sure that i input the values in the db exactly at 1 minute interval ??
The script will just print the values as of now
After few hours,the values are: