1 | 31 | simandl | #!/usr/bin/env sh |
2 | | | |
3 | | | . ../../settings |
4 | | | |
5 | | | DEV=$1 |
6 | | | |
7 | | | OS_TYPE=`uname` |
8 | | | |
9 | | | SECS=`date +%s` |
10 | | | |
11 | | | MODNAME=`pwd|sed -e "s/.*\///g" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
12 | | | |
13 | | | if [ "$DEV" = "" ] ; then echo "arguments missing!" ; else |
14 | | | |
15 | | | echo $SECS $MODNAME: setting up database $DEV.rrd for values [0..unknown] |
16 | | | |
17 | | | if [ $OS_TYPE = "Linux" ]; then |
18 | | | $BINPATH/rrdtool create rrd/$DEV.rrd --step 10 \ |
19 | | | DS:racc:COUNTER:300:0:U \ |
20 | | | DS:rbyt:COUNTER:300:0:U \ |
21 | | | DS:wacc:COUNTER:300:0:U \ |
22 | | | DS:wbyt:COUNTER:300:0:U \ |
23 | | | RRA:AVERAGE:0:1:720 \ |
24 | | | RRA:AVERAGE:0.3:6:2880 \ |
25 | | | RRA:AVERAGE:0.3:60:2016 \ |
26 | | | RRA:AVERAGE:0.3:360:1488 \ |
27 | | | RRA:AVERAGE:0.3:4320:1460 \ |
28 | | | RRA:MIN:0.3:6:2880 \ |
29 | | | RRA:MIN:0.3:60:2016 \ |
30 | | | RRA:MIN:0.3:360:1488 \ |
31 | | | RRA:MIN:0.3:4320:1460 \ |
32 | | | RRA:MAX:0.3:6:2880 \ |
33 | | | RRA:MAX:0.3:60:2016 \ |
34 | | | RRA:MAX:0.3:360:1488 \ |
35 | | | RRA:MAX:0.3:4320:1460 |
36 | | | |
37 | | | fi |
38 | | | if [ $OS_TYPE = "FreeBSD" -o $OS_TYPE = "NetBSD" -o $OS_TYPE = "OpenBSD" ]; then |
39 | | | $BINPATH/rrdtool create rrd/$DEV.rrd --step 10 \ |
40 | | | DS:kbt:COUNTER:300:0:U \ |
41 | | | DS:xfr:COUNTER:300:0:U \ |
42 | | | DS:time:COUNTER:300:0:U \ |
43 | | | DS:mb:COUNTER:300:0:U \ |
44 | | | RRA:AVERAGE:0:1:720 \ |
45 | | | RRA:AVERAGE:0.3:6:2880 \ |
46 | | | RRA:AVERAGE:0.3:60:2016 \ |
47 | | | RRA:AVERAGE:0.3:360:1488 \ |
48 | | | RRA:AVERAGE:0.3:4320:1460 \ |
49 | | | RRA:MIN:0.3:6:2880 \ |
50 | | | RRA:MIN:0.3:60:2016 \ |
51 | | | RRA:MIN:0.3:360:1488 \ |
52 | | | RRA:MIN:0.3:4320:1460 \ |
53 | | | RRA:MAX:0.3:6:2880 \ |
54 | | | RRA:MAX:0.3:60:2016 \ |
55 | | | RRA:MAX:0.3:360:1488 \ |
56 | | | RRA:MAX:0.3:4320:1460 |
57 | | | |
58 | | | fi |
59 | | | fi |
60 | | | |
61 | | | # 2h -> 720 Werte alle 10sec |
62 | | | # 2d = 48h -> 2880 Werte alle 1min (6*10sec) |
63 | | | # 2w = 14d -> 2016 Werte alle 10min (60*10sec) |
64 | | | # 2m = 62d -> 1488 Werte alle 1h (360*10sec) |
65 | | | # 2y = 730d -> 1460 Werte alle 12h (4320*10sec) |