[mrtg] Time drift in entries in log file.

Ayaz Ahmed Khan ayaz at ayaz.pk
Sun Mar 18 08:38:31 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Steve Shipway" typed:
> "Ayaz Ahmed Khan" wrote:
>> I have setup MRTG on a system at work.  In the log file generated and
>> subsequently updated by MRTG, I am seeing a time drift of anywhere
>> from 2, 3 to 4 seconds in lines 2 to 4, despite MRTG being set to poll
>> every five
>
> I don't think this is a cause for concern.  Polling will often take
> varying times as it depends on server and network loading.  However,
> MRTG compensates for this by adjusting its internal rates based on the
> data logging times, so if the poll happens a few seconds late, then the
> rate of change will be very slightly adjusted to reflect this.  If you
> use gauge, though, I think the numbers may be logged as-is to the data
> time window.

The drift is in lines 2 and lines 3 only.  The rest of the lines vary by an 
absolute number of seconds, which is 300 seconds in my case.  

I'm writing a Perl script that retrieves traffic data and time from the log 
file every five minutes (or more, depending on how long the script takes to 
reach the point where the function that parses the mrtg log file is called), 
and I'm required to return values for those lines in the log file where the 
timestamp matches a defined criteria and is a multiple of 300 [seconds].  
Only lines 2 and 3 are showing an inexplicable drift of 2, sometimes 3, or 4 
seconds, which is adjusted by MRTG in the next run but the new values 
introduced in place of lines 2 and 3 have a similar drift again (which is 
again adjusted on the next run and so on).  I am, right now, achieving what 
is required by ignoring lines 1-3.  This seems to work perfectly, but I am 
curious why the drift is there, and whether it is something that can be seen 
anywhere where MRTG is deployed or it is valid only in my case and for my 
setup.

The MRTG is set up, in my environment, in a local LAN settings and I should 
like to believe that there are no apparent delays in anything and no 
perceptible network load, either.

Thank you for replying, Steve and Stuart.  Your replies are much appreciated.

- -- 
Ayaz Ahmed Khan

Falling in love makes smoking pot all day look like the ultimate in
restraint.
                -- Dave Sim, author of "Cerebus".
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iQEVAwUBRfzsigFi6bOwa2ADAQKTCAf+JTVIrSXK/Dmkrjn/mlsKsyERoPxYYK5n
4kfd0hbc72acDodlZF0SczRsbMbKdIU5l8NElbZdNuMCH7ofRncDqHOSYwCDUH61
vfdsqE4R1rnszJCARJ075P0tWZhp5Z7nG/QWlr+AxTwhER9fZU54wYTFls4daX86
sHnPtfTIUwusrSLeWqxf+31RiInsBMZkhNbS9ZaVPNa79MA0Jw9xFZgMcjnkiKeH
wCVdhtCO9sQxqJ1GtOZ1mVjK68F/VL2JCcOYKvDkvzJ7j56fvnn5zCpj6e57NCoO
THpOHD5nFctWtSQwKNxv8Dszbx8MLb5GWK2MF0v6NFFKYxf8AArGbA==
=vwc9
-----END PGP SIGNATURE-----



More information about the mrtg mailing list