[rrd-users] how to take data from a .log file to RRD database
youssef eladouzi
eladouziyoussef at gmail.com
Fri Nov 5 10:01:36 CET 2010
HELLO,
I use RRDtool for the first time, I create RRD database to supervise
traffic of successful requests of one server. The number of successful
requests are generated every 60 seconds, and stored in a file named
data.log, it looks like :
10/08/31-02:46:56 131
10/08/31-02:46:56 138
10/08/31-02:46:56 144
10/08/31-02:47:56 119
10/08/31-02:47:56 121
10/08/31-02:47:56 122
10/08/31-02:48:56 118
10/08/31-02:48:56 119
10/08/31-02:48:56 121
10/08/31-02:49:56 130
10/08/31-02:49:56 136
10/08/31-02:49:56 140
10/08/31-02:49:56 4
10/08/31-02:50:56 117
10/08/31-02:50:56 129
10/08/31-02:50:56 135
i want to take data for example each 5min, average it and store it in my
rrd database my script shell is:
#!/bin/sh
FICRRD=$(basename $0 .sh) # i give my script the name 'essai.sh'
# - Date initialization :
DTDEB=$(date -d "20100831 02:46:56" +'%s')
# - Creation of my database:
echo "Creation of database ${FICRRD}"
rrdtool create ${FICRRD}.rrd \
-b ${DTDEB} \
-s 60 #update every 1 minute so i can collect all data.
DS:${FICRRD}:GAUGE:120:0:U \
RRA:AVERAGE:0.5:5:6
# CDP=5 PDP(1 PDP collected each 60s), we stored each 30 min.
# -store data:
while read line
do
val=$( cut -d" " -f2 data.log) # val contains the number of
successful requests
rrdtool update ${FICRRD} $DTDEB:$val
done <data.log
------
when i run my script shell using the command ./essai.sh i get this:
ERROR: you must define at least one Round Robin Archive
./essai.sh: 26: -b: not found
./essai.sh: 30: DS:essai:GAUGE:600:0:U: not found
./essai.sh: 31: RRA:AVERAGE:0.5:5:6: not found
what am I doing wrong ?
I'm using Ubuntu 10.04, RRDtool 1.3.8
I hope anyone can help.
best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20101105/43403a4f/attachment.htm
More information about the rrd-users
mailing list