[mrtg] Re: 4th and 5th columns in MRTG logfile

James Overbeck grendel at gmo.jp
Mon Feb 17 09:28:55 MET 2003


Hello Shahira,
	Please try easing off on the punctuation marks. People will consider you
more polite, and helpful responses will be more numerous.
	As an example, I'll give you the first five lines from a random MRTG log
file at my company.

1045468925 2732540222 3943054909
1045468925 94785 118521 94785 118521
1045468623 146518 156904 146518 156904
1045468500 127347 165933 146518 178574
1045468200 99205 150287 100508 178574

	Look at the first column in each row. That is the number of seconds that
have passed since January 1, 1970, Greenwich Mean Time. Notice that the
fourth and fifth timestamps end in double zeros while the first three end in
comparatively random numbers. If you are on some sort of Unix system you can
transform them into legible times like this:

$ perl -e 'print(localtime(1045468925)."\n")'
Mon Feb 17 17:02:05 2003

$ perl -e 'print(localtime(1045468200)."\n")'
Mon Feb 17 16:55:00 2003

	If you look on down the timestamps in any MRTG log file and look at the
legible times like this, you'll notice that the minutes are always divisible
by five except for the first three lines' timestamps. The crontab that
generated this log file runs every five minutes at 16:57, 17:02, 17:07, and
so on. MRTG takes a few seconds to run before it actually touches the log
file. For the first few timestamps it maintains the same five minute
intervals as whatever crontab that affected the log file. From the fourth
line onward MRTG shifts this interval such that the minutes of the timestamp
are divisible by five, and begins to calculate the new average and maximum
for each displaced interval. If my crontab were set to run every five
minutes on the five-minute, and if my config file were very short and very
fast, then average and max for the first day would be identical.
	I'm guessing that displacing the interval like this makes calculations easier.

Best regards,
James


Shahira Rasmy wrote:
> Deal All,
> I need an urgent help in this.I still can't understand the values in the 4th and 5th columns in MRTG log file.
> I know they represent the maximum in a given period,but i can't understand what is this period in case of daily section??????
> I  thought that the 2nd & 4th,and, the 3rd & 5th columns will be identical as the reading is taken every 5 minutes so the max in this period will be the value itself.But i found the values to be different!!!!!!
> 
> Can anyone help me to understand how the mrtg thinks??????????????
> 
> Thanks,
> Shahira

--
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