[rrd-users] Noobe needs some adviceing (on rrd and FreeBSD)
X Y
avax_org at ukr.net
Tue Apr 22 16:34:21 CEST 2008
Hello all!
Im a noobe at bouth BSD and RRD, hope some one will help me understand and find, a solution to my Errors. Pardon me for any missprints or misstakes.
SITUATION:
I installed rrdtool-1.2.27 from ports as described in readme`s on my FreeBSD 6.0 server.
It all was made ok with no errors.
Then i did some reading on man and googling for solutions (without need to mess with Mysql or Apache).
Did create sh file
#!/bin/sh
rrdtool create /usr/local/rrdtool-1.2.27/db/network_usage.rrd --start now --step 300\
DS:mail_input:COUNTER:600:U:U \
DS:mail_output:COUNTER:600:U:U \
DS:html_traf:COUNTER:600:U:U \
DS:shtml_traf:COUNTER:600:U:U \
DS:ftp_traf:COUNTER:600:U:U \
DS:all:COUNTER: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 \
It creates fine.
Next i try to update existing data base with counter data from ipfw
manualy cheched ipfw rules and counders do count ok.
#!/bin/sh
mail_input=`ipfw show 80 | awk '{print $3}'`
mail_output=`ipfw show 81 | awk '{print $3}'`
http_traf=`ipfw show 82 | awk '{print $3}'`
shttp_traf=`ipfw show 83 | awk '{print $3}'`
ftp_traf=`ipfw show 84 | awk '{print $3}'`
all=`ipfw show 85 | awk '{print $3}'`
rrdtool update /usr/local/rrdtool-1.2.27/db/network_usage.rrd \
N:$mail_input:$mail_output:$http_traf:$shttp_traf:$ftp_traf:$all
*Here i stumbled on first error.
ERROR: expected timestamp not found in data source from
N:2991935:6312:44368311:5850271:1302:318461263: not found
It says it doesnt know what N is! Mkay, i write another line dates=`date +%s | awk '{print $1}'`
and add $dates instead of N.
Ok no Errors.
Next i try to graph it all. With following sh file
#!/bin/sh
WWWPREFIX=/home/alp/hosting/!default/rrdtool/images
RRDPREFIX=/usr/local/rrdtool-1.2.27/db
rrdtool graph $WWWPREFIX/network.png \
--width 500 --height 500 --imgformat PNG \
--start -43200 \
--title "Bandwidth graph for last 12 hours" --rigid --color BACK#FAFAFA \
--vertical-label Kbit/sec \
DEF:ifino=$RRDPREFIX/network_usage.rrd:mail_input:AVERAGE \
DEF:ifouto=$RRDPREFIX/network_usage.rrd:mail_output:AVERAGE \
DEF:html_traf=$RRDPREFIX/network_usage.rrd:html_traf:AVERAGE \
DEF:shtml_traf=$RRDPREFIX/network_usage.rrd:shtml_traf:AVERAGE \
DEF:ftp_traf=$RRDPREFIX/network_usage.rrd:ftp_traf:AVERAGE \
DEF:all=$RRDPREFIX/network_usage.rrd:all:AVERAGE \
CDEF:smtp=ifino,128, \
CDEF:pop3=ifouto,128, \
CDEF:html=html_traf,128, \
CDEF:shtml=shtml_traf,128, \
CDEF:ftp=ftp_traf,128, \
CDEF:all1=all,128, \
VDEF:sumsmtp=ifino,TOTAL \
VDEF:sumpop3=ifouto,TOTAL \
VDEF:sumhtml=html_traf,TOTAL \
VDEF:sumshtml=shtml_traf,TOTAL \
VDEF:sumftp=ftp_traf,TOTAL \
VDEF:sumall=all,TOTAL \
VDEF:maxsmtp=smtp,MAXIMUM \
VDEF:maxpop3=pop3,MAXIMUM \
VDEF:maxhtml=html,MAXIMUM \
VDEF:maxshtml=shtml,MAXIMUM \
VDEF:maxftp=ftp,MAXIMUM \
VDEF:maxall=all1,MAXIMUM \
VDEF:avgsmtp=smtp,AVARAGE \
VDEF:avgpop3=pop3,AVERAGE \
VDEF:avghtml=html,AVERAGE \
VDEF:avgshtml=shtml,AVERAGE \
VDEF:avgftp=ftp,AVERAGE \
VDEF:avgall=all1,AVERAGE \
AREA:all1#CCCCCC:"ALL" \
GPRINT:maxall:"Max=%lf%s" \
GPRINT:avgall:"Avg=%lf%s" \
GPRINT:sumall:"Sum=%lf %sbytes\l" \
LINE1:html#FF6600:"HTML" \
GPRINT:maxhtml:"Max=%lf%s" \
GPRINT:avghtml:"Avg=%lf%s" \
GPRINT:sumhtml:"Sum=%lf %sbytes\l" \
LINE1:shtml#00FF00:"SHTML" \
GPRINT:maxshtml:"Max=%lf%s" \
GPRINT:avgshtml:"Avg=%lf%s" \
GPRINT:sumshtml:"Sum=%lf %sbytes\1" \
LINE1:pop3#0000FF:"POP3" \
GPRINT:maxpop3:"Max=%lf%s" \
GPRINT:avgpop3:"Avg=%lf%s" \
GPRINT:sumpop3:"Sum=%lf %sbytes\l" \
LINE1:smtp#FF0000:"SMTP" \
GPRINT:maxsmtp:"Max=%lf%s" \
GPRINT:avgsmtp:"Avg=%lf%s" \
GPRINT:sumsmtp:"Sum=%lf %sbytes\l" \
LINE1:ftp#FF00FF:"FTP" \
GPRINT:maxftp:"Max=%lf%s" \
GPRINT:avgftp:"Avg=%lf%s" \
GPRINT:sumftp:"Sum=%lf %sbytes\1" \
Another one:
ERROR: Could not make sense out of ' '
GPRINT:avgpop3:Avg=%lf%s: not found
GPRINT:sumftp:Sum=%lf %sbytes\1: not found
Doooh, i made it more simple
#!/bin/sh
WWWPREFIX=/home/alp/hosting/!default/rrdtool/images
RRDPREFIX=/usr/local/rrdtool-1.2.27/db
rrdtool graph $WWWPREFIX/lasttest.png --start -1d --end now --title "ALL hail TOBI!" DEF:htmkets=$RRDPREFIX/network_usage.rrd:html_traf:AVERAGE \
DEF:shtmkets=$RRDPREFIX/network_usage.rrd:all:AVERAGE "CDEF:htm=htmkets,8,*" "CDEF:sht=shtmkets,8,*" \
AREA:htm#00FF00:"Totall" LINE:sht#0000FF:"LAN"
Next i did some shaman dance with "create" options of first file (--start 12088556117 only, then --step 300 or -s 300 or without step or any options)
And all lead to one peak on graph and then nothing.
Ok i think that my trafic is low atm so i dont mind the cap and crontab -e */5 * * * * sh file wich launches two lines (one refresh sh and other graph sh).
Picture updates and lonly peak moves left (so i think graphing works fine).
But wtf! trafshow shows traffic coming and going, counters count and i get no graph...
That makes my brain demage...
I tryed to consult with people who recomend me rrdtool but their configs didnt work allso.
With hope of a helping hand here i write this mail. Thank you for reading it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080422/41a92a6a/attachment.html
More information about the rrd-users
mailing list