[rrd-users] Problems Converting rrd Values into Decimal Format

Brad brad_watts at attcanada.net
Mon Sep 17 20:27:55 MEST 2001


Hi there...

Looking at the rrd data file associated with the following router
interface [sr11-0], the following values are obtained (in scientific
notation) using:

rrdtool fetch snmpif-sr11-0.rrd AVERAGE

UNIX_Time            inbytes                            outbytes
1000743000:            6.3364087974e+01
1.0377560946e+02                    *** Last value in table

I want to convert these values into Decimal Format and subsequently into
bits (The Graph Displays Bits), so I do the following:

Inbytes   -->  6.3364087974 * 10 ** 01 * 8 =  506.912703792
bits                           ** CORRECT -- AS DISPLAYED ON GRAPH
[Current In = 506.91]

Outbytes  -->  1.0377560946e+02 * 10 ** 02 * 8  =  86.1550169503555
bits          ** INCORRECT -- NOT DISPLAYED ON GRAPH [Current Out =
830.20]

As you can see, the bits value for "Outbytes" Data Source is not the
same as that displayed on the image... However, the "Inbytes" Data
Source value obtained from the rrd data file is consistent with that
displayed on the image. This finding also appears consistent with all
other routers and interfaces in our network. Does anyone know what I can
do to fix this? Maybe I'm doing something wrong? Ultimately, I wish to
print out (on the command line) the maximum Inbytes and Outbytes for an
interface on any given WEEK. Is there an easier way to do this?

Thanks in advance...

Brad

---------------------------------------------------------------------------------------------------

Here is the snmpif config file (below):

source          snmp
step            300
data            inbytes=if-*:inoctets COUNTER:600:0:U
data            outbytes=if-*:outoctets COUNTER:600:0:U
data            inerrors=if-*:inerrors COUNTER:600:0:U
data            outerrors=if-*:outerrors COUNTER:600:0:U
data            inucastpkts=if-*:inucastpkts COUNTER:600:0:U
data            outucastpkts=if-*:outucastpkts COUNTER:600:0:U
data            innucastpkts=if-*:innucastpkts COUNTER:600:0:U
data            outnucastpkts=if-*:outnucastpkts COUNTER:600:0:U
data            status=if-*:status GAUGE:600:0:1
archives        day-avg week-avg month-avg 3month-avg year-avg day-min
week-min month-min 3month-min year-min day-max week-max month-max 3mo
nth-max year-max
times           day yesterday week 3month year

graph           bytes-*
                --title "##HOST## bits/s for ##WILDPART##
(##GRAPHTIME##)"
                --lower-limit 0
                --vertical-label 'bits/sec'
                DEF:inbytes=##DB##:inbytes:AVERAGE
                DEF:outbytes=##DB##:outbytes:AVERAGE
                CDEF:inbits=inbytes,8,*
                CDEF:outbits=outbytes,8,*
                'AREA:inbits###INCOLOR##:bps in\j'
                'LINE2:outbits###OUTCOLOR##:bps out\j'

                'GPRINT:inbits:LAST:Current in=%4.2lf%s\j'
                'GPRINT:outbits:LAST:Current out=%4.2lf%s\j'

                'GPRINT:inbits:AVERAGE:AVG in=%.0lf%s\j'
                'GPRINT:outbits:AVERAGE:AVG out=%.0lf%s\j'

                'GPRINT:inbits:MAX:MAX in=%4.2lf%s\j'
                'GPRINT:outbits:MAX:MAX out=%4.2lf%s\j'

------------------------------------------------------------------------------------------------------------------

here's the tail of the data file for snmpif-sr11-0.rrd (below):

                       inbytes
outbytes                 inerrors
outerrors                 inucastpkts           outucastpkts
innucastpkts          outnucastpkts        status

1000740900: 8.3484820275e+01 1.0884960051e+02 0.0000000000e+00
0.0000000000e+00 8.2967785968e-01 2.5795199745e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000741200: 8.9234652888e+01 1.1220102338e+02 0.0000000000e+00
0.0000000000e+00 8.2319201554e-01 2.5780141907e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000741500: 6.3471697518e+01 1.0420140150e+02 0.0000000000e+00
0.0000000000e+00 8.0495452260e-01 2.5716396240e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000741800: 7.2517172667e+01 1.0612265464e+02 0.0000000000e+00
0.0000000000e+00 8.3075528973e-01 2.5786157894e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000742100: 5.6858587310e+01 1.0079262783e+02 0.0000000000e+00
0.0000000000e+00 8.0027329409e-01 2.5679635228e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000742400: 4.8679601329e+01 9.8225952344e+01 0.0000000000e+00
0.0000000000e+00 7.8572792678e-01 2.5624492310e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000742700: 8.2983883041e+01 1.0979923458e+02 0.0000000000e+00
0.0000000000e+00 8.0319367956e-01 2.5642594787e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000743000: 6.3364087974e+01 1.0377560946e+02 0.0000000000e+00
0.0000000000e+00 8.0605720824e-01 2.5718721078e+00 0.0000000000e+00
0.0000000000e+00 1.0000000000e+00
1000743300: NaN NaN NaN NaN NaN NaN NaN NaN NaN
1000743600: NaN NaN NaN NaN NaN NaN NaN NaN NaN



-- Attached file removed by Listar and put at URL below --
-- Type: image/png
-- Size: 5k (5770 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/snmpif-sr11-0-bytes--day.png


--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list