[mrtg] Re: Base logic for external arbitrary data to mrtg
PAUL WILLIAMSON
pwilliamson at mandtbank.com
Wed Dec 7 03:42:43 MET 2005
>>> "Scott Haneda" <lists at newgeo.com> 12/06/05 9:07 PM >>>
> I run an old cranky email server, it does not provide me much in the
> way of message counts. I do want to get this into mrtg.
Isn't that the way all good mail servers should be?
> What I can do now, is roll email logs once a day, and grep out a
> sent and received count, plus datestamp.
>
> Of course, I don't want to do this on years worth of logs every
> single minute, so I need to know the logic to get mrtg to be happy.
This should be easy enough.
> I don't fully understand what MRTG does under the hood to get
> the "data over time" parts.
It collects the data every 5 minutes and shoves it into a flat
text file. Once the data is in there, you don't need to do
anything else except let it continue to collect data.
> Is it kinda of like, once every 5 minutes, I want to get the last
> chunk of log data from the email server up to the point where
> the last data was taken, get my counts, and store those
> somewhere that mrtg can grab them?
Yeah, kinda like that.
> Just seems like there is a little window for margin of error, and I
> am not seeing how this all works from a very general perspective.
There certainly is. Take for instance the default method - octets
passed through an interface since the last collection time slice.
Let's say its 300. Then in the next five minutes, the value is 900.
That is 600 octets. Assuming MRTG is able to collect the data
at EXACTLY the five minute interval, that would be 2 octets per
second. If MRTG isn't able to collect it at five minutes, but
instead 5:01 and the count was still 900, MRTG will "normalize"
the data, leaving you with (still) 2 octets per second. If the
count is low enough (or the delay in collection long enough)
MRTG will simply make a calculated estimation at what the
data *should* have been at the five minute mark. Because,
you see, MRTG will store data ONLY at the interval it is
supposed to - which in its default state is every five minutes
starting from the time the text file of data is initialized.
In your case with mail messages, you need to make
sure that you're getting at least 300 mail messages per 5
minute period. If less than that, MRTG will report that
you have 0 messages per minute, shown in 5 minute
graphinh increments. Because if you get *close* to
300, but not quite 300 (like 299), is less than
1. Therefore it will show up as a 0 rate for that
5 minute time period. If you continue to get less than
1 message per second on average, the graph
will continue to show 0. Once you get the idea,
it's pretty easy to follow. Of course, there are options
you can add (like perminute) to change that
graphing/data collection behavior.
Make sense? Good. If not, keep asking questions,
We were all newbies once.
Remember that MRTG was designed to report data
flowing through a network interface in five minute
intervals. It has evolved into being able to report
on any integer rate of change over time, typically
in 5 min, 30 min, 2 hour and 24 hour increments.
Paul
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://lists.ee.ethz.ch/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the mrtg
mailing list