I've got a script which, amongst other things copies a file across the network, times how long it takes, and dumps a log file with some data.
I then plot a graph with gnuplot every 10 mins with the following script:
Code:
set terminal png
set size 2,0.75
set data style linespoints
set title "speedtest results for last 6 hours."
set xdata time
set timefmt "%H:%M"
set format x "%H:%M"
set xlabel "Time of day"
set yrange [0:100]
set ytics 20
set y2range [0:100]
set y2tics 50
set grid noxtics y2tics
set ylabel "Transfer rate\n Mbs^-1"
plot "/home/avi/www/speedtest/jup-linux.log" using 8:($2*8) title "jup-linux down", \
"/home/avi/www/speedtest/jup-linux.log" using 8:($3*8) title "jup-linux up", \
"/home/avi/www/speedtest/tony.log" using 9:($2*8) title "tony up"
The log files are created just beforehand by tailing the actual generated logfiles for 6hrs worth of logs. The problem I'm having is that I'm about to add two hosts that both are shutdown overnight. Rather than add dead lines to the logfile, is there a way of telling gnuplot to plot the last six hours, say, of a field?
I know I could explicity set it, and create the gnuplot script each time I want to create the graph, but that seems a bit of a bodge if I can set the range more dynamically.