[mrtg] Re: mrtg log formula known, but don't understand it.
Alex van den Bogaerdt
alex at ergens.op.het.net
Fri Mar 5 13:13:16 MET 2004
On Fri, Mar 05, 2004 at 11:40:35AM -0000, Robin Butler wrote:
> I am trying to configure MRTG to monitor a number of routers and
> switches but so far I have encountered some problems.
> This problem seems to be caused when MRTG is processing data for its log
> entry, it multiplies the data by 1000 which causes the entry to exceed
> the maximum bandwidth for a given interface and is therefore discarded
> by the MRTG logs.
> I understand the format of the MRTG log files is as follows:
> First line: <UNIX_time_in_seconds_since_epoch>
> <current_input_value_in_bytes> <current_output_value_in_bytes>
I prefer: <time> <inbytes> <outbytes>
> Data: < UNIX_time_in_seconds_since_epoch>
> <input_during_time_interval_in_bytes> <input_average_in_bytes>
> <output_during_time_interval_in_bytes> <output_average_in_bytes>
It is: <time> <inb AVG> <inb MAX> <outb AVG> <outb MAX>
> Initially no data was being recorded in the logs.
> After debugging MRTG I understand this was caused by the amount of data
> (input and output) exceeding the MaxBytes option. This option was
> correctly configured by cfgmaker for the interface bandwidth.
This was copied from the device. If the device has this setting wrong,
so will cfgmaker.
> I understand that MRTG (cfgmaker) calculates MaxBytes as follows:
> Interface speed 256Kbps (Kilo bits)
> 256 / 8 = 32KBps (Kilo Bytes)
> 32 * 1000 = 32000 B/s (Bytes per second)
> MaxBytes = 32000
> However, data logged by MRTG seems to massively exceed this threshold.
It is logged, or it is not. If it would exceed maxbytes, it would not
> On further analysis, the following equation seems to be used by MRTG to
> calculate a log entry.
> ((current_input_value_in_bytes - previous_input_value_in_bytes) /
> time_interval) * 1K) = data entry
No. <current_time - previous_time> / <current_val - previous_val>
> Most of which makes sense except the last multiplication. Why multiply
> the data by 1000 when it is already in Bps?
MRTG does not do this. It may be possible you tell MRTG to alter
the value it gets from the device. The altered value goes in above
> My mrtg.cfg test config file is as follows:
> Interval: 5
> WorkDir: /mrtg-test
> Options[_]: bits,nobanner,growright
> Target[184.108.40.206_3]: 3:COMSTR at 220.127.116.11:
> SetEnv[18.104.22.168_3]: MRTG_INT_IP="22.214.171.124" MRTG_INT_DESCR="Serial3/0"
> #MaxBytes[126.96.36.199_3]: 32000
> MaxBytes[188.8.131.52_3]: 32000000
> Title[184.108.40.206_3]: Traffic Analysis for 3 - host.domain.com
Do the following:
Watch the log file closely. Wait until it is updated. Copy the
first line of this file and wait. After the next update, copy the
first line again. Do the math. Repeat a few times.
Outcome: the increase of the counters, in bytes, per second.
Compare to maxbytes.
This message was produced without any <iframe tags
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
More information about the mrtg