ok I am trying to plot graphs for a different set of datafiles (9 in total) So i created this shell script:
!/bin/bash
datastorenum=9
PlotOutputLoc=/root/bin/SANscripts/graphs
PlotGname=datastore
Pfext=png
PlotInputName=desktop
PNext=dat
PlotInputLoc=/root/bin/SANscripts/inputdata
write_plotgraph()
{
i=1
while [ $datastorenum != $i ]
do
gnuplot <<- EOF
set term png large size 1200,1024
set output "$PlotOutputLoc/$PlotGname-$i.$Pfext"
set xdata time
set timefmt '%H:%M'
set style data lines
set ylabel "IOs-Avg-%-kb"
set ytics 50
set autoscale
set xlabel "Hour"
plot "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:2 title "Total IOs", "$PlotInputLoc/$PlotInputName-$i.$PNext " using 1:3 title "Read %", "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:4 title "CacheHit %", "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:5 title "Current Kb/sec", "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:6 title "Maximum Kb/sec", "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:7 title "Current IO/sec", "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:8 title "Maximum IO/sec"
i=$(( $i + 1 ))
EOF
done
}
write_plotgraph
It doesnt work exaclty i get bunch of this:
line 0: warning: Skipping unreadable file "/root/bin/SANscripts/inputdata/desktop-1.dat "
line 0: warning: Skipping unreadable file "/root/bin/SANscripts/inputdata/desktop-1.dat "
line 0: warning: Skipping unreadable file "/root/bin/SANscripts/inputdata/desktop-1.dat "
Thanks for the help
Ok so now what about if I want to pass another function? I like this function to only graph the totalio?
write_plotTios()
{
i=1
while [ $datastorenum != $i ]
do
gnuplot <<- EOF
set term png large size 1200,1024
set output "$PlotOutputLoc/$PlotGname-$i-$TIOS.$Pfext"
set xdata time
set timefmt '%H:%M'
set style data lines
set ylabel "IOs-Avg-%-kb"
set ytics 50
set autoscale
set xlabel "Hour"
plot "$PlotInputLoc/$PlotInputName-$i.$PNext" using 1:2 title "Total IOs"
EOF
i=$(( $i + 1 ))
done
}
write_plotTios
this doesn't work i get an error that says:
/plot_datastore1t.sh: line 54: warning: here-document at line 37 delimited by end-of-file (wanted `EOF')
./plot_datastore1t.sh: line 55: syntax error: unexpected end of file