make graphs via php
[wyse_ntpd.git] / src / graphit / create_data.sh
index 46d6543..1547156 100755 (executable)
@@ -10,23 +10,26 @@ fi
 
 rm -f data.rrd
 
-START_TIME=`head -1 $INPUT`
+START_TIME_A=`head -1 $INPUT`
+START_TIME=`echo $START_TIME_A-10|bc`
 
 echo "Createing rrd archive"
 rrdtool create data.rrd --step 30 \
 --start $START_TIME \
 DS:offset:GAUGE:30:U:U \
 DS:jitter:GAUGE:30:U:U \
-RRA:AVERAGE:0.5:1:480 \
 RRA:AVERAGE:0.5:1:2880 \
 RRA:AVERAGE:0.5:7:2880 \
 RRA:AVERAGE:0.5:30:2880 \
 RRA:AVERAGE:0.5:365:2880
 
+TIME=`echo "$START_TIME+30"|bc`
+#END_TIME=`echo "$START_TIME
 
 cat $INPUT | while read line
 do
-       TIME="$line"
+       #TIME="$line"
+       TIME=`echo "$TIME+30"|bc`
        read line2
        OFFSET=`echo $line2 |awk '{ print $9 }'`
        JITTER=`echo $line2 |awk '{ print $10 }'`
@@ -38,7 +41,7 @@ done
 
 END_4HR=`echo $START_TIME+14400|bc`
 rrdtool graph 4hr_off.png --start $START_TIME \
-       -w 600 -h 300 \
+       -w 600 -h 300 -l -1 \
        --end $END_4HR \
        DEF:4hr_jit=data.rrd:jitter:AVERAGE \
        LINE2:4hr_jit#00FF00