Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ntpd の loopstats 内にある offset を読み込んで gnuplot でグラフにするシェルスクリプト.
#!/bin/sh
# ntpd 'loopstats' to gnuplut
# loopstats_gnuplot.sh FILENAME RANGE TICS
TITLE=`basename $1`
gnuplot << EOF
set terminal png
set output "$1_$2_$3.png"
set yrange[-$2:$2]
set xrange [0:86400]
set grid ytics
set ytics -$2,$3
set mytics 10
set title "ntpd $TITLE"
set ylabel "offset (micro-seconds)"
set xlabel "UTC seconds"
plot "$1" using 2:(\$3*1000000) notitle with lines
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment