then
mknod /var/www/data/reboot p
- (cat > /var/www/data/reboot; reboot)&
+ chmod 644 /var/www/data/reboot
+ (echo "Rebooting..." > /var/www/data/reboot; reboot)&
cldate=`date '+%d.%m.%Y'`
touch /var/www/data/ntp.log.$cldate
+ chmod 644 /var/www/data/ntp.log.$cldate
- (while(true); do date '+%s' >> /var/www/data/ntp.log.$cldate; ntpq -c lpe -n >> /var/www/data/ntp.log.$cldate; sleep 30; done) &
+ (sleep 30; while(true); do date '+%s' >> /var/www/data/ntp.log.$cldate; ntpq -c lpe -n |grep "127.127.20" >> /var/www/data/ntp.log.$cldate; sleep 30; done) &
fi
--- /dev/null
+#!/bin/sh
+
+INPUT="$1"
+
+if [ ! -f "$INPUT" ]
+then
+ echo "Args: input file or input file doesnt exist"
+ exit 1
+fi
+
+rm -f data.rrd
+
+START_TIME=`head -1 $INPUT`
+
+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
+
+
+cat $INPUT | while read line
+do
+ TIME="$line"
+ read line2
+ OFFSET=`echo $line2 |awk '{ print $9 }'`
+ JITTER=`echo $line2 |awk '{ print $10 }'`
+
+ rrdtool update data.rrd $TIME:$OFFSET:$JITTER
+ #echo "rrdtool update data.rrd $TIME:$OFFSET:$JITTER"
+done
+
+
+END_2HR=`echo $START_TIME+7200|bc`
+rrdtool graph 2hr_off.png --start $START_TIME \
+ --end $END_2HR \
+ DEF:2hr_jit=data.rrd:jitter:AVERAGE \
+ LINE2:2hr_jit#00FF00
+
+
+END_2HR=`echo $START_TIME+7200|bc`
+rrdtool graph 2hr_jit.png --start $START_TIME \
+ --end $END_2HR \
+ DEF:2hr_off=data.rrd:offset:AVERAGE \
+ LINE1:2hr_off#FF0000
+