Code

initial
[rrdtool-all.git] / tutorial / ouce2013 / rrd-by-example / ex / catch-fetch.sh
1 #!/bin/sh
2 PATH=/scratch/rrd4/bin:$PATH
3 R=rrdtool
4 $R create x.rrd \
5    --step=300 \
6    --start=1199999699 \
7    DS:temperature:GAUGE:600:-40:100 \
8    RRA:AVERAGE:0.5:1:2 \
9    RRA:AVERAGE:0.5:2:3
11 #!/bin/sh
12 R=rrdtool
13 u(){
14  $R update x.rrd $1
15 }
17 u 1199999700:00 
18 u 1200000000:10
19 u 1200000300:20
20 u 1200000600:30
21 u 1200000900:40
22 u 1200001200:50
24 set -x 
26 $R fetch x.rrd -r300 -s1200000000 -e1200000900 AVERAGE
27 $R fetch x.rrd -r300 -s1200000600 -e1200000900 AVERAGE