Skip to content

Instantly share code, notes, and snippets.

@tosihisa
Created May 3, 2014 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tosihisa/7978b6497f57e506589e to your computer and use it in GitHub Desktop.
Save tosihisa/7978b6497f57e506589e to your computer and use it in GitHub Desktop.
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