enhanced gnuplotting

This commit is contained in:
Tonton Th 2019-01-04 14:09:02 +01:00
parent 82c64d81cb
commit f546418fb4
2 changed files with 9 additions and 5 deletions

View File

@ -4,7 +4,8 @@ source ./commun.sh
tmpf="somevalues.dat"
rrdtool fetch $RRDB LAST |
rrdtool fetch $RRDB LAST \
--start 0 |
tr -d ':' |
awk '
(!/nan/ && NF==2) { print $1, $2 }
@ -15,11 +16,14 @@ awk '
# as an example, we are gnuploting our datas
#
gnuplot << __EOC__
set term png size 800,600
set term png size 1024,512
set output "graphe.png"
set grid
plot "${tmpf}" with lines
set xdata time
set timefmt "%s"
set format x "%m/%d\n%H:%M"
plot "${tmpf}" using 1:2 with lines
__EOC__
rm ${tmpf}
# rm ${tmpf}

View File

@ -5,7 +5,7 @@ source ./commun.sh
ctime=$(date +'%s')
value=$(cut -d ' ' -f 1 /proc/loadavg)
# write value to a file
# display and write value to a file
echo ${ctime} ${value} | tee -a bar.dat
# inject value in the rrdb file