#!/bin/csh -f # script to plot sensors data using GNUPLOT # last revision: 2001.12.27 (ajw) # script takes the hostname as a single argument if ( $1 == "" ) then echo "Usage: sensors.gplot " exit endif set NODENAME = $1 ############################################# # write the GNUPLOT input file (sensors.gpl)# ############################################# cat < sensors.gpl # set plot size, origin, and allow multiple plots in terminal window set size 1,1 set origin 0,0 set multiplot # set key (legend) position and appearance set key graph 0.95, graph 0.8 set key samplen 1 # set margins => scales all plots to same dimensions # increment is character height or width as appropriate set tmargin 1 set bmargin 1 set lmargin 6 set rmargin 3 # set time format and xdata type set timefmt "%Y-%m-%d_%H:%M:%S" set xdata time # plot VCore # set xtics incr=60*60*24=86400sec (1 day) # set mxtics <#> #=divisions between major tics (4 => 6 hours) set size 0.50,0.2 set origin 0.0,0.80 set yrange [1.7:1.9] set ytics 0.1 set mytics 2 set xtics 86400 set mxtics 4 set format x "" set notimestamp set title "" plot 'sensors_${NODENAME}.dat' u 1:2 t "VCore1" w lines, \ 'sensors_${NODENAME}.dat' u 1:3 t "VCore2" w lines # plot +3.3V set size 0.50,0.2 set origin 0.0,0.65 set yrange [3.2:3.4] set ytics 0.1 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:4 t "+3.3V" w lines # plot +5V set size 0.50,0.2 set origin 0.0,0.50 set yrange [4.5:5.5] set ytics 0.5 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:5 t "+5V" w lines # plot +12V set size 0.50,0.2 set origin 0.0,0.35 set yrange [0:15] set ytics 5 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:6 t "+12V" w lines # plot -12V set size 0.50,0.2 set origin 0.0,0.20 set yrange [-15:0] set ytics 5 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:7 t "-12V" w lines # plot -5V set size 0.50,0.2 set origin 0.0,0.05 set yrange [-10:5] set ytics 5 set mytics 2 set format x "%m/%d" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:8 t "-5V" w lines # plot V5SB set size 0.50,0.2 set origin 0.5,0.65 set yrange [0:10] set ytics 5 set mytics 2 set format x "" set timestamp top 5,0 set title "${NODENAME}" -18,2 plot "sensors_${NODENAME}.dat" u 1:9 t "V5SB" w lines # plot VBat set size 0.50,0.2 set origin 0.5,0.50 set yrange [0:4] set ytics 2 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:10 t "VBat" w lines # plot fan1,fan2,fan3 set size 0.50,0.2 set origin 0.5,0.35 set yrange [0:10000] set ytics 5000 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:11 t "fan1" w lines, \ "sensors_${NODENAME}.dat" u 1:12 t "fan2" w lines, \ "sensors_${NODENAME}.dat" u 1:13 t "fan3" w lines # plot temp1,temp2,temp3 set size 0.50,0.2 set origin 0.5,0.20 set yrange [20:80] set ytics 20 set mytics 2 set format x "" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:14 t "temp1" w lines, \ "sensors_${NODENAME}.dat" u 1:15 t "temp2" w lines, \ "sensors_${NODENAME}.dat" u 1:16 t "temp3" w lines # plot vid set size 0.50,0.2 set origin 0.5,0.05 set yrange [1.6:2] set ytics 0.2 set mytics 2 set format x "%m/%d" set notimestamp set title "" plot "sensors_${NODENAME}.dat" u 1:17 t "vid" w lines # force drawing of multiplot screen set nomultiplot # increment counter and wait if not first time through before looping # to beginning (reread) i=i+1 if (i>1) pause 10 reread EOF ######################################### # end of GNUPLOT input file (sensors.gpl)# ######################################### # run GNUPLOT with command line options: # -geometry x++ => X window dimensions + offsets # -noraise => don't bring GNUPLOT window to top with every new plot event gnuplot -noraise -geometry 800x600+0+0 < in TERMINAL window to quit" i=0 load "sensors.gpl" EOF