<html>
<body>
<div style='font: 12pt sans-serif;'>
Hello all!
<br />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.
<br />
<br />SITUATION:
<br />I installed rrdtool-1.2.27 from ports as described in readme`s on my FreeBSD 6.0 server.
<br />It all was made ok with no errors.
<br />
<br />Then i did some reading on man and googling for solutions (without need to mess with Mysql or Apache).
<br />
<br />Did create sh file
<br />
<br />#!/bin/sh
<br />
<br />rrdtool create /usr/local/rrdtool-1.2.27/db/network_usage.rrd --start now --step 300\
<br />DS:mail_input:COUNTER:600:U:U \
<br />DS:mail_output:COUNTER:600:U:U \
<br />DS:html_traf:COUNTER:600:U:U \
<br />DS:shtml_traf:COUNTER:600:U:U \
<br />DS:ftp_traf:COUNTER:600:U:U \
<br />DS:all:COUNTER:600:U:U \
<br />RRA:AVERAGE:0.5:1:600 \
<br />RRA:AVERAGE:0.5:6:700 \
<br />RRA:AVERAGE:0.5:24:775 \
<br />RRA:AVERAGE:0.5:288:797 \
<br />RRA:MAX:0.5:1:600 \
<br />RRA:MAX:0.5:6:700 \
<br />RRA:MAX:0.5:24:775 \
<br />RRA:MAX:0.5:288:797 \
<br />
<br />It creates fine.
<br />
<br />Next i try to update existing data base with counter data from ipfw
<br />manualy cheched ipfw rules and counders do count ok.
<br />
<br />#!/bin/sh
<br />mail_input=`ipfw show 80 | awk '{print $3}'`
<br />mail_output=`ipfw show 81 | awk '{print $3}'`
<br />http_traf=`ipfw show 82 | awk '{print $3}'`
<br />shttp_traf=`ipfw show 83 | awk '{print $3}'`
<br />ftp_traf=`ipfw show 84 | awk '{print $3}'`
<br />all=`ipfw show 85 | awk '{print $3}'`
<br />
<br />rrdtool update /usr/local/rrdtool-1.2.27/db/network_usage.rrd \
<br /> N:$mail_input:$mail_output:$http_traf:$shttp_traf:$ftp_traf:$all
<br />
<br />*Here i stumbled on first error.
<br />
<br />ERROR: expected timestamp not found in data source from
<br />N:2991935:6312:44368311:5850271:1302:318461263: not found
<br />
<br />It says it doesnt know what N is! Mkay, i write another line dates=`date +%s | awk '{print $1}'`
<br />and add $dates instead of N.
<br />Ok no Errors.
<br />
<br />Next i try to graph it all. With following sh file
<br />
<br />#!/bin/sh
<br />WWWPREFIX=/home/alp/hosting/!default/rrdtool/images
<br />RRDPREFIX=/usr/local/rrdtool-1.2.27/db
<br />
<br />rrdtool graph $WWWPREFIX/network.png \
<br /> --width 500 --height 500 --imgformat PNG \
<br /> --start -43200 \
<br /> --title "Bandwidth graph for last 12 hours" --rigid --color BACK#FAFAFA \
<br /> --vertical-label Kbit/sec \
<br /> DEF:ifino=$RRDPREFIX/network_usage.rrd:mail_input:AVERAGE \
<br /> DEF:ifouto=$RRDPREFIX/network_usage.rrd:mail_output:AVERAGE \
<br /> DEF:html_traf=$RRDPREFIX/network_usage.rrd:html_traf:AVERAGE \
<br /> DEF:shtml_traf=$RRDPREFIX/network_usage.rrd:shtml_traf:AVERAGE \
<br /> DEF:ftp_traf=$RRDPREFIX/network_usage.rrd:ftp_traf:AVERAGE \
<br /> DEF:all=$RRDPREFIX/network_usage.rrd:all:AVERAGE \
<br /> CDEF:smtp=ifino,128, \
<br /> CDEF:pop3=ifouto,128, \
<br /> CDEF:html=html_traf,128, \
<br /> CDEF:shtml=shtml_traf,128, \
<br /> CDEF:ftp=ftp_traf,128, \
<br /> CDEF:all1=all,128, \
<br /> VDEF:sumsmtp=ifino,TOTAL \
<br /> VDEF:sumpop3=ifouto,TOTAL \
<br /> VDEF:sumhtml=html_traf,TOTAL \
<br /> VDEF:sumshtml=shtml_traf,TOTAL \
<br /> VDEF:sumftp=ftp_traf,TOTAL \
<br /> VDEF:sumall=all,TOTAL \
<br /> VDEF:maxsmtp=smtp,MAXIMUM \
<br /> VDEF:maxpop3=pop3,MAXIMUM \
<br /> VDEF:maxhtml=html,MAXIMUM \
<br /> VDEF:maxshtml=shtml,MAXIMUM \
<br /> VDEF:maxftp=ftp,MAXIMUM \
<br /> VDEF:maxall=all1,MAXIMUM \
<br /> VDEF:avgsmtp=smtp,AVARAGE \
<br /> VDEF:avgpop3=pop3,AVERAGE \
<br /> VDEF:avghtml=html,AVERAGE \
<br /> VDEF:avgshtml=shtml,AVERAGE \
<br /> VDEF:avgftp=ftp,AVERAGE \
<br /> VDEF:avgall=all1,AVERAGE \
<br /> AREA:all1#CCCCCC:"ALL" \
<br /> GPRINT:maxall:"Max=%lf%s" \
<br /> GPRINT:avgall:"Avg=%lf%s" \
<br /> GPRINT:sumall:"Sum=%lf %sbytes\l" \
<br /> LINE1:html#FF6600:"HTML" \
<br /> GPRINT:maxhtml:"Max=%lf%s" \
<br /> GPRINT:avghtml:"Avg=%lf%s" \
<br /> GPRINT:sumhtml:"Sum=%lf %sbytes\l" \
<br /> LINE1:shtml#00FF00:"SHTML" \
<br /> GPRINT:maxshtml:"Max=%lf%s" \
<br /> GPRINT:avgshtml:"Avg=%lf%s" \
<br /> GPRINT:sumshtml:"Sum=%lf %sbytes\1" \
<br /> LINE1:pop3#0000FF:"POP3" \
<br /> GPRINT:maxpop3:"Max=%lf%s" \
<br /> GPRINT:avgpop3:"Avg=%lf%s" \
<br /> GPRINT:sumpop3:"Sum=%lf %sbytes\l" \
<br /> LINE1:smtp#FF0000:"SMTP" \
<br /> GPRINT:maxsmtp:"Max=%lf%s" \
<br /> GPRINT:avgsmtp:"Avg=%lf%s" \
<br /> GPRINT:sumsmtp:"Sum=%lf %sbytes\l" \
<br /> LINE1:ftp#FF00FF:"FTP" \
<br /> GPRINT:maxftp:"Max=%lf%s" \
<br /> GPRINT:avgftp:"Avg=%lf%s" \
<br /> GPRINT:sumftp:"Sum=%lf %sbytes\1" \
<br />
<br />Another one:
<br />ERROR: Could not make sense out of ' '
<br />GPRINT:avgpop3:Avg=%lf%s: not found
<br />GPRINT:sumftp:Sum=%lf %sbytes\1: not found
<br />
<br />Doooh, i made it more simple
<br />
<br />#!/bin/sh
<br />WWWPREFIX=/home/alp/hosting/!default/rrdtool/images
<br />RRDPREFIX=/usr/local/rrdtool-1.2.27/db
<br />
<br />rrdtool graph $WWWPREFIX/lasttest.png --start -1d --end now --title "ALL hail TOBI!" DEF:htmkets=$RRDPREFIX/network_usage.rrd:html_traf:AVERAGE \
<br />DEF:shtmkets=$RRDPREFIX/network_usage.rrd:all:AVERAGE "CDEF:htm=htmkets,8,*" "CDEF:sht=shtmkets,8,*" \
<br />AREA:htm#00FF00:"Totall" LINE:sht#0000FF:"LAN"
<br />
<br />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)
<br />
<br />And all lead to one peak on graph and then nothing.
<br />
<br />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).
<br />Picture updates and lonly peak moves left (so i think graphing works fine).
<br />
<br />But wtf! trafshow shows traffic coming and going, counters count and i get no graph...
<br />
<br />That makes my brain demage...
<br />
<br />I tryed to consult with people who recomend me rrdtool but their configs didnt work allso.
<br />With hope of a helping hand here i write this mail. Thank you for reading it.
<br />
<br />
</div></body>
</html>