1 | 1 | simandl | #!/usr/bin/env sh |
2 | | | |
3 | | | . ../../settings |
4 | | | |
5 | | | DEV=$1 |
6 | | | MAX=$2 |
7 | | | |
8 | | | SECS=`date +%s` |
9 | | | |
10 | | | MODNAME=`pwd|sed -e "s/.*\///g" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
11 | | | |
12 | | | if [ "$DEV" = "" ] || [ "$MAX" = "" ] ; then echo "arguments missing!" ; else |
13 | | | |
14 | | | echo $SECS $MODNAME: setting up database $DEV.rrd for values [0..$MAX] |
15 | | | |
16 | | | $BINPATH/rrdtool create rrd/$DEV.rrd --step 10 \ |
17 | | | DS:data:GAUGE:300:0:$MAX \ |
18 | | | RRA:AVERAGE:0:1:720 \ |
19 | | | RRA:AVERAGE:0.3:6:2880 \ |
20 | | | RRA:AVERAGE:0.3:60:2016 \ |
21 | | | RRA:AVERAGE:0.3:360:1488 \ |
22 | | | RRA:AVERAGE:0.3:4320:1460 \ |
23 | | | RRA:MIN:0.3:6:2880 \ |
24 | | | RRA:MIN:0.3:60:2016 \ |
25 | | | RRA:MIN:0.3:360:1488 \ |
26 | | | RRA:MIN:0.3:4320:1460 \ |
27 | | | RRA:MAX:0.3:6:2880 \ |
28 | | | RRA:MAX:0.3:60:2016 \ |
29 | | | RRA:MAX:0.3:360:1488 \ |
30 | | | RRA:MAX:0.3:4320:1460 |
31 | | | |
32 | | | fi |
33 | | | |
34 | | | # 2h -> 720 Werte alle 10sec |
35 | | | # 2d = 48h -> 2880 Werte alle 1min (6*10sec) |
36 | | | # 2w = 14d -> 2016 Werte alle 10min (60*10sec) |
37 | | | # 2m = 62d -> 1488 Werte alle 1h (360*10sec) |
38 | | | # 2y = 730d -> 1460 Werte alle 12h (4320*10sec) |
39 | | | |