[rrd-users] Division error with RRDTool
Zabiziz Zaz
zabiziz at gmail.com
Tue Oct 17 20:30:08 MEST 2006
Hi,
I'm trying to use the command CDEF to do some division using rrdtool, but
the results that i'm getting isn't right.
The code:
"$rrd" graph teste.png \
-aPNG \
-h200 \
-w475 \
--interlaced \
--start=1160535600 \
--end=1160621999 \
--vertical-label=Kbps \
'DEF:TotGeral_Rx_bytes=/usr/local/clientes/graficos/total.rrd:RxBytes:AVERAGE'
\
'CDEF:TotGeral_Rx_bits=TotGeral_Rx_bytes,-8,*,1024,/' \
'DEF:RxOrghttp=/usr/local/clientes/graficos/SERPRO_MF_RJ/service_http.rrd:RxBytesOrg:AVERAGE'
\
'CDEF:RxOrghttp0=RxOrghttp,-8,*,1024,/' \
'CDEF:Perc_Geral_RxOrghttp0=RxOrghttp0,TotGeral_Rx_bits,/,100,*' \
'AREA:RxOrghttp0#746FAE' \
'GPRINT:RxOrghttp0:AVERAGE:Rx %3.1lfKbps' \
'GPRINT:TotGeral_Rx_bits:AVERAGE:Total (%2.3lf)\j' \
'GPRINT:Perc_Geral_RxOrghttp0:AVERAGE:Perc (%2.3lf)\j' \
'LINE:TotGeral_Rx_bits#000000' \
The result of GPRINT:
Rx=-111.6
Total=-1026.422
Perc=6.190
But Perc should be (-111.6/-1026.422)*100 = 10.872
Anybody knows how to fix that?
Thanks!
Zabiziz
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list