DD2-monitor/rrdb/getvalues.sh

26 lines
341 B
Bash
Raw Normal View History

2019-01-03 16:26:46 +01:00
#!/bin/bash
source ./commun.sh
2019-01-03 17:05:55 +01:00
tmpf="somevalues.dat"
2019-01-03 16:26:46 +01:00
rrdtool fetch $RRDB LAST |
tr -d ':' |
awk '
(!/nan/ && NF==2) { print $1, $2 }
' \
2019-01-03 17:05:55 +01:00
> ${tmpf}
2019-01-03 16:26:46 +01:00
2019-01-03 17:05:55 +01:00
#
# as an example, we are gnuploting our datas
#
2019-01-03 16:26:46 +01:00
gnuplot << __EOC__
set term png size 800,600
set output "graphe.png"
2019-01-03 17:05:55 +01:00
set grid
plot "${tmpf}" with lines
2019-01-03 16:26:46 +01:00
__EOC__
2019-01-03 17:05:55 +01:00
rm ${tmpf}
2019-01-03 16:26:46 +01:00