-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmkrrd.sh
More file actions
34 lines (28 loc) · 803 Bytes
/
mkrrd.sh
File metadata and controls
34 lines (28 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# usage:
# ./mkrrd.sh [</path/to/rrdtool> </path/to/dest.rrd>]
# install rrdtool on openbsd 3.7 with:
# pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/rrdtool-1.0.49.tgz
# excellent tutorial on rrdtool:
# http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/tut/rrdtutorial.en.html
rrdtool=/usr/local/bin/rrdtool
rrdfile=/var/www/usr/local/wicap-php/var/stats.rrd
if [ $1 ];then
echo "-> Using $1 for rrdtool path"
rrdtool=$1
fi
if [ $2 ];then
echo "-> Using $2 for resulting rrd"
rrdfile=$2
fi
$rrdtool create $rrdfile \
DS:auths:ABSOLUTE:600:U:U \
DS:evicts:ABSOLUTE:600:U:U \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797