[rrd-users] Re: I'm getting confused,...
Tobias Oetiker
oetiker at ee.ethz.ch
Wed Jul 28 16:39:24 MEST 1999
Today you sent me mail regarding [rrd-users] I'm getting confused,...:
*> With Referance back to my previous message,
*>
*> Basically I wish to graph the number of mail items passed in a 5 minute
*> period against time,..
*>
*> My data source is the output of mailstats massaged and thrown into an rrd
*> These values continue to increase over time.
*> ie.
*>
*> Statistics from Fri Apr 23 06:43:44 1999
*> M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis Mailer
*> 1 0 0K 38 6617K 0 0 *file*
*> 3 170322 36071001K 0 0K 178 0 local
*> 5 2801469 222467689K 3323986 295160636K 9825 0 esmtp
*> =============================================================
*> T 2971791 258538690K 3324024 295167253K 10003 0
*>
*> I was unsure of which archive type I wanted, so I just slapped them all in
*>
*> /usr/local/bin/rrdtool create messages.rrd \
*> -b -86410 \
*> DS:msgs_from:COUNTER:600:U:U \
*> DS:msgs_to:COUNTER:600:U:U \
*> DS:msgs_rej:COUNTER:600:U:U \
*> DS:msgs_disCOUNTER:600:U:U \
*> DS:msgs_total:COUNTER:600:U:U \
*> RRA:AVERAGE:0.5:1:900 \
*> RRA:AVERAGE:0.5:6:900 \
*> RRA:AVERAGE:0.5:24:900 \
*> RRA:AVERAGE:0.5:288:800 \
*> RRA:MAX:0.5:1:900 \
*> RRA:MAX:0.5:6:900 \
*> RRA:MAX:0.5:24:900 \
*> RRA:MAX:0.5:288:800 \
*> RRA:MIN:0.5:1:900 \
*> RRA:MIN:0.5:6:900 \
*> RRA:MIN:0.5:24:900 \
*> RRA:MIN:0.5:288:800 \
*> RRA:LAST:0.5:1:900 \
*> RRA:LAST:0.5:6:900 \
*> RRA:LAST:0.5:24:900 \
*> RRA:LAST:0.5:288:800
*>
*> with come 'magic' the shell script thats been written telnets to a port on the
*> mailserver from which inetd calls a shell script to produce various stats
*> including the output of mailstats which is then fed back into the rrd as follows
*>
*> /usr/local/bin/rrdtool update $DIR/messages.rrd \
*> -t msgs_from:msgs_to:msgs_rej:msgs_dis:msgs_total \
*> N:$MSGSFROM:$MSGSTO:$MSGSREJ:$MSGSDIS:$TOTAL_MSGS
*>
*> Then, (and this is where, for me, it goes horribly wrong), the following
*> incantation is used
*>
*> /usr/local/bin/rrdtool graph $DIR/messages-day.gif \
*> -v "No. of Messages" \
*> -i \
*> -w 800 \
*> -h 300 \
*> -t "Rolling 24hr graph of Host: $HOSTNAME Date: `date \"+%a %D [ %T ]\"`" \
*> --start -86400 \
*> DEF:msgs_from=$DIR/messages.rrd:msgs_from:AVERAGE \
*> DEF:msgs_to=$DIR/messages.rrd:msgs_to:AVERAGE \
*> DEF:msgs_rej=$DIR/messages.rrd:msgs_rej:AVERAGE \
*> DEF:msgs_total=$DIR/messages.rrd:msgs_total:AVERAGE \
*> VRULE:$MIDNIGHT_PAST#ff0000 \
*> VRULE:$MIDNIGHT#ff0000 \
*> COMMENT:"Colour Key:\n" \
*> AREA:msgs_total#00ff00:"Total Messages = " \
*> GPRINT:msgs_total:AVERAGE:"%lf\n" \
*> LINE1:msgs_from#ff0000:"Messages from = " \
*> GPRINT:msgs_from:AVERAGE:"%lf\n" \
*> LINE1:msgs_to#ff00ff:"Messages to = " \
*> GPRINT:msgs_to:AVERAGE:"%lf\n" \
*> LINE1:msgs_rej#0000ff:"Messages rej = " \
*> GPRINT:msgs_rej:AVERAGE:"%lf\n"
*>
*> (note the date used above is AIX's date function not GNU's)
*>
*> I have an issue with this.
*> The average messages per *second* is graphed, I wanted the number
*> of messages in a 5 minute interval ie the X axis runs
*> from 0->600 as opposed to 0->4.2 (msgs/5min vs msgs/second)
*>
*> What am I missing?.. (btw, just for fun this will eventually get
*> thrown at the contrib section of rrdtool, so I'm trying to make a decent
*> job of it all.
rrd always works on a 'per second' metaphor. but you can use CDEF to
multiply your data with 300 in order to get 'per 5 minute' values
"CDEF:ms_frm=msg_from,300,*"
check the tutorial ... there is such an example ...
cheers
tobi
*> Phil
*> =--=
*>
*> --
*> * To unsubscribe from the rrd-users mailing list, send a message with the
*> subject: unsubscribe to rrd-users-request at list.ee.ethz.ch
*>
*>
--
______ __ _
/_ __/_ / / (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
/ // _ \/ _ \/ / TEL: +41(0)1-6325286 FAX:...1517 ICQ: 10419518
/_/ \.__/_.__/_/ oetiker at ee.ethz.ch http://ee-staff.ethz.ch/~oetiker
--
* To unsubscribe from the rrd-users mailing list, send a message with the
subject: unsubscribe to rrd-users-request at list.ee.ethz.ch
More information about the rrd-users
mailing list