jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [diskio/] [makerrd] - Rev 14 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env sh

. ../../settings

DEV=$1

OS_TYPE=`uname`

SECS=`date +%s`

MODNAME=`pwd|sed -e "s/.*\///g" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`

MAXTRANS=50000000
MAXIO=50000

if [ "$DEV" = "" ] ; then echo "arguments missing!" ; else

  echo $SECS $MODNAME: setting up database $DEV.rrd for values [0..unknown]

  if [ $OS_TYPE = "Linux" ]; then
    $BINPATH/rrdtool create rrd/$DEV.rrd --step 10 \
      DS:racc:COUNTER:300:0:$MAXIO \
      DS:rbyt:COUNTER:300:0:$MAXTRANS \
      DS:wacc:COUNTER:300:0:$MAXIO \
      DS:wbyt:COUNTER:300:0:$MAXTRANS \
      RRA:AVERAGE:0:1:720 \
      RRA:AVERAGE:0.3:6:2880 \
      RRA:AVERAGE:0.3:60:2016 \
      RRA:AVERAGE:0.3:360:1488 \
      RRA:AVERAGE:0.3:4320:1460 \
      RRA:MIN:0.3:6:2880 \
      RRA:MIN:0.3:60:2016 \
      RRA:MIN:0.3:360:1488 \
      RRA:MIN:0.3:4320:1460 \
      RRA:MAX:0.3:6:2880 \
      RRA:MAX:0.3:60:2016 \
      RRA:MAX:0.3:360:1488 \
      RRA:MAX:0.3:4320:1460

    fi
  if [ $OS_TYPE = "FreeBSD" -o $OS_TYPE = "NetBSD" -o $OS_TYPE = "OpenBSD" ]; then
    $BINPATH/rrdtool create rrd/$DEV.rrd --step 10 \
      DS:kbt:COUNTER:300:0:U \
      DS:xfr:COUNTER:300:0:U \
      DS:time:COUNTER:300:0:U \
      DS:mb:COUNTER:300:0:U \
      RRA:AVERAGE:0:1:720 \
      RRA:AVERAGE:0.3:6:2880 \
      RRA:AVERAGE:0.3:60:2016 \
      RRA:AVERAGE:0.3:360:1488 \
      RRA:AVERAGE:0.3:4320:1460 \
      RRA:MIN:0.3:6:2880 \
      RRA:MIN:0.3:60:2016 \
      RRA:MIN:0.3:360:1488 \
      RRA:MIN:0.3:4320:1460 \
      RRA:MAX:0.3:6:2880 \
      RRA:MAX:0.3:60:2016 \
      RRA:MAX:0.3:360:1488 \
      RRA:MAX:0.3:4320:1460

    fi
  fi

# 2h        -> 720 Werte alle 10sec
# 2d = 48h  -> 2880 Werte alle 1min  (6*10sec)
# 2w = 14d  -> 2016 Werte alle 10min (60*10sec)
# 2m = 62d  -> 1488 Werte alle 1h    (360*10sec)
# 2y = 730d -> 1460 Werte alle 12h   (4320*10sec)

Powered by WebSVN 2.2.1