[mrtg] Re: [mrtg-developers] Re: Spikes in MRTG graphs and logs... FOUND the PROBLEM

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Thu Jul 19 22:27:29 MEST 2001

Schuyler Bishop wrote:

[Moved the discussion to the users list]

> Ok.  After I hacked MRTG to do my yearly stuff, I thought about a way those
> of us using RRDTool with MRTG could get rid of the spikes.  Right before the
> line that has (in 2.9.12a): (in sub writegraphics() )
> RRDs::update("$rrd", "$time:$inlast:$outlast");
> I put two lines (thanks to Tobi for the specific syntax):
> $inlast = 'U' if int($inlast) == -1;
> $outlast = 'U' if int($outlast) == -1;

Right.  This will render two intervals unknown.  The first interval is
the one before the update, the other is the interval after the update.

RRDtools has the "xff" setting.  It tells RRDtool how many intervals
(specified as a factor; for instance 0.5 meaning one out of two) may
be invalid while still producing a valid CDP (consolidated data point).

Play a bit with RRDtool.  Create a script that creates a database,
fills it with known semi-random data and generate a report (using
"rrdtool fetch"), each time with the same time stamps.  Alter the
xff setting keeping all other variables the same.  This will allow
you to see what is happening and it will most likely give you a good
understanding of RRDtool.

> That will update RRD with an Unknown, and RRDtool rolls the previous known
> good poll to the next interval.  The net result is an empty "space" in the
> graph instead of a spike.

RRDtool does *not* use the previous known good poll.  The 'spaces' are
NaN values (not a number).

If you're using RRDtool you'll find that it uses lesser resources.
This makes it possible to query your device more often.  If you'd
take your efforts one (not too big) step further, you can create
your own database with other properties than the default mrtg-style.
For instance, you could have five sets of RRAs.  In stead of the
default five-minute step size use a one-minute step size.  The first
RRA uses steps==1 (one step per CDP) and the other four would have
steps==5 (for the "daily" graph), steps==30 (for the "weekly" graph)
and so on.  The numbers are just multiplied by five (*not* the size
of each RRA, only "steps" !).

If the first (the extra) RRA has 24 rows you can review the last two
hours in a one-minute resolution.  The other RRAs will behave like
usual so no alterations should be needed.  As a bonus you can set the
xff factor to whatever you like (within its boundaries of course) and
thus control the behaviour of RRDtool in case of failed updates.

If you only want the bonus, just change step into 60 and multiply each
of the steps by 5 (note the difference between "step" and "steps", see
the rrdcreate.txt doc file). Now update each minute and voila.


Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list