Log rotation not working

Unanswered Question
Apr 10th, 2009

I have set up log rotation to roate almost every log file in var/adm/CSCOpx/log and I set it to keep zero archive. It was working until last week. I have noticed that my log rotation is now keeping several version of the log file and filling var/adm/CSCOpx/log utpo 88%.

/dev/md/dsk/d112 14449643 12485252 1861185 88% /var/adm/CSCOpx

Anyone can tell me what I could be doing wrong?

I'm on RME4.0.6 and solaris9

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Joe Clarke Fri, 04/10/2009 - 14:17

Please post your /opt/CSCOpx/objects/logrot/logrot.conf file. If you have configured logrot to maintain multiple versions of archived logs, then what you're seeing is expected. You have two choices: either specify an archive directory in which logrot can store these archives, or disable archiving old log files.

nawas Mon, 04/13/2009 - 07:33

I have configured to NOT keep multiple versions of archives but appears that I have multiple version of archive, here is the logrot.conf file and output from var/adm/CSCOpx/log directory

Joe Clarke Mon, 04/13/2009 - 08:07

Some of these numbered files are created by the log4j subsystem which is independent from logrot. In order to disable that, you would have to edit the numerous log4j properties files used by LMS, and set MaxBackupIndex to 0. Alternatively, you can configure a cron job (or add something to your logrot cron job) which purges all *.[0-9] files from /var/adm/CSCOpx/log.

nawas Mon, 04/13/2009 - 08:38

There are several files that are not numbered and in my logrot list but still not being rotated as they used to be? Secondly,I haven't seen those numbered files until now, what you think may have broken, I haven't made any updates to the OS or the CiscoWorks in several months. Can I manually delete those log file? Do I have to have casuser password to do that? I saw log4j under opt/CSCOpx/object but I couldn't find its properties file.


Joe Clarke Mon, 04/13/2009 - 09:10

Yes, you can manually delete the numbered archives as root. As I said, you can add a cron job to do it automatically.

The various LMS applications have different log4j settings, but in general, the archived log files get created when the main log file reaches as certain size.

Some log files cannot be rotated properly while dmgtd is running. That is, they will get truncated to 0 bytes, but due to the way they are opened, they will immediately jump back to their previous size as soon as they are written to again. The only workaround for this is to perform an offline rotation (i.e. run logrot.pl with the -s flag).


This Discussion