Re: How does cacti calculates AVG?

Andre Luis <[email protected]>
Newsgroups gmane.network.cacti.user
Message-ID <CAGUytZ3sCHErKLJvoznGaS+HYT=sxd5aXyquA9y=fB3hBkXOTA@mail.gmail.com>
Thanks Gandalf..
the problem was solved..
the problem was that I had some "nan" values on my rrd file... as I could
see, cacti ignores these values on the AVG ... so if I have 5 values, one
of them is nan, to cacti I have only 4 values..
(it sums the 4 values and divide by 4)
my script was considering nan values as 0, so I had 5 values
(it sums the 5 values - one of them is -, so I have the same 4 values than
cacti consider - and divide by 5) ..
that's why I was getting a different value..

it was solved with a simple grep -v on my script...lol


thanks again Gandalf...


2012/3/16 Gandalf <[email protected]>

> Ok, this is the standard rrdtool AVERAGE, that is used here.
> Find some hints for that at http://www.vandenbogaerdt.nl that describes
> quite
> well what is happening here. Or consult the rrdtool man-pages and/or the
> web
> site. There's nothing Cacti does here apart from plain rrdtool
> Reinhard
>
> On 16.03.2012 13:43, Andre Luis wrote:
> > /usr/bin/rrdtool graph - \
> > --imgformat=PNG \
> > --start=1331809200 \
> > --end=1331845200 \
> > --title="Oracle - sessions RAC" \
> > --base=1000 \
> > --height=120 \
> > --width=500 \
> > --alt-autoscale-max \
> > --lower-limit=0 \
> > COMMENT:"From 2012/03/15 08\:00\:00 To 2012/03/15 18\:00\:00\c" \
> > COMMENT:"  \n" \
> > --vertical-label="" \
> > --slope-mode \
> > --font TITLE:12: \
> > --font AXIS:8: \
> > --font LEGEND:10: \
> > --font UNIT:8: \
> >
> DEF:a="/opt/collectd/var/lib/collectd/srv-rac01/oracle-OracleDatabase/gauge-Oracle-Sessions.rrd":value:AVERAGE
> > \
> > LINE2:a#FF0000FF:"Sessions\:"  \
> > GPRINT:a:LAST:"Current\:%8.0lf"  \
> > GPRINT:a:MAX:"Max\:%8.0lf"  \
> > GPRINT:a:AVERAGE:"Avg\:%8.0lf\n"
> >
> >
> > 2012/3/15 Gandalf <[email protected]>
> >
> >> There are two different ways of printing an AVG with cacti. Please
> provide
> >> the
> >> rrdtool graph statement used to clarify. Goto Graph Management and
> switch
> >> to
> >> DEBUG to see that statement
> >> Reinhard
> >>
> >> On 15.03.2012 20:25, Andre Luis wrote:
> >>> I am monitoring the number of sessions on a database.
> >>> now I am seeing On the graph on the period of 2012-03-14 00:00 to
> >>> 2012-03-15:00 ... and the avg on the graph is 200 sessions on this
> >> period...
> >>> but if I sum all the data stored on the rrd on the same period (using
> >>> rrdtool fetch), then divide by number of the datas, then I got
> something
> >>> about 100 sessions..
> >>>
> >>> anyone knows why is this happening?
> >>> so, how does cacti calculates the AVG?
> >>>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> This SF email is sponsosred by:
> >> Try Windows Azure free for 90 days Click Here
> >> http://p.sf.net/sfu/sfd2d-msazure
> >> _______________________________________________
> >> cacti-user mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/cacti-user
> >>
> >
> >
> >
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> cacti-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cacti-user
>



-- 
Att,
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.