[rrd-users] rrdtool on fedora
Alex van den Bogaerdt
alex at ergens.op.het.net
Tue Dec 16 01:30:40 MET 2003
I've seen a question or two about running mrtg and/or rrdtool on Fedora.
In stead of waiting, I just tried. So far so good.
Fresh install of Fedora workstation (default choices, no patches)
1) download rrdtool-1.0.45.tar.gz into /usr/src
2) tar xzf rrdtool-1.0.45.tar.gz
3) cd rrdtool-1.0.45
4) sh configure
5) make
5b) (many warnings ignored; in fact I didn't even look)
6) make install
7) created quick'n'dirty collector "/tmp/rrdcpu"
#!/bin/bash
< /proc/stat awk '
/^btime / { B=$2 }
/^cpu / { U=$2;N=$3;S=$4;I=$5 }
END { printf "update /tmp/cpu.rrd %i:%i:%i:%i:%i\n",
(U+N+S+I)/100+B,U,N,S,I; }'
8) generated small database
/usr/local/rrdtool-1.0.45/bin/rrdtool create /tmp/cpu.rrd \
--step 60 \
DS:u:COUNTER:130:0:13000 \
DS:n:COUNTER:130:0:13000 \
DS:s:COUNTER:130:0:13000 \
DS:i:COUNTER:130:0:13000 \
RRA:AVERAGE:0.5:1:60 \
RRA:AVERAGE:0.5:60:400 \
RRA:AVERAGE:0.5:1440:400
9) created cron job
crontab -e
* * * * * /tmp/rrdcpu | /usr/local/rrdtool-1.0.45/bin/rrdtool -
10) waited a couple of minutes, looking at the mail from cron. I did
NOT ignore this mail as it told me everything was doing well.
When you _know_ it works OK, edit crontab again and add
(without the double quotes but including the single quotes):
" | grep -v '^OK'" to the command. This will filter the OK message.
11) build MRTG (separate README) to kill some time.
12) build myself a graph
/usr/local/rrdtool-1.0.45/bin/rrdtool graph \
/tmp/cpu.png --start end-60min \
-f "<IMG src=%s width=%d height=%d>" \
-v "cpu %" \
DEF:user=/tmp/cpu.rrd:u:AVERAGE \
DEF:nice=/tmp/cpu.rrd:n:AVERAGE \
DEF:syst=/tmp/cpu.rrd:s:AVERAGE \
DEF:idle=/tmp/cpu.rrd:i:AVERAGE \
AREA:user#0000FF:user \
STACK:syst#FF0000:system \
STACK:nice#00CC00:nice \
STACK:idle#DFDFDF:idle | \
grep IMG > /tmp/index.html
13) view file using mozilla. Apache is not installed so
use "file:///tmp/index.html"
HTH
Alex
--
http://www.googlism.com/index.htm?ism=alex+van+den+bogaerdt&type=1
This message was produced without any <iframe tags
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list