hi again,

On Thu, Jul 20, 2006 at 02:41:47PM +0200, Attila Csipa wrote:
> On Thursday 20 July 2006 14:00, Michael Ablassmeier wrote:
> 
> > > > completely. Also, the shipped binary does log rotation/deletion of it's
> > > > own, so the logrotate entry is fairly useless (it will rotate only the
> > > > last 5 minutes worth of logs).
> > >
> > > hm, indeed, you are right, i think removing the logrotate entries might
> > > be safe. Im going to fix this in SVN asap.
> >
> > hm, im not sure about that. The zabbix-server just keeps one .old file
> > which he overwrites frequently (so you cant have a history of lets say 7
> > logfiles). So, the lograte script does make some at least some kind of
> > sense.  
> 
> If I'm not mistaken it zabbix rotates the current log file every 5 minutes 
> (to .old, and discards the previous .old). 

looking at the source it does something like:

common.h:
  #define MAX_LOG_FILE_LEN (1024*1024)

log.c:
  if(buf.st_size > MAX_LOG_FILE_LEN)
  {
     strscpy(filename_old,log_filename);
     strncat(filename_old,".old",MAX_STRING_LEN);
     if(rename(log_filename,filename_old) != 0)
     {
/*         exit(1);*/
      }    
  }   
  
so it actually rotates by size, looking at my zabbix-server's log proves 
this:

-rw-r--r--  1 zabbix zabbix 150K 2006-07-20 14:49 zabbix_server.log
-rw-r--r--  1 zabbix zabbix 1,1M 2006-07-20 04:16 zabbix_server.log.old

> So all logrotate can do is rotate 
> logs which will be 5 minutes old at best (regardless if you rotate .old or 
> the real zabbix-server.log), at the present setting of daily log rotation you 
> will have a 5 minute snip of that whole day's logs (not too useful). The 
> ideal solution would be to turn off zabbix-server's internal log rotation but 
> I have not found an option to do that in the .conf :(

well, im not sure. I think im going to report this feature request
upstream. Even tho its quite unlikely your zabbix-server.log grows more
than 1024*1024 per day, it may result in logging-data getting lost (if
.old is overwritten more than once per day). But it still makes sense to
have a logrotate there, though.

bye,
    - michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to