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