<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.28.3">
</HEAD>
<BODY>
Hi Steve<BR>
<BR>
Thank you for your reply. <BR>
<BR>
When I looked at the subjects of the e-mails coming back to root when with all the MRTG errors, I noticed that there were two distinct subject lines.<BR>
<BR>
You were correct in the last statement in (b) ... there were TWO MRTG processes being triggered. I had not realised that Fedora 12 installs a cron file as /etc/cron.d/mrtg. I had ALSO created one in root's crontab. Since removing the one (root's crontab) I no longer am getting errors in my mail, and so expect that the data will no longer be lost.<BR>
<BR>
Oh, and I was running SELinix, and re-applied permissions, which naturally made no difference.<BR>
<BR>
Thanks for the assistance. Perhaps you can add your answer to the FAQ somewhere? I saw a number of people asking the same question, but no real answer being given.<BR>
<BR>
Regards<BR>
Louis<BR>
<BR>
<BR>
On Sat, 2010-04-24 at 09:51 +1200, Steve Shipway wrote:
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">All the values being reset to zero indicates that your .log file is being somehow deleted and re-created with no data. My guess is one of two things. Either :</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">a) You have some periodic job (eg, a 'tidy up' script) which is periodically removing the .log files for some reason. Maybe a coding error or somesuch is causing the files to be incorrectly deleted. To test for this, stop MRTG for a while, and see if the .log file disappear.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">b) The permissions or ACLs on the directory holding the .log files is such that the MRTG process has problems during the update process. Normally (I think!) MRTG makes a copy of the .log file, updates this, then moves it back to replace the old one. Possibly (from the errors you report) a problem occurs during this move/rename process. Try doing a temporary chmod 777 on the directory and files to see if this fixes it (though this is not a good long-term solution of course). Do you have SELINUX installed -- this could be affecting rights to remove files, though create and update is OK? Do you accidentally have multiple MRTG processes running, such as one owned by root and one by a MRTG user? And so on.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">The erros indicate problems in renaming the files. Check that there are not a load of *.tmp or *.old files hanging about in the directory (if so, delete them). Also run an fsck on the filesystem, in case there is filesystem corruption affecting the directory. </FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">You might also like to consider moving to using MRTG with RRDTool instead of in Native mode (with .log files) as this is more powerful, albeit a bit more complex.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Steve</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<HR>
<BR>
<B><FONT SIZE="2"><FONT COLOR="#000000">From:</FONT></FONT></B><FONT COLOR="#000000"><FONT SIZE="2"> mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch] On Behalf Of Louis van Dyk [louis@qdcec.co.za]</FONT></FONT><BR>
<B><FONT SIZE="2"><FONT COLOR="#000000">Sent:</FONT></FONT></B><FONT COLOR="#000000"><FONT SIZE="2"> Saturday, 24 April 2010 6:46 a.m.</FONT></FONT><BR>
<B><FONT SIZE="2"><FONT COLOR="#000000">To:</FONT></FONT></B><FONT COLOR="#000000"><FONT SIZE="2"> mrtg@lists.oetiker.ch</FONT></FONT><BR>
<B><FONT SIZE="2"><FONT COLOR="#000000">Subject:</FONT></FONT></B><FONT COLOR="#000000"><FONT SIZE="2"> [mrtg] Logfile entries reset to zeroes after a few hours</FONT></FONT><BR>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">Hi</FONT><BR>
<BR>
<FONT COLOR="#000000">I have been running mrtg for many years on many different Linux boxes and have always had no problem with it. But now I am in desperate need of assistance. </FONT><BR>
<BR>
<FONT COLOR="#000000">I am running Fedora 12 and installed mrtg from the Fedora repository:</FONT><BR>
<FONT COLOR="#000000">mrtg-2.16.2-4.fc12.x86_64</FONT><BR>
<BR>
<FONT COLOR="#000000">I am only monitoring ONE device and have set the following entry in root's crontab file:</FONT><BR>
<FONT COLOR="#000000">*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg</FONT><BR>
<BR>
<FONT COLOR="#000000">There are a number of interfaces being monitored on the device. The CFG file was configured with cfgmaker.</FONT><BR>
<BR>
<FONT COLOR="#000000">THE PROBLEM: Every few hours the logfile entries are reset to ZEROS through out the file, a few hours into the log file. It is apparently random, in that if I look at the graphs they all cut off at different times over the last 24 hours. So the graphs have only a few hours on each of them before flattening to zero.</FONT><BR>
<BR>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>