Re: [rrd-users] Noobe needs some adviceing (on rrd and FreeBSD)

2008-04-22 Thread X Y
Thanks for reply Andreas Maus  
  
thouse ? are from my mail provider i think... there are none in the scripts :)  
  
  ___
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


Re: [rrd-users] Noobe needs some adviceing (on rrd and FreeBSD)

2008-04-22 Thread Andreas Maus
On Tue, Apr 22, 2008 at 05:34:21PM +0300, X Y wrote:
> Hello all!  
Hi.

> 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.  
 Don't worry ;)

> 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  
*aeh* whats that '?' before N:... ?
Is this an error of your mailclient or is it indeed in your command?
Can you attach the script (to avoid error due copy and paste)?

> *Here i stumbled on first error.  
>   
> ERROR: expected timestamp not found in data source from  
> N:2991935:6312:44368311:5850271:1302:318461263: not found  
Well maybe the magic '?' in the command is _really_ in the command.
This error indicates that you called:
rrdtool update ... _AND_ then ?N:$mail_input:$...

(These are two errors. "expected timestamp" from rrdtool and "18461263: not 
found" from the shell).

> 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 \  
[... snipp ...]
See the mystic '?' again !
I guess thats really the reason your commands failed.

HTH,

Andreas.

-- 
Dipl.-Ing. Andreas Maus science+computing ag
System Administration   Hagellocher Weg 73
tel.: +49 7071 9457 671 72070 Tuebingen, Germany
fax: +49 7071 9457 411  www.science-computing.de


pgp38eimngDAS.pgp
Description: PGP signature
___
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


[rrd-users] Noobe needs some adviceing (on rrd and FreeBSD)

2008-04-22 Thread X Y
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#CC:"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#FF:"POP3" \  
 GPRINT:maxpop3:"Max=%lf%s" \  
 GPRINT:avgpop3:"Avg=%lf%s"  \  
  GPRINT:sumpop3:"Sum=%lf %sbytes\l" \  
 LINE1:smtp#FF:"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#FF:"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