[rrd-users] Re: Division Bug with RRDTool

Rodrigo Santos rodrigo.santos at quantiza.com
Mon Dec 5 12:25:57 MET 2005


Thanks for your reply Serge,

but if you to look at graphs.mf, it will see the following variables 
(CDEFs and DEFs):

DEF_subnet_out_bytes=DEF:xsubnet_out_bytes=$(rrddir)/subnet.rrd:out_bytes:AVERAGE
DEF_subnet_in_bytes=DEF:xsubnet_in_bytes=$(rrddir)/subnet.rrd:in_bytes:AVERAGE

CDEF_subnet_bytes=CDEF:xsubnet_bytes=xsubnet_out_bytes,xsubnet_in_bytes,+
CDEF_subnet_Mbps=CDEF:subnet_Mbps=xsubnet_bytes,.000008,*

**In the graph:**
totals$(tag).$(filetype): subnet.rrd total.rrd unknown.rrd MCAST.rrd
     $(rrdtool) graph \
     $@ \
     --interlaced \
     --imgformat $(IMGFORMAT) \
     --width $(width) \
     --height $(height) \
     -v 'megabits/sec' \
     -t '$(organization): I/O by Network (Mb/s)' \
     -s $(totals_past_hours) \
     $(DEF_total_out_bytes) \
     $(DEF_total_in_bytes) \
     $(CDEF_total_bytes) \
     $(CDEF_total_Mbps) \
     $(DEF_subnet_out_bytes) \ <========
     $(DEF_subnet_in_bytes) \  <========
     $(CDEF_subnet_bytes) \    <========
     $(CDEF_subnet_Mbps) \     <========
     $(DEF_MCAST_in_bytes) \
     $(DEF_MCAST_out_bytes) \
     $(CDEF_MCAST_in_Mbps) \
     $(CDEF_MCAST_out_Mbps) \
     $(CDEF_MCAST_Mbps) \
     $(CDEF_TOTAL_Mbps) \
     'CDEF:mcast_pct=MCAST_Mbps,TOTAL_Mbps,/,100,*' \
     'CDEF:subnet_in_bytes_pct=xsubnet_in_bytes' \   <========
     'CDEF:subnet_out_bytes_pct=xsubnet_out_bytes' \ <========
     'CDEF:subnet_bytes_pct=xsubnet_bytes' \         <========
     'CDEF:subnet_Mbps_pct=subnet_Mbps' \            <========
     'CDEF:TOTAL_Mbps_pct=TOTAL_Mbps' \
     'CDEF:total_Mbps_pct=total_Mbps' \
     'CDEF:div_Mbps_pct=subnet_Mbps,TOTAL_Mbps,/' \  <======== division
     'CDEF:subnet_pct=subnet_Mbps,TOTAL_Mbps,/,100,*' \ <=====
     AREA:subnet_Mbps#880000:'subnet (x.x.x.x)' \
     LINE1:TOTAL_Mbps#000000:'TOTAL I/O' \
     COMMENT:'\n' \
     COMMENT:'\n' \
     GPRINT:subnet_in_bytes_pct:AVERAGE:'subnet IN BYTES %lf' \
     GPRINT:subnet_out_bytes_pct:AVERAGE:'subnet OUT BYTES %lf' \
     GPRINT:subnet_bytes_pct:AVERAGE:'subnet BYTES (IN+OUT) %lf' \
     GPRINT:subnet_Mbps_pct:AVERAGE:'subnet Mbps (BYTES*0.000008) %lf' \
     GPRINT:TOTAL_Mbps_pct:AVERAGE:'TOTAL Mbps %lf' \
     GPRINT:total_Mbps_pct:AVERAGE:'total Mbps %lf' \
     GPRINT:div_Mbps_pct:AVERAGE:'DIV (subnet/TOTAL)Mbps %lf' \
     GPRINT:mcast_pct:AVERAGE:'MCAST %.1lf%%'

**The results:**
subnet_in_bytes = 128.319883
subnet_out_bytes= 4903.096164
subnet_bytes    = 5031.416047 (IN+OUT)
subnet_Mbps     = 0.040251    (BYTES*0.000008)
TOTAL_Mbps      = 0.079754
div_Mbps        = 0.272552    (subnet_Mbps/TOTAL_Mbps) <========== error

But, using a calculator, 0.040251/0.079754 = 0.504689

Thanks,

Rodrigo Santos

Serge Maandag wrote:
>>I´m making graphs with rrdtool, but I think that the the 
>>percentage values do not correspond the reality. I am using 
>>template graphs.mf without no alteration in expressions RPN.
> 
> 
> Can't say I ever heard of "template graphs.mf".
> 
> 
>>Expressions:
>>DEF_subnet_out_bytes =
>>DEF:xsubnet_out_bytes=$(rrddir)/subnet.rrd:out_bytes:AVERAGE
>>DEF_subnet_in_bytes =
>>......
>>div_Mbps        = 0.272552    (subnet_Mbps/TOTAL_Mbps) 
>><========== error
>>
>>But, using a calculator, 0.040251/0.079754 = 0.504689
>>
>>I would like to know what´s happening?
> 
> 
> Well these can't be the commands you used.
> You have empty DEF lines and no PRINT/GPRINT lines.
> 
> Post the ones you did use, otherwise noone can help you..
> 
> Serge.
> 
> -------------
> Op de inhoud van dit e-mailbericht en de daaraan gehechte bijlagen is de inhoud van de volgende disclaimer van toepassing: http://www.zeelandnet.nl/disclaimer.php
> 
> -------------
> For the content of this e-mail message and its attachment(s) the following disclaimer applies: http://www.zeelandnet.nl/disclaimer.php
> 

--
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