cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
620
Views
0
Helpful
5
Replies

Log rotation not working

nawas
Level 4
Level 4

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

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

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.

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

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.

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.

Thanks.

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: